getsockname(2) System Calls Manual getsockname(2) getsockname - LIBRARY Standard C library (libc, -lc) #include int getsockname(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen); getsockname() , sockfd, , addr. addrlen , ( ), addr. . , ; addrlen . On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error. EBADF sockfd . EFAULT addr . EINVAL addrlen (, ). ENOBUFS . ENOTSOCK sockfd . POSIX.1-2008. POSIX.1-2001, SVr4, 4.4BSD (first appeared in 4.2BSD). bind(2), socket(2), getifaddrs(3), ip(7), socket(7), unix(7) Azamat Hackimov , Dmitry Bolkhovskikh , Vladislav , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , <>. Linux man-pages 6.8 2 2024 . getsockname(2)