Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getsockname(2) OSS System Calls Reference Manual
For more information about AF_UNIX Release 2 sockets, portability mode, and compatibility
mode, see the Open System Services Programmers Guide.
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
RETURN VALUES
Upon successful completion, the getsockname() 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 occur, the getsockname() function sets errno to the
corresponding value:
[EBADF] The socket parameter is not a valid file descriptor.
[ECONNRESET]
One of the following conditions occurred:
The transport-provider process for this socket is no longer available.
The TCP/IP subsystem for this socket is no longer available.
The connection was forcibly closed by the peer socket.
The socket can only be closed.
[EFAULT] A user-supplied memory buffer cannot be accessed or written.
[EINVAL] The socket has been shut down.
[ENOBUFS] There was not enough buffer space available to complete the call. A retry at a
later time might succeed.
[ENOENT] The socket is either an AF_UNIX Release 1 datagram socket or an AF_UNIX
Release 2 datagram socket in compatibility mode and one of these conditions
occured:
The underlying file of the peer socket specified in the address parameter
was renamed.
The underlying file of the peer socket specfied in the address parameter
was unlinked.
[ENOMEM] Required memory resources were not available. A retry at a later time might
succeed.
[ENOTSOCK] The socket parameter does not refer to a socket.
[EOPNOTSUPP]
The specified operation is not supported by the protocol used by the socket.
RELATED INFORMATION
Functions: accept(2), bind(2), getpeername(2), socket(2).
STANDARDS CONFORMANCE
The HP implementation does not return the errno value [ENOSR].
The following are HP extensions to the XPG4 specification:
The errno value [ECONNRESET] can be returned when the transport-provider process
is unavailable.
386 Hewlett-Packard Company 527186-023