mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Linux: Assume and consolidate getpeername wire-up syscall
And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
@@ -15,19 +15,14 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <socketcall.h>
|
||||
#include <kernel-features.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
int
|
||||
__getpeername (int fd, __SOCKADDR_ARG addr, socklen_t *len)
|
||||
{
|
||||
#ifdef __ASSUME_GETPEERNAME_SYSCALL
|
||||
return INLINE_SYSCALL (getpeername, 3, fd, addr.__sockaddr__, len);
|
||||
return INLINE_SYSCALL_CALL (getpeername, fd, addr.__sockaddr__, len);
|
||||
#else
|
||||
return SOCKETCALL (getpeername, fd, addr.__sockaddr__, len);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user