HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
s
socket(2) socket(2)
If the socket is in the AF_CCITT address family, only the SOCK_STREAM socket type is supported. Refer
to the topic "Comparing X.25 Level 3 Access to IP" in the X.25 Programmer’s Guide for more details on the
difference between programmatic access to X.25 via IP and X.25 Level 3.
If the socket is in the AF_CCITT family, the connection and all other operations pass data directly from the
application to the X.25 Packet Level (level 3) without passing through a TCP or UDP protocol. Connections
of the AF_CCITT family cannot use most of the socket level options described in getsockopt(2). However,
AF_CCITT connections can use many X.25-specific ioctl() calls, described in socketx25(7).
DEPENDENCIES
AF_CCITT and AF_VME_LINK
Only the SOCK_STREAM type is supported.
RETURN VALUE
socket() returns the following values:
n Successful completion. n is a valid file descriptor referring to the socket.
-1 Failure. errno is set to indicate the error.
ERRORS
If socket() fails, errno is set to one of the following values.
[EAFNOSUPPORT] The specified address family is not supported in this version of the system.
[EHOSTDOWN] The networking subsystem is not up.
[EINVAL] SOCK_DGRAM sockets are currently not supported for the AF_UNIX or
AF_VME_LINK address families.
[EMFILE] The per-process descriptor table is full.
[ENFILE] The system’s table of open files is temporarily full and no more
socket()
calls can be accepted.
[ENOBUFS] No buffer space is available. The socket cannot be created.
[ENOMEM] No memory is available. The socket cannot be created.
[EPROTONOSUPPORT] The specified protocol is not supported.
[EPROTOTYPE] The type of socket and protocol do not match.
[ESOCKTNOSUPPORT] The specified socket type is not supported in this address family.
[ETIMEDOUT] Connection timed out.
FUTURE DIRECTION
Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open
Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with
X/Open Sockets might be obsoleted. Applications that conform to the X/Open specification now will avoid
migration problems (see xopen_networking(7)).
MULTITHREAD USAGE
The socket() system call is thread-safe. It has a cancellation point; and it is async-cancel safe, async-
signal safe, and fork-safe.
AUTHOR
socket() was developed by HP and the University of California, Berkeley.
SEE ALSO
accept(2), bind(2), connect(2), getsockname(2), getsockopt(2), ioctl(2), listen(2), recv(2), select(2), send(2),
shutdown(2), af_ccitt(7F), af_vme_link(7F), socket(7), socketx25(7), tcp(7P), udp(7P), unix(7P),
xopen_networking(7).
STANDARDS CONFORMANCE
socket(): XPG4
Section 2376 2 HP-UX Release 11i: December 2000
___
___