SOCKETPAIR(2,L) AIX Technical Reference SOCKETPAIR(2,L)
-------------------------------------------------------------------------------
socketpair
PURPOSE
Creates a pair of connected sockets.
SYNTAX
#include <sys/types.h>
#include <sys/socket.h>
socketpair (d, type, protocol, sv)
int d, type, protocol;
int sv[2];
DESCRIPTION
The socketpair system call creates an unnamed pair of connected sockets in the
specified domain d, of the specified type, and using the optionally specified
protocol. The descriptors used in referencing the new sockets are returned in
sv[0] and sv[1]. The two sockets are identical.
RETURN VALUE
Upon successful completion, a value of 0 is returned. If the socketpair system
call fails, a value of -1 is returned, and errno is set to indicate the error.
ERROR CONDITIONS
The system call fails if one or more of the following are true:
EMFILE This process has too many descriptors in use.
EPROTONOSUPPORT
The specified protocol or address family cannot be used on this
system.
EOPNOSUPPORT The specified protocol does not allow create of socket pairs.
EFAULT The sv parameter is not in a writable part of the user address
space.
RELATED INFORMATION
In this book: "socket."
Processed November 7, 1990 SOCKETPAIR(2,L) 1