getsockname.2

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 59 行

2
59
字号
.\" SCCSID: @(#)getsockname.2	8.1	9/11/90.TH getsockname 2.SH Namegetsockname \- get socket name.SH Syntax.nf.ft B#include <sys/types.h>#include <sys/socket.h>.PP.ft Bgetsockname(s, name, namelen)int s;struct sockaddr *name;int *namelen;.fi.SH Description.NXR "getsockname system call".NXR "socket" "getting name"The.PN getsocknamesystem call returns the current .I namefor the specified socket descriptor .B s.The.I namelenparameter should be initialized to indicatethe amount of space pointed to by.IR name .On return it contains the actual size, in bytes, of the namereturned..SH Return ValuesA zero is returned if the call succeeds, \-1 if it fails..SH RestrictionsNames bound to sockets in the UNIX domain are inaccessible;.PN getsocknamereturns a zero-length name..SH DiagnosticsThe call succeeds unless:.TP 15[EBADF]The argument \fIs\fP is not a valid descriptor..TP 15[ENOTSOCK]The argument \fIs\fP is a file, not a socket..TP 15[ENOBUFS]Insufficient resources were available in the systemto perform the operation..TP 15[EFAULT]The .I nameparameter points to memory not in a valid part of theprocess address space..SH See Alsobind(2), socket(2)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?