GETSOCKNAME(2) COMMAND REFERENCE GETSOCKNAME(2) NAME getsockname - get socket name SYNOPSIS getsockname(s, name, namelen) int s; struct sockaddr *name; int *namelen; DESCRIPTION Getsockname returns the current name for the specified socket. The namelen parameter should be initialized to indicate the amount of space pointed to by name. On return it contains the actual size of the name returned (in bytes). DIAGNOSTICS The call succeeds unless: [EBADF] The argument s is not a valid descriptor. [ENOTSOCK] The argument s is a file, not a socket. [ENOBUFS] Insufficient resources were available in the system to perform the operation. [EFAULT] The name parameter points to memory not in a valid part of the process address space. RETURN VALUE [0] Getsockname was successful. [-1] Getsockname was unsuccessful. CAVEATS Names bound to sockets in the UTek domain are inaccessible; getsockname returns a zero length name. SEE ALSO bind(2) and socket(2). Printed 5/12/88 1
%%index%% na:408,81; sy:489,824; de:1313,515; di:1828,524; rv:2352,423; ca:2775,299; se:3074,144; %%index%%000000000121