summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-02 22:05:00 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-02 22:05:00 +0000
commitfa2948167f9dadfe9fd079f1e278742efae4d89f (patch)
treeb955c649f70c252743b147e476e153773c68d8b2 /linux-user/syscall.c
parentb49d07ba03bd727f198d92749147ec1a9bee6509 (diff)
downloadfocaccia-qemu-fa2948167f9dadfe9fd079f1e278742efae4d89f.tar.gz
focaccia-qemu-fa2948167f9dadfe9fd079f1e278742efae4d89f.zip
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
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 21f559ebc6..2b37aa809c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -42,6 +42,7 @@
 #include <sys/poll.h>
 #include <sys/times.h>
 #include <sys/shm.h>
+#include <sys/sem.h>
 #include <sys/statfs.h>
 #include <utime.h>
 #include <sys/sysinfo.h>
@@ -1114,6 +1115,12 @@ static struct shm_region {
     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)
@@ -1128,6 +1135,23 @@ static long do_ipc(long call, long first, long second, long third,
     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));