|
|
1.1 root 1: .\" Copyright (c) 1983 Regents of the University of California.
2: .\" All rights reserved. The Berkeley software License Agreement
3: .\" specifies the terms and conditions for redistribution.
4: .\"
5: .\" @(#)socketpair.2 6.1 (Berkeley) 5/15/85
6: .\"
7: .TH SOCKETPAIR 2 "May 15, 1985"
8: .UC 5
9: .SH NAME
10: socketpair \- create a pair of connected sockets
11: .SH SYNOPSIS
12: .nf
13: .ft B
14: #include <sys/types.h>
15: #include <sys/socket.h>
16: .PP
17: .ft B
18: socketpair(d, type, protocol, sv)
19: int d, type, protocol;
20: int sv[2];
21: .fi
22: .SH DESCRIPTION
23: The
24: .I socketpair
25: call creates an unnamed pair of connected sockets in
26: the specified domain
27: .IR d ,
28: of the specified
29: .IR type ,
30: and using the optionally specified
31: .IR protocol .
32: The descriptors used in referencing the new sockets
33: are returned in
34: .IR sv [0]
35: and
36: .IR sv [1].
37: The two sockets are indistinguishable.
38: .SH DIAGNOSTICS
39: A 0 is returned if the call succeeds, \-1 if it fails.
40: .SH ERRORS
41: The call succeeds unless:
42: .TP 20
43: [EMFILE]
44: Too many descriptors are in use by this process.
45: .TP 20
46: [EAFNOSUPPORT]
47: The specified address family is not supported on this machine.
48: .TP 20
49: [EPROTONOSUPPORT]
50: The specified protocol is not supported on this machine.
51: .TP 20
52: [EOPNOSUPPORT]
53: The specified protocol does not support creation of socket pairs.
54: .TP 20
55: [EFAULT]
56: The address \fIsv\fP does not specify a valid part of the
57: process address space.
58: .SH "SEE ALSO"
59: read(2), write(2), pipe(2)
60: .SH BUGS
61: This call is currently implemented only for the UNIX domain.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.