Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #include <linux/kernel.h> |
2 | #include <linux/spinlock.h> | |
3 | #include <linux/list.h> | |
4 | #include <linux/syscalls.h> | |
5 | #include <linux/time.h> | |
6 | #include <linux/sem.h> | |
7 | #include <linux/msg.h> | |
8 | #include <linux/shm.h> | |
9 | #include <linux/ipc.h> | |
10 | #include <linux/compat.h> | |
11 | ||
2da06b4e TG |
12 | asmlinkage long sys32_ipc(u32 call, int first, int second, int third, |
13 | compat_uptr_t ptr, u32 fifth) | |
1da177e4 LT |
14 | { |
15 | int version; | |
16 | ||
17 | version = call >> 16; /* hack for backward compatibility */ | |
18 | call &= 0xffff; | |
19 | ||
20 | switch (call) { | |
2da06b4e | 21 | case SEMOP: |
1da177e4 LT |
22 | /* struct sembuf is the same on 32 and 64bit :)) */ |
23 | return sys_semtimedop(first, compat_ptr(ptr), second, NULL); | |
2da06b4e | 24 | case SEMTIMEDOP: |
1da177e4 LT |
25 | return compat_sys_semtimedop(first, compat_ptr(ptr), second, |
26 | compat_ptr(fifth)); | |
2da06b4e | 27 | case SEMGET: |
1da177e4 | 28 | return sys_semget(first, second, third); |
2da06b4e | 29 | case SEMCTL: |
1da177e4 LT |
30 | return compat_sys_semctl(first, second, third, compat_ptr(ptr)); |
31 | ||
2da06b4e | 32 | case MSGSND: |
1da177e4 | 33 | return compat_sys_msgsnd(first, second, third, compat_ptr(ptr)); |
2da06b4e | 34 | case MSGRCV: |
1da177e4 LT |
35 | return compat_sys_msgrcv(first, second, fifth, third, |
36 | version, compat_ptr(ptr)); | |
2da06b4e | 37 | case MSGGET: |
1da177e4 | 38 | return sys_msgget((key_t) first, second); |
2da06b4e | 39 | case MSGCTL: |
1da177e4 LT |
40 | return compat_sys_msgctl(first, second, compat_ptr(ptr)); |
41 | ||
2da06b4e | 42 | case SHMAT: |
1da177e4 LT |
43 | return compat_sys_shmat(first, second, third, version, |
44 | compat_ptr(ptr)); | |
2da06b4e | 45 | case SHMDT: |
1da177e4 | 46 | return sys_shmdt(compat_ptr(ptr)); |
2da06b4e | 47 | case SHMGET: |
1da177e4 | 48 | return sys_shmget(first, (unsigned)second, third); |
2da06b4e | 49 | case SHMCTL: |
1da177e4 LT |
50 | return compat_sys_shmctl(first, second, compat_ptr(ptr)); |
51 | } | |
52 | return -ENOSYS; | |
53 | } |