From f4491417cc80b4a01e72e9d218af137765ee5918 Mon Sep 17 00:00:00 2001 From: Rajalakshmi Srinivasaraghavan Date: Tue, 25 Aug 2015 10:23:47 -0300 Subject: Call direct system calls for socket operations Explicit system calls for the socket operations were added in Linux kernel in commit 86250b9d12ca for powerpc. This patch make use of those instead of calling socketcall to save number of cycles on networking syscalls. 2015-08-25 Rajalakshmi Srinivasaraghavan * sysdeps/unix/sysv/linux/powerpc/kernel-features.h: Define new macros. * sysdeps/unix/sysv/linux/accept.c: Call direct system call. * sysdeps/unix/sysv/linux/bind.c: Call direct system call. * sysdeps/unix/sysv/linux/connect.c: Call direct system call. * sysdeps/unix/sysv/linux/getpeername.c: Call direct system call. * sysdeps/unix/sysv/linux/getsockname.c: Call direct system call. * sysdeps/unix/sysv/linux/getsockopt.c: Call direct system call. * sysdeps/unix/sysv/linux/listen.c: Call direct system call. * sysdeps/unix/sysv/linux/recv.c: Call direct system call. * sysdeps/unix/sysv/linux/recvfrom.c: Call direct system call. * sysdeps/unix/sysv/linux/recvmsg.c: Call direct system call. * sysdeps/unix/sysv/linux/send.c: Call direct system call. * sysdeps/unix/sysv/linux/sendmsg.c: Call direct system call. * sysdeps/unix/sysv/linux/sendto.c: Call direct system call. * sysdeps/unix/sysv/linux/setsockopt.c: Call direct system call. * sysdeps/unix/sysv/linux/shutdown.c: Call direct system call. * sysdeps/unix/sysv/linux/socket.c: Call direct system call. * sysdeps/unix/sysv/linux/socketpair.c: Call direct system call. --- sysdeps/unix/sysv/linux/getsockopt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sysdeps/unix/sysv/linux/getsockopt.c') diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c index ba5681b410..b194551d15 100644 --- a/sysdeps/unix/sysv/linux/getsockopt.c +++ b/sysdeps/unix/sysv/linux/getsockopt.c @@ -20,10 +20,16 @@ #include #include +#include +#include int __getsockopt (int fd, int level, int optname, void *optval, socklen_t *len) { +#ifdef __ASSUME_GETSOCKOPT_SYSCALL + return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval, len); +#else return SOCKETCALL (getsockopt, fd, level, optname, optval, len); +#endif } weak_alias (__getsockopt, getsockopt) -- cgit 1.4.1