9 #define __NR___libc_msgctl __NR_msgctl
10 static __inline__ _syscall3(int, __libc_msgctl, int, msqid, int, cmd, struct msqid_ds *, buf);
12 /* Message queue control operation. */
13 int msgctl(int msqid, int cmd, struct msqid_ds *buf)
16 return __libc_msgctl(msqid, cmd | __IPC_64, buf);
18 return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf, 0);
26 _syscall2(int, msgget, key_t, key, int, msgflg)
28 /* Get messages queue. */
29 int msgget (key_t key, int msgflg)
31 return __syscall_ipc(IPCOP_msgget ,key ,msgflg ,0 ,0, 0);
38 struct msgbuf * oldmsg;
39 long int r_msgtyp; /* the fifth arg of __syscall_ipc */
41 /* Receive message from message queue. */
46 _syscall5(ssize_t, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg)
48 ssize_t msgrcv (int msqid, void *msgp, size_t msgsz,
49 long int msgtyp, int msgflg)
51 struct new_msg_buf temp;
53 temp.r_msgtyp = msgtyp;
55 return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp, 0);
64 _syscall4(int, msgsnd, int, msqid, const void *, msgp, size_t, msgsz, int, msgflg)
66 /* Send message to message queue. */
67 int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
69 return __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp, 0);