ipc32.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. asmlinkage long sys32_ipc(u32 call, int first, int second, int third,
  12. compat_uptr_t ptr, u32 fifth)
  13. {
  14. int version;
  15. version = call >> 16; /* hack for backward compatibility */
  16. call &= 0xffff;
  17. switch (call) {
  18. case SEMOP:
  19. /* struct sembuf is the same on 32 and 64bit :)) */
  20. return sys_semtimedop(first, compat_ptr(ptr), second, NULL);
  21. case SEMTIMEDOP:
  22. return compat_sys_semtimedop(first, compat_ptr(ptr), second,
  23. compat_ptr(fifth));
  24. case SEMGET:
  25. return sys_semget(first, second, third);
  26. case SEMCTL:
  27. return compat_sys_semctl(first, second, third, compat_ptr(ptr));
  28. case MSGSND:
  29. return compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
  30. case MSGRCV:
  31. return compat_sys_msgrcv(first, second, fifth, third,
  32. version, compat_ptr(ptr));
  33. case MSGGET:
  34. return sys_msgget((key_t) first, second);
  35. case MSGCTL:
  36. return compat_sys_msgctl(first, second, compat_ptr(ptr));
  37. case SHMAT:
  38. return compat_sys_shmat(first, second, third, version,
  39. compat_ptr(ptr));
  40. case SHMDT:
  41. return sys_shmdt(compat_ptr(ptr));
  42. case SHMGET:
  43. return sys_shmget(first, (unsigned)second, third);
  44. case SHMCTL:
  45. return compat_sys_shmctl(first, second, compat_ptr(ptr));
  46. }
  47. return -ENOSYS;
  48. }