diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-21 23:15:25 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-03 23:00:27 -0500 |
commit | 56e41d3c5aa84d679eebdb3cb8a70b03c5fbd6c3 (patch) | |
tree | 62ede9a6cc31ed46d78632b65c4a66485fd5d1ad /ipc/compat.c | |
parent | d5dc77bfeeab0b03a32e3db5e31e2f64605634ab (diff) |
merge compat sys_ipc instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc/compat.c')
-rw-r--r-- | ipc/compat.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ipc/compat.c b/ipc/compat.c index 2547f29dcd1b..1da2e2eb9d70 100644 --- a/ipc/compat.c +++ b/ipc/compat.c | |||
@@ -368,6 +368,50 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third, | |||
368 | return do_msgrcv(first, uptr, second, msgtyp, third, | 368 | return do_msgrcv(first, uptr, second, msgtyp, third, |
369 | compat_do_msg_fill); | 369 | compat_do_msg_fill); |
370 | } | 370 | } |
371 | |||
372 | COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second, | ||
373 | u32, third, compat_uptr_t, ptr, u32, fifth) | ||
374 | { | ||
375 | int version; | ||
376 | |||
377 | version = call >> 16; /* hack for backward compatibility */ | ||
378 | call &= 0xffff; | ||
379 | |||
380 | switch (call) { | ||
381 | case SEMOP: | ||
382 | /* struct sembuf is the same on 32 and 64bit :)) */ | ||
383 | return sys_semtimedop(first, compat_ptr(ptr), second, NULL); | ||
384 | case SEMTIMEDOP: | ||
385 | return compat_sys_semtimedop(first, compat_ptr(ptr), second, | ||
386 | compat_ptr(fifth)); | ||
387 | case SEMGET: | ||
388 | return sys_semget(first, second, third); | ||
389 | case SEMCTL: | ||
390 | return compat_sys_semctl(first, second, third, compat_ptr(ptr)); | ||
391 | |||
392 | case MSGSND: | ||
393 | return compat_sys_msgsnd(first, second, third, compat_ptr(ptr)); | ||
394 | case MSGRCV: | ||
395 | return compat_sys_msgrcv(first, second, fifth, third, | ||
396 | version, compat_ptr(ptr)); | ||
397 | case MSGGET: | ||
398 | return sys_msgget(first, second); | ||
399 | case MSGCTL: | ||
400 | return compat_sys_msgctl(first, second, compat_ptr(ptr)); | ||
401 | |||
402 | case SHMAT: | ||
403 | return compat_sys_shmat(first, second, third, version, | ||
404 | compat_ptr(ptr)); | ||
405 | case SHMDT: | ||
406 | return sys_shmdt(compat_ptr(ptr)); | ||
407 | case SHMGET: | ||
408 | return sys_shmget(first, (unsigned)second, third); | ||
409 | case SHMCTL: | ||
410 | return compat_sys_shmctl(first, second, compat_ptr(ptr)); | ||
411 | } | ||
412 | |||
413 | return -ENOSYS; | ||
414 | } | ||
371 | #else | 415 | #else |
372 | long compat_sys_semctl(int semid, int semnum, int cmd, int arg) | 416 | long compat_sys_semctl(int semid, int semnum, int cmd, int arg) |
373 | { | 417 | { |