about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/msgrcv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/msgrcv.c')
-rw-r--r--sysdeps/unix/sysv/linux/msgrcv.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/sysdeps/unix/sysv/linux/msgrcv.c b/sysdeps/unix/sysv/linux/msgrcv.c
index c4dd219097..489d6296c7 100644
--- a/sysdeps/unix/sysv/linux/msgrcv.c
+++ b/sysdeps/unix/sysv/linux/msgrcv.c
@@ -16,33 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
 #include <sys/msg.h>
 #include <ipc_priv.h>
-
 #include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-/* Kludge to work around Linux' restriction of only up to five
-   arguments to a system call.  */
-struct ipc_kludge
-  {
-    void *msgp;
-    long int msgtyp;
-  };
-
 
 ssize_t
 __libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp,
 	       int msgflg)
 {
-  /* The problem here is that Linux' calling convention only allows up to
-     fives parameters to a system call.  */
-  struct ipc_kludge tmp;
-
-  tmp.msgp = msgp;
-  tmp.msgtyp = msgtyp;
-
-  return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+  return SYSCALL_CANCEL (msgrcv, msqid, msgp, msgsz, msgtyp, msgflg);
+#else
+  return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg,
+			 MSGRCV_ARGS (msgp, msgtyp));
+#endif
 }
 weak_alias (__libc_msgrcv, msgrcv)