File: io_socketpair.3

package info (click to toggle)
libowfat 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,288 kB
  • sloc: ansic: 20,181; makefile: 16
file content (18 lines) | stat: -rw-r--r-- 666 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.TH io_socketpair 3
.SH NAME
io_socketpair \- create a pair of sockets
.SH SYNTAX
.B #include <libowfat/io.h>

int \fBio_socketpair\fP(int64 pfd[2]);
.SH DESCRIPTION
io_socketpair creates a new UNIX socket pair and writes both descriptors
to \fId\fR.  The socket pair works much like a pipe, but it is
bidirectional (i.e. both descriptors are for reading and writing).

io_socketpair returns 1 to indicate success. If something goes wrong,
io_socketpair returns 0, setting errno to indicate the error; in this
case it frees any memory that it allocated for the new socketpair, and
it leaves \fId\fR alone.
.SH "SEE ALSO"
io_readfile(3), io_createfile(3), io_pipe(3)