⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bindresvport.3

📁 RTEMS (Real-Time Executive for Multiprocessor Systems) is a free open source real-time operating sys
💻 3
字号:
.\" @(#)bindresvport.3n	2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI.\" $FreeBSD: src/lib/libc/rpc/bindresvport.3,v 1.10 2000/01/27 02:55:01 bde Exp $.\".Dd January 27, 2000.Dt BINDRESVPORT 3.Os.Sh NAME.Nm bindresvport ,.Nm bindresvport_sa.Ndbind a socket to a privileged IP port.Sh SYNOPSIS.Fd #include <rpc/rpc.h>.Ft int.Fn bindresvport "int sd" "struct sockaddr_in *sin".Ft int.Fn bindresvport_sa "int sd" "struct sockaddr *sa".Sh DESCRIPTION.Fn bindresvportand.Fn bindresvport_saare used to bind a socket descriptor to a privileged.Tn IPport, that is, aport number in the range 0-1023..PpOnly root can bind to a privileged port; this call will fail for anyother users..PpWhen.Va sinis not null,.Va sin->sin_familymust be initialized to the address family of the socket, passed by.Va sd .If the value of sin->sin_port is non-zero.Fn bindresvportwill attempt to use that specific port.  If it fails, it chooses anotherprivileged port automatically..PpIt is legal to pass null pointer to.Va sin .In this case, the caller cannot get the port number.Fn bindresvporthas picked..PpFunction prototype of.Fn bindresvportis biased to.Dv AF_INETsocket..Fn bindresvport_saacts exactly the same, with more neutral function prototype.Note that both functions behave exactly the same, andboth support.Dv AF_INET6sockets as well as.Dv AF_INETsockets..Sh RETURN VALUES.Fn bindresvportand.Fn bindresvport_sareturn 0 if they are successful, otherwise \-1 is returned and.Va errnoset to reflect the cause of the error..Sh ERRORSThe.Fn bindresvportand.Fn bindresvport_safunctions fail if:.Bl -tag -width Er.It Bq Er EBADF.Fa sdis not a valid descriptor..It Bq Er ENOTSOCK.Fa sdis not a socket..It Bq Er EADDRNOTAVAILThe specified address is not available from the local machine..It Bq Er EADDRINUSEThe specified address is already in use..It Bq Er EINVALThe socket is already bound to an address,or the socket family and the family of specified address mismatch..It Bq Er EACCESThe requested address is protected, and the current userhas inadequate permission to access it..It Bq Er EFAULTThe.Fa nameparameter is not in a valid part of the useraddress space..It Bq Er ENOBUFSInsufficient resources were available in the systemto perform the operation..It Bq Er EPFNOSUPPORTThe protocol family has not been configured into thesystem, no implementation for it exists,or address family did not match between arguments..El.Sh "SEE ALSO".Xr bind 2 ,.Xr socket 2 ,.Xr rresvport 3 ,.Xr rresvport_af 3

⌨️ 快捷键说明

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