File: bindresvport.3

package info (click to toggle)
manpages-ja 0.5.0.0.20100315-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 21,156 kB
  • ctags: 1
  • sloc: sh: 13,935; perl: 157; makefile: 114
file content (110 lines) | stat: -rw-r--r-- 3,578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.\" Copyright (C) 2007, Michael Kerrisk <mtk.manpages@gmail.com>
.\" and Copyright (C) 2008, Linux Foundation, written by Michael Kerrisk
.\"     <mtk.manpages@gmail.com>
.\" 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.
.\"
.\" 2007-05-31, mtk: Rewrite and substantial additional text.
.\" 2008-12-03, mtk: Rewrote some pieces and fixed some errors
.\"
.\" Japanese Version Copyright (c) 1999 Shouichi Saito all rights reserved.
.\" Translated 1999-08-28, Shouichi Saito <ss236rx@ymg.urban.ne.jp>
.\" Proofed 1999-09-25, NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\" Updated 2007-06-11, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.54
.\" Updated 2008-12-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.15
.\"
.TH BINDRESVPORT 3  2008-12-03 "" "Linux Programmer's Manual"
.SH ̾
bindresvport \- åȤø IP ݡȤ˥Хɤ
.SH 
.nf
.B #include <sys/types.h>
.B #include <netinet/in.h>
.LP
.BI "int bindresvport(int " sockfd ", struct sockaddr_in *" sin );
.fi
.SH 
.LP
.BR bindresvport ()
ϡåȡǥץø̵̾ (privileged anonymous) IP ݡȤ
ХɤΤ˻Ȥø̵̾ IP ݡȤȤϡ
ݡֹ椬 512  1023 ϰϤǤդ򤵤ݡȤǤ롣
.\" Glibc actually starts searching with a port # in the range 600 to 1023

.BR bindresvport ()
ˤäƼ¹Ԥ줿
.BR bind (2)

.I sin
 NULL ʳξ硢ºݤ˳Ƥ줿ݡֹ椬
.I sin\->sin_port
֤롣

.I sin
ˤ NULL ꤹ뤳ȤǤξˤ
.I sin\->sin_family
ϰۤΤ
.B AF_INET
Ȥߤʤ롣
ξˤϡ
.BR bindresvport ()
ϼºݤ˳Ƥ줿ݡֹ֤ʤʤ
(Ƥ줿ݡֹϡ
.BR getsockname (2)
ȤäƼǤ)
.SH ֤
.BR bindresvport ()
 0 ֤ʳξ硢\-1 ֤
.I errno
˥顼θ򼨤ͤꤹ롣
.SH 顼
.BR bindresvport ()

.BR bind (2)
ƱǼԤǽ롣
ˡʲΥ顼ȯ뤳Ȥ:
.TP
.BR EACCES
ƤӽФѡ桼øäƤʤä (Τ˸ȡ
.B CAP_NET_BIND_SERVICE
ѥӥƥɬפǤ)
.TP
.B EADDRINUSE
ƤøݡȤǤ롣
.TP
.BR EAFNOSUPPORT " (glibc 2.7 Ǥ " EPFNOSUPPORT ")"
.I sin
 NULL ʳǡ
.I sin->sin_family

.B AF_INET
Ǥʤä
.SH 
POSIX.1-2001 ˤϤʤ
BSD, Solaris Ӥ¾¿Υƥ¸ߤ롣
.SH 
.LP
.BR bindresvport ()
ΤĤμȰۤʤꡢglibc μǤϸƤӽФ
.I sin\->sin_port
ϤͤϤɤͤǤäƤ̵뤵롣
.SH Ϣ
.BR bind (2),
.BR getsockname (2)