Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (a - d) connect(2)
• Compile the application using the -Wlp64 compiler command option.
• Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys-
tem Services environment, see the Open System Services Programmer’s Guide.
RETURN VALUES
Upon successful completion, the connect() function returns the value 0 (zero). Otherwise, the
value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the connect() function sets errno to the corresponding
value:
[EACCES] The socket is in the AF_UNIX domain and either search permission is denied for
a component of the pathname in the sockaddr structure, or write access to the
specified socket is denied.
[EADDRINUSE]
An attempt was made to establish a connection using addresses that are already
in use.
[EADDRNOTAVAIL]
The specified address is not available from this HP NonStop node.
[EAFNOSUPPORT]
Addresses in the specified address family cannot be used with this socket.
[EALREADY] A connection request is already in progress for the specified socket.
[EBADF] The socket parameter is not a valid file descriptor.
This error is also returned if the connect() function is thread-aware and the
socket becomes invalid (is closed by another thread).
[ECONNREFUSED]
One of these conditions occured:
• The specified address is not listening for connections or rejected the
attempt to connect.
• The socket bound to the AF_UNIX address is not using the same tran-
sport provider as the socket. This condition can occur if the system is
running AF_UNIX Release 2 software and the socket bound to address
is not of the same mode as socket.
• For AF_UNIX Release 1 socket or an AF_UNIX Release 2 socket in
compatibility mode:
— The caller attempted to connect a socket that previously had
been called by the listen() function with a backlog parameter
less than or equal to 0 (zero), and
— There is no pending accept() call to that socket.
527186-023 Hewlett-Packard Company 1−39