2. System calls (functions provided by the kernel)
SOCKETPAIRSection: Linux Programmer's Manual (2)
Updated: 2017-09-15
Index | Return to Main Contents
NAMEsocketpair - create a pair of connected sockets
SYNOPSIS#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
int socketpair(int domain, int type, int protocol, int sv[2]);
DESCRIPTIONTheOn success, zero is returned. On error, -1 is returned, and errno is set appropriately. TOPOSIX.1-2001, POSIX.1-2008, 4.4BSD. socketpair() first appeared in 4.2BSD. It is generally portable to/from non-BSD systems supporting clones of the BSD socket layer (including System V variants).
NOTES ALSOpipe(2), read(2), socket(2), write(2), socket(7), unix(7)
COLOPHONThis page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at.
Index
Return to Main Contents