1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

Linux: Assume and consolidate socketpair 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:
Adhemerval Zanella Netto
2022-10-19 19:14:23 -03:00
committed by Adhemerval Zanella
parent 1fed1a5af4
commit d00783653a
10 changed files with 5 additions and 14 deletions

View File

@@ -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
__socketpair (int domain, int type, int protocol, int sv[2])
{
#ifdef __ASSUME_SOCKETPAIR_SYSCALL
return INLINE_SYSCALL (socketpair, 4, domain, type, protocol, &sv[0]);
return INLINE_SYSCALL_CALL (socketpair, domain, type, protocol, &sv[0]);
#else
return SOCKETCALL (socketpair, domain, type, protocol, sv);
#endif