xref: /minix3/minix/man/man2/getsockname.2 (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
GETSOCKNAME 2
NAME
getsockname - get the current name/address of a socket.
SYNOPSIS
#include <sys/socket.h> int getsockname(int sd, struct sockaddr * addr, socklen_t * addr_len);

DESCRIPTION
getsockname() takes a connected socket sd and fills in addr with the name/address of the socket.
RETURN VALUES
On success, this function returns 0. On error, -1 is returned and errno is set.
ERRORS

15 [ENOSYS] The operation is not implemented for the given socket.

15 [EINVAL] The socket does not have a name/address.

SEE ALSO
socket(2), getpeername(2)