--- qemu-0.8.2.orig/linux-user/syscall.c 2007-01-31 23:06:58 +0300 +++ qemu-0.8.2/linux-user/syscall.c 2007-01-31 23:22:12 +0300 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1188,6 +1189,12 @@ uint32_t size; } shm_regions[N_SHM_REGIONS]; +union semun { + int val; + struct senid_ds *buf; + unsigned short *array; +}; + /* ??? This only works with linear mappings. */ static long do_ipc(long call, long first, long second, long third, long ptr, long fifth) @@ -1202,6 +1209,23 @@ call &= 0xffff; switch (call) { + case IPCOP_semop: + ret = get_errno(semop(first,(struct sembuf *) ptr, second)); + break; + + case IPCOP_semget: + ret = get_errno(semget(first, second, third)); + break; + + case IPCOP_semctl: + ret = get_errno(semctl(first, second, third, ((union semun*)ptr)->val)); + + break; + + case IPCOP_semtimedop: + gemu_log("Unsupported ipc call: %ld (version %d)\n", call, version); + ret = -ENOSYS; + break; case IPCOP_shmat: /* SHM_* flags are the same on all linux platforms */ ret = get_errno((long) shmat(first, (void *) ptr, second));