Getsockopt – Comtrol eCos User Manual
Page 562

Chapter 38. TCP/IP Library Reference
If name does not point to enough space to hold the entire socket address,
the result will be truncated to namelen bytes.
RETURN VALUES
On success, getsockname() returns a 0, and namelen is set to the actual
size of the socket address returned in name.
Otherwise, errno is set,
and a value of -1 is returned.
ERRORS
If getsockname() fails, errno is set to one of the following:
[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.
SEE ALSO
accept(2), bind(2), getpeername(2), getpeereid(2), socket(2)
BUGS
Names bound to sockets in the UNIX domain are inaccessible; getsockname
returns a zero length name.
HISTORY
The getsockname() function call appeared in 4.2BSD.
BSD
July 17, 1999
BSD
getsockopt
GETSOCKOPT(2)
System Calls Manual
GETSOCKOPT(2)
NAME
getsockopt, setsockopt - get and set options on sockets
SYNOPSIS
#include
<
sys/types.h>
#include
<
sys/socket.h>
int
getsockopt(int s, int level, int optname, void *optval,
socklen_t *optlen);
int
setsockopt(int s, int level, int optname, const void *optval,
socklen_t optlen);
458