?? bind.3.man
字號:
'\" rtp.\" -*- nroff -*- vim: ft=nroff noautoindent nocindent nosmartindent.\".\" @(#) bind.3.man,v 1.1.2.1 2004/05/16 02:35:34 brian Exp.\".\" =========================================================================.\".\" Copyright (C) 2001-2004 OpenSS7 Corporation <www.openss7.com>.\".\" All Rights Reserved..\".\" Permission is granted to make and distribute verbatim copies of this.\" manual provided the copyright notice and this permission notice are.\" preserved on all copies..\".\" Permission is granted to copy and distribute modified versions of this.\" manual under the conditions for verbatim copying, provided that the.\" entire resulting derived work is distributed under the terms of a.\" permission notice identical to this one.\" .\" Since the Linux kernel and libraries are constantly changing, this.\" manual page may be incorrect or out-of-date. The author(s) assume no.\" responsibility for errors or omissions, or for damages resulting from.\" the use of the information contained herein. The author(s) may not.\" have taken the same level of care in the production of this manual,.\" which is licensed free of charge, as they might when working.\" professionally..\" .\" Formatted or processed versions of this manual, if unaccompanied by.\" the source, must acknowledge the copyright and authors of this work..\".\" -------------------------------------------------------------------------.\".\" U.S. GOVERNMENT RESTRICTED RIGHTS. If you are licensing this Software.\" on behalf of the U.S. Government ("Government"), the following.\" provisions apply to you. If the Software is supplied by the Department.\" of Defense ("DoD"), it is classified as "Commercial Computer Software".\" under paragraph 252.227-7014 of the DoD Supplement to the Federal.\" Acquisition Regulations ("DFARS") (or any successor regulations) and the.\" Government is acquiring only the license rights granted herein (the.\" license rights customarily provided to non-Government users). If the.\" Software is supplied to any unit or agency of the Government other than.\" DoD, it is classified as "Restricted Computer Software" and the.\" Government's rights in the Software are defined in paragraph 52.227-19.\" of the Federal Acquisition Regulations ("FAR") (or any success.\" regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the.\" NASA Supplement to the FAR (or any successor regulations)..\".\" =========================================================================.\" .\" Commercial licensing and support of this software is available from.\" OpenSS7 Corporation at a fee. See http://www.openss7.com/.\" .\" =========================================================================.\".\" Last Modified 2004/05/16 02:35:34 by brian.\".\" =========================================================================.so strxnet.macros.R1bracket-label "\fR[\fB" "\fR]" "\fR, \fB"no-default-databasedatabase strxnet.refsaccumulatemove-punctuationabbreviate Ajoin-authors ", " ", " " and "et-al " et al" 2 3abbreviate-label-ranges ".."sort-adjacent-labels.R2.\".\".TH BIND 3 "2004/05/16 02:35:34" "strxnet-0_9_2-4" "Linux Fast-STREAMS Sockets Library".SH NAME.B bind\- bind a name to a socket.SH SYNOPSIS.PP.B #include <sys/socket.h>.HP.BI "int bind(int " socket ", const struct sockaddr *" address ", socklen_t " address_len );.SH DESCRIPTION.PPThe.BR bind ()function assigns an address to an unnamed socket. Socketscreated with the.BR socket (3)function are initially unnamed; they areidentified only by their address family..PPThe function takes the following arguments:.TP.I socketSpecifies the file descriptor of the socket to be bound..TP.I addressPoints to a sockaddr structure containing the address to be bound to thesocket. The length and format of the address depend on the address familyof the socket..TP.I address_lenSpecifies the length of the sockaddr structure pointed to by the addressargument..PPThe socket in use may require the process to have appropriate privilegesto use the.BR bind ()function..SH NOTES.PPAn application program can retrieve the assigned socket name with the.BR getsockname (3)function..SH CAVEATS.PPThis system call is implemented as a.B SIOCSOCKSYSIOCTL. See.BR socksys (4)for more information..SH "RETURN VALUE".PPUpon successful completion,.BR bind ()returns 0. Otherwise, -1 is returnedand.IR errno (3)is set to indicate the error..SH ERRORS.PPThe.BR bind ()function will fail if:.TP.RB [ EADDRINUSE ]The specified address is already in use..TP.RB [ EADDRNOTAVAIL ]The specified address is not available from the local machine..TP.RB [ EAFNOSUPPORT ]The specified address is not a valid address for the address family of thespecified socket..TP.RB [ EBADF ]The socket argument is not a valid file descriptor..TP.RB [ EFAULT ]The address argument can not be accessed..TP.RB [ EINVAL ]The socket is already bound to an address, and the protocol does notsupport binding to a new address; or the socket has been shut down..TP.RB [ ENOTSOCK ]The socket argument does not refer to a socket..TP.RB [ EOPNOTSUPP ]The socket type of the specified socket does not support binding to anaddress..PPIf the address family of the socket is.BR AF_UNIX ,then.BR bind ()will fail if:.TP.RB [ EACCES ]A component of the path prefix denies search permission, or the requested namerequires writing in a directory with a mode that denies write permission..TP.RB [ EDESTADDRREQ "] or [" EISDIR ]The address argument is a null pointer..TP.RB [ EIO ]An I/O error occurred..TP.RB [ ELOOP ]Too many symbolic links were encountered in translating the pathname inaddress..TP.RB [ ENAMETOOLONG ]A component of a pathname exceeded.RI { NAME_MAX }characters, or an entirepathname exceeded.RI { PATH_MAX }characters..TP.RB [ ENOENT ]A component of the pathname does not name an existing file or the pathnameis an empty string..TP.RB [ ENOTDIR ]A component of the path prefix of the pathname in address is not adirectory..TP.RB [ EROFS ]The name would reside on a read-only filesystem..PPThe.BR bind ()function may fail if:.TP.RB [ EACCES ]The specified address is protected and the current user does not havepermission to bind to it..TP.RB [ EINVAL ]The address_len argument is not a valid length for the address family..TP.RB [ EISCONN ]The socket is already connected..TP.RB [ ENAMETOOLONG ]Pathname resolution of a symbolic link produced an intermediate result whoselength exceeds.IR { PATH_MAX }..TP.RB [ ENOBUFS ]Insufficient resources were available to complete the call..TP.RB [ ENOSR ]There were insufficient STREAMS resources for the operation to complete..SH "SEE ALSO".PP.BR connect (3),.BR getsockname (3),.BR listen (3),.BR socket (3),.BR <sys/socket.h> (5)..SH "CONFORMING TO".PPThe Open Group XNS Issue 5.2..[xns.].\".\".[$LIST$.].TI
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -