]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - ipc/syscall.c
2 * sys_ipc() is the old de-multiplexer for the SysV IPC calls.
4 * This is really horribly ugly, and new architectures should just wire up
5 * the individual syscalls instead.
7 #include <linux/unistd.h>
9 #ifdef __ARCH_WANT_SYS_IPC
10 #include <linux/errno.h>
11 #include <linux/ipc.h>
12 #include <linux/shm.h>
13 #include <linux/syscalls.h>
14 #include <linux/uaccess.h>
16 SYSCALL_DEFINE6(ipc
, unsigned int, call
, int, first
, unsigned long, second
,
17 unsigned long, third
, void __user
*, ptr
, long, fifth
)
21 version
= call
>> 16; /* hack for backward compatibility */
26 return sys_semtimedop(first
, (struct sembuf __user
*)ptr
,
29 return sys_semtimedop(first
, (struct sembuf __user
*)ptr
,
31 (const struct timespec __user
*)fifth
);
34 return sys_semget(first
, second
, third
);
39 if (get_user(fourth
.__pad
, (void __user
* __user
*) ptr
))
41 return sys_semctl(first
, second
, third
, fourth
);
45 return sys_msgsnd(first
, (struct msgbuf __user
*) ptr
,
50 struct ipc_kludge tmp
;
54 if (copy_from_user(&tmp
,
55 (struct ipc_kludge __user
*) ptr
,
58 return sys_msgrcv(first
, tmp
.msgp
, second
,
62 return sys_msgrcv(first
,
63 (struct msgbuf __user
*) ptr
,
64 second
, fifth
, third
);
67 return sys_msgget((key_t
) first
, second
);
69 return sys_msgctl(first
, second
, (struct msqid_ds __user
*)ptr
);
75 ret
= do_shmat(first
, (char __user
*)ptr
,
79 return put_user(raddr
, (unsigned long __user
*) third
);
83 * This was the entry point for kernel-originating calls
84 * from iBCS2 in 2.2 days.
89 return sys_shmdt((char __user
*)ptr
);
91 return sys_shmget(first
, second
, third
);
93 return sys_shmctl(first
, second
,
94 (struct shmid_ds __user
*) ptr
);