fixed sysmem to work on linux