1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="TCP/IP Library Reference"
23 HREF="tcpip-library-reference.html"><LINK
26 HREF="net-common-tcpip-manpages-socket.html"><LINK
28 TITLE="FreeBSD TCP/IP Stack port for eCos"
29 HREF="tcpip-freebsd.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-tcpip-manpages-socket.html"
65 >Chapter 38. TCP/IP Library Reference</TD
71 HREF="tcpip-freebsd.html"
85 NAME="NET-COMMON-TCPIP-MANPAGES-SOCKETPAIR">socketpair</H1
94 >SOCKETPAIR(2) System Calls Manual SOCKETPAIR(2)
97 socketpair - create a pair of connected sockets
100 #include <sys/types.h>
101 #include <sys/socket.h>
104 socketpair(int d, int type, int protocol, int *sv);
107 The socketpair() call creates an unnamed pair of connected sockets in the
108 specified domain d, of the specified type, and using the optionally spec-
109 ified protocol. The descriptors used in referencing the new sockets are
110 returned in sv[0] and sv[1]. The two sockets are indistinguishable.
113 A 0 is returned if the call succeeds, -1 if it fails.
116 The call succeeds unless:
118 [EMFILE] Too many descriptors are in use by this process.
120 [EAFNOSUPPORT] The specified address family is not supported on this
123 [EPROTONOSUPPORT] The specified protocol is not supported on this
126 [EOPNOTSUPP] The specified protocol does not support creation of
129 [EFAULT] The address sv does not specify a valid part of the
130 process address space.
132 [ENFILE] The system file table is full.
135 pipe(2), read(2), write(2)
138 This call is currently implemented only for the LOCAL domain. Many oper-
139 ating systems only accept a protocol of PF_UNSPEC, so that should be used
140 instead of PF_LOCAL for maximal portability.
143 The socketpair() function conforms to X/Open Portability Guide Issue 4.2
147 The socketpair() function call appeared in 4.2BSD.
160 SUMMARY="Footer navigation table"
171 HREF="net-common-tcpip-manpages-socket.html"
189 HREF="tcpip-freebsd.html"
205 HREF="tcpip-library-reference.html"
213 >FreeBSD TCP/IP Stack port for eCos</TD