2007-07-10 18:55:54 +02:00
|
|
|
Index: qemu/linux-user/syscall.c
|
2007-11-13 21:32:02 +01:00
|
|
|
================================================================================
|
|
|
|
--- qemu/linux-user/syscall.c
|
2007-07-10 18:55:54 +02:00
|
|
|
+++ qemu/linux-user/syscall.c
|
2007-11-13 21:32:02 +01:00
|
|
|
@@ -1983,9 +1983,19 @@
|
2007-07-10 18:55:54 +02:00
|
|
|
|
|
|
|
switch (call) {
|
|
|
|
case IPCOP_semop:
|
2007-11-13 21:32:02 +01:00
|
|
|
- ret = get_errno(semop(first,(struct sembuf *)g2h(ptr), second));
|
2007-07-10 18:55:54 +02:00
|
|
|
+ {
|
|
|
|
+ struct sembuf *target_sops;
|
|
|
|
+ int i;
|
2007-11-13 21:32:02 +01:00
|
|
|
+ lock_user_struct(VERIFY_READ, target_sops, ptr, 0);
|
2007-07-10 18:55:54 +02:00
|
|
|
+ for(i=0; i<second; i++) {
|
|
|
|
+ target_sops[i].sem_num = tswap16(target_sops[i].sem_num);
|
|
|
|
+ target_sops[i].sem_op = tswap16(target_sops[i].sem_op);
|
|
|
|
+ target_sops[i].sem_flg = tswap16(target_sops[i].sem_flg);
|
|
|
|
+ }
|
|
|
|
+ ret = get_errno(semop(first, target_sops, second));
|
|
|
|
+ unlock_user_struct(target_sops, ptr, 0);
|
|
|
|
break;
|
|
|
|
-
|
|
|
|
+ }
|
|
|
|
case IPCOP_semget:
|
|
|
|
ret = get_errno(semget(first, second, third));
|
|
|
|
break;
|