Commit fa2948167f9dadfe9fd079f1e278742efae4d89f

Authored by ths
1 parent b49d07ba

sem* and msg* for qemu, part1, by Kirill Shutemov.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2382 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 24 additions and 0 deletions
linux-user/syscall.c
... ... @@ -42,6 +42,7 @@
42 42 #include <sys/poll.h>
43 43 #include <sys/times.h>
44 44 #include <sys/shm.h>
  45 +#include <sys/sem.h>
45 46 #include <sys/statfs.h>
46 47 #include <utime.h>
47 48 #include <sys/sysinfo.h>
... ... @@ -1114,6 +1115,12 @@ static struct shm_region {
1114 1115 uint32_t size;
1115 1116 } shm_regions[N_SHM_REGIONS];
1116 1117  
  1118 +union semun {
  1119 + int val;
  1120 + struct senid_ds *buf;
  1121 + unsigned short *array;
  1122 +};
  1123 +
1117 1124 /* ??? This only works with linear mappings. */
1118 1125 static long do_ipc(long call, long first, long second, long third,
1119 1126 long ptr, long fifth)
... ... @@ -1128,6 +1135,23 @@ static long do_ipc(long call, long first, long second, long third,
1128 1135 call &= 0xffff;
1129 1136  
1130 1137 switch (call) {
  1138 + case IPCOP_semop:
  1139 + ret = get_errno(semop(first,(struct sembuf *) ptr, second));
  1140 + break;
  1141 +
  1142 + case IPCOP_semget:
  1143 + ret = get_errno(semget(first, second, third));
  1144 + break;
  1145 +
  1146 + case IPCOP_semctl:
  1147 + ret = get_errno(semctl(first, second, third, ((union semun*)ptr)->val));
  1148 +
  1149 + break;
  1150 +
  1151 + case IPCOP_semtimedop:
  1152 + gemu_log("Unsupported ipc call: %ld (version %d)\n", call, version);
  1153 + ret = -ENOSYS;
  1154 + break;
1131 1155 case IPCOP_shmat:
1132 1156 /* SHM_* flags are the same on all linux platforms */
1133 1157 ret = get_errno((long) shmat(first, (void *) ptr, second));
... ...