socketpair(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

socketpair(3c)

socketpair(3C)           Standard C Library Functions           socketpair(3C)

NAME
       socketpair - create a pair of connected sockets

SYNOPSIS
       #include <sys/socket.h>

       int socketpair(int domain, int type, int protocol, int sv[2]);

DESCRIPTION
       The  socketpair()  library  call  creates  an unnamed pair of connected
       sockets in the specified address family domain, of the specified  type,
       that  uses  the optionally specified protocol. The descriptors that are
       used in referencing the new sockets are returned in  sv[0]  and  sv[1].
       The two sockets are indistinguishable.


       Some  file descriptor flags can be specified at socket creation time to
       avoid race conditions. These options are passed by using a  bitwise-in‐
       clusive-OR  of  flags with the value passed for the type parameter. See
       the socket(3C) man page for the available flags.

RETURN VALUES
       socketpair() returns −1 on failure and 0 on success.

ERRORS
       The call succeeds unless:

       EAFNOSUPPORT       The specified address family  is  not  supported  on
                          this machine.


       EMFILE             Too many descriptors are in use by this process.


       ENOMEM             There was insufficient user memory for the operation
                          to complete.


       ENOSR              There  were  insufficient  STREAMS resources for the
                          operation to complete.


       EOPNOTSUPP         The specified protocol does not support creation  of
                          socket pairs.


       EPROTONOSUPPORT    The  specified protocol is not supported on this ma‐
                          chine.


       EACCES             The process does not have appropriate privileges.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE  VALUE  _  Interface StabilityCommitted _ MT-LevelAsync-Signal-
       Safe _ StandardSee standards(7).


SEE ALSO
       pipe(2), read(2), write(2), socket.h(3HEAD), attributes(7)

NOTES
       This call is currently implemented only for the AF_UNIX address family.

HISTORY
       The socketpair() function has been present since the initial release of
       Solaris.


       Support for SOCK_* flags as part of the type parameter was added to Or‐
       acle Solaris in the 11.4 release.

Oracle Solaris 11.4               2 Feb 2021                    socketpair(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3