HP-UX Reference (11i v2 03/08) - 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. Con-
nections 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.
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 sys-
tem.
[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.
IPv6 is supported on HP-UX 11i Version 1.0, with the optional IPv6 software installed. Currently, IPv6 is
not supported on systems running HP-UX 11i Version 1.6.
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.
SEE ALSO
accept(2), bind(2), connect(2), getsockname(2), getsockopt(2), ioctl(2), listen(2), recv(2), select(2), send(2),
shutdown(2), thread_safety(5), socket(7), tcp(7P), udp(7P), unix(7P), xopen_networking(7).
HP-UX 11i Version 2: August 2003 − 2 − Hewlett-Packard Company Section 2−−399