Chapter Contents |
Previous |
Next |
socketpair |
Portability: | UNIX compatible |
SYNOPSIS | |
DESCRIPTION | |
RETURN VALUES | |
CAUTION | |
PORTABILITY |
SYNOPSIS |
#include <sys/types.h> #include <sys/socket.h> int socketpair(int domain, int type, int protocol, int fd[2]);
DESCRIPTION |
socketpair
creates a connected pair of unnamed sockets. The arguments
are:
domain
AF_UNIX
must be specified.
type
SOCK_STREAM
or
SOCK_DGRAM
may be specified.
protocol
p_proto
field of the
protoent
structure. If a
0
is specified, the system will select the protocol. Refer to The BSD UNIX Socket Library for information about the
protoent
structure.
fd
RETURN VALUES |
If
socketpair
is successful, it returns
0
; otherwise, it returns a
-1
and sets
errno
to indicate the type of error.
CAUTION |
socketpair
is only vaild when integrated sockets are in use.
PORTABILITY |
socketpair
is portable to other environments, including most UNIX systems
that implement BSD sockets.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.