Implement shm* syscalls and fix 64/32bit errors