1GETSOCKNAME(2) System Calls Manual GETSOCKNAME(2)
2
3
4
6 getsockname - get socket name
7
9 getsockname(s, name, namelen)
10 int s;
11 struct sockaddr *name;
12 int *namelen;
13
15 Getsockname returns the current name for the specified socket. The
16 namelen parameter should be initialized to indicate the amount of space
17 pointed to by name. On return it contains the actual size of the name
18 returned (in bytes).
19
21 A 0 is returned if the call succeeds, -1 if it fails.
22
24 The call succeeds unless:
25
26 [EBADF] The argument s is not a valid descriptor.
27
28 [ENOTSOCK] The argument s is a file, not a socket.
29
30 [ENOBUFS] Insufficient resources were available in the system to
31 perform the operation.
32
33 [EFAULT] The name parameter points to memory not in a valid part
34 of the process address space.
35
37 bind(2), socket(2)
38
40 Names bound to sockets in the UNIX domain are inaccessible; getsockname
41 returns a zero length name.
42
43
44
454.2 Berkeley Distribution May 15, 1985 GETSOCKNAME(2)