This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 03/15] Use msgsnd syscall for Linux implementation
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Tue, 1 Nov 2016 12:25:11 -0200
- Subject: [PATCH 03/15] Use msgsnd syscall for Linux implementation
- Authentication-results: sourceware.org; auth=none
- References: <1478010323-13076-1-git-send-email-adhemerval.zanella@linaro.org>
This patch add a direct call to msgsnd syscall if it is defined by
kernel headers.
hecked on x86_64, i686, powerpc64le, aarch64, and armhf.
* sysdeps/unix/sysv/linux/msgsnd.c (__libc_msgsnd): Use msgsnd syscall
if defined.
---
ChangeLog | 3 +++
sysdeps/unix/sysv/linux/msgsnd.c | 7 ++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/msgsnd.c b/sysdeps/unix/sysv/linux/msgsnd.c
index 1457e43..2928493 100644
--- a/sysdeps/unix/sysv/linux/msgsnd.c
+++ b/sysdeps/unix/sysv/linux/msgsnd.c
@@ -16,17 +16,18 @@
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>
int
__libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
{
+#ifdef __NR_msgsnd
+ return SYSCALL_CANCEL (msgsnd, msqid, msgp, msgsz, msgflg);
+#else
return SYSCALL_CANCEL (ipc, IPCOP_msgsnd, msqid, msgsz, msgflg,
(void *) msgp);
+#endif
}
weak_alias (__libc_msgsnd, msgsnd)
--
2.7.4