HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

s
socket(2) socket(2)
cases, Internet protocol (IP) and the X.25-to-IP interface module are used.
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.
X/Open Sockets Compilation Environment
See xopen_networking(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.
WARNINGS
Not all possible errno values are documented in each socket related manpage due to dependencies from
the underlying protocol modules. Refer to the errno(2) manpage for a complete list of error codes.
Linking binary objects compiled to X/Open Sockets specification and binary objects compiled to HP-UX
BSD Sockets specification to the same executable may result in unexpected behavior, including application
abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy.
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)).
AUTHOR
socket() was developed by HP and the University of California, Berkeley.
HP-UX 11i Version 3: February 2007 2 Hewlett-Packard Company 449