COHERENT manpages

This page displays the COHERENT manpage for socketpair() [Create a pair of sockets].

List of available manpages
Index


socketpair() -- Sockets Function (libsocket)

Create a pair of sockets
int socketpair (family, type, protocol, fds)
int family, type, protocol, fds[2];

Function  socketpair()  creates  a  pair  of  sockets.  family,  type,  and
protocol give the family, type, and  protocol of the sockets to be created.
At present,  family must  be set  to AF_UNIX. fds  gives the address  of an
array of two integers,  into which socketpair() writes the file descriptors
of the sockets it creates.

If  all goes  well,  socketpair() returns  zero.   If an  error occurs,  it
returns -1 and sets errno to an appropriate value.

See Also

libsocket

Notes

socketpair() does  not connect the  pair of sockets  that it creates,  so a
call to getpeername() on one of them will not return the name of the other.