mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Use msgsnd syscall for Linux implementation
This patch add a direct call to msgsnd syscall if it is supported by kernel features. hecked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/alpha/syscalls.list (msgsnd): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/hppa/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/microblaze/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/msgsnd.c (__libc_msgsnd): Use msgsnd syscall if defined.
This commit is contained in:
@@ -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 __ASSUME_DIRECT_SYSVIPC_SYSCALLS
|
||||
return SYSCALL_CANCEL (msgsnd, msqid, msgp, msgsz, msgflg);
|
||||
#else
|
||||
return SYSCALL_CANCEL (ipc, IPCOP_msgsnd, msqid, msgsz, msgflg,
|
||||
(void *) msgp);
|
||||
msgp);
|
||||
#endif
|
||||
}
|
||||
weak_alias (__libc_msgsnd, msgsnd)
|
||||
|
||||
Reference in New Issue
Block a user