getsockname - Online Linux Manual PageSection : 2
Updated : 2022-10-30
Source : Linux man-pages 6.03
NAMEgetsockname − get socket name
LIBRARYStandard C library (libc, −lc)
SYNOPSIS#include <sys/socket.h>int getsockname(int sockfd, struct sockaddr *restrict addr,
socklen_t *restrict addrlen);
DESCRIPTIONgetsockname() returns the current address to which the socket sockfd is bound, in the buffer pointed to by addr. The addrlen argument should be initialized to indicate the amount of space (in bytes) pointed to by addr. On return it contains the actual size of the socket address. The returned address is truncated if the buffer provided is too small; in this case, addrlen will return a value greater than was supplied to the call.
RETURN VALUEOn success, zero is returned. On error, −1 is returned, and errno is set to indicate the error.
ERRORSEBADF The argument sockfd is not a valid file descriptor. EFAULT The addr argument points to memory not in a valid part of the process address space. EINVAL addrlen is invalid (e.g., is negative). ENOBUFS Insufficient resources were available in the system to perform the operation. ENOTSOCK The file descriptor sockfd does not refer to a socket.
STANDARDSPOSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD (getsockname() first appeared in 4.2BSD).
NOTESFor background on the socklen_t type, see accept(2).
SEE ALSObind(2), socket(2), getifaddrs(3), ip(7), socket(7), unix(7) 0
Johanes Gumabo
Data Size : 7,096 byte
man-getsockname.2Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 184,347
Visitor ID : :
Visitor IP : 52.15.113.71 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.