Imported tab->space correction by redhat
[infodrom/manpages-de] / man2 / bind.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
4 .\" Copyleft 1996 Hanno Wagner <wagner@bidnix.bid.fh-hannover.de>
5 .\"   for the german translation
6 .\"
7 .\" Portions extracted from /usr/include/sys/socket.h, which does not have
8 .\" any authorship information in it.  It is probably available under the GPL.
9 .\"
10 .\" Permission is granted to make and distribute verbatim copies of this
11 .\" manual provided the copyright notice and this permission notice are
12 .\" preserved on all copies.
13 .\"
14 .\" Permission is granted to copy and distribute modified versions of this
15 .\" manual under the conditions for verbatim copying, provided that the
16 .\" entire resulting derived work is distributed under the terms of a
17 .\" permission notice identical to this one
18 .\" 
19 .\" Since the Linux kernel and libraries are constantly changing, this
20 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
21 .\" responsibility for errors or omissions, or for damages resulting from
22 .\" the use of the information contained herein.  The author(s) may not
23 .\" have taken the same level of care in the production of this manual,
24 .\" which is licensed free of charge, as they might when working
25 .\" professionally.
26 .\" 
27 .\" Formatted or processed versions of this manual, if unaccompanied by
28 .\" the source, must acknowledge the copyright and authors of this work.
29 .\"
30 .\"
31 .\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page:
32 .\"
33 .\" Copyright (c) 1983 The Regents of the University of California.
34 .\" All rights reserved.
35 .\"
36 .\" Redistribution and use in source and binary forms, with or without
37 .\" modification, are permitted provided that the following conditions
38 .\" are met:
39 .\" 1. Redistributions of source code must retain the above copyright
40 .\"    notice, this list of conditions and the following disclaimer.
41 .\" 2. Redistributions in binary form must reproduce the above copyright
42 .\"    notice, this list of conditions and the following disclaimer in the
43 .\"    documentation and/or other materials provided with the distribution.
44 .\" 3. All advertising materials mentioning features or use of this software
45 .\"    must display the following acknowledgement:
46 .\"     This product includes software developed by the University of
47 .\"     California, Berkeley and its contributors.
48 .\" 4. Neither the name of the University nor the names of its contributors
49 .\"    may be used to endorse or promote products derived from this software
50 .\"    without specific prior written permission.
51 .\"
52 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 .\" SUCH DAMAGE.
63 .\"
64 .\" Heavily modified by Jörg Mertin (smurphy@stardust.bln.sub.org)
65 .\"
66 .TH BIND 2 "13. Mai 1996" "Linux 0.99.11" "Systemaufrufe"
67 .SH BEZEICHNUNG
68 bind \- verbindet einen Namen mit einem Socket.
69 .SH "ÜBERSICHT"
70 .B #include <sys/types.h>
71 .br
72 .B #include <sys/socket.h>
73 .sp
74 .BI "int bind(int " sockfd ", struct sockaddr *" my_addr ", int " addrlen );
75 .SH BESCHREIBUNG
76 .B bind
77 weist dem Socket
78 .I sockfd 
79 die lokale Adresse
80 .IR my_addr 
81 zu.
82 .I my_addr
83 ist
84 .I addrlen
85 Bytes lang.  Traditionsgemäß wird dies "einem Socket einen Namen zuweisen"
86 genannt (wenn ein Socket mit 
87 .BR socket (2)
88 erzeugt wird, existiert er in einer Adressfamilie (Namespace), hat
89 aber keinen eigenen Namen.
90 .SH BEMERKUNGEN
91 Einen Namen in einer UNIX-Domäne zu binden, erzeugt einen Socket im
92 Dateisystem, welches vom Erzeuger gelöscht werden muss, wenn dieser nicht
93 mehr gebraucht wird (hierzu wird
94 .BR unlink (2)
95 benutzt).
96
97 Die Regeln, um zwischen verschiedenen Domänen zu Kommunizieren,
98 variieren.  Hier sei auf die Handbuchseite in Abschnitt 4 verwiesen.
99
100 .SH "RÜCKGABEWERTE"
101 Bei erfolgreicher Ausführung wird null zurückgeliefert, bei einem
102 Fehler \-1 und
103 .I errno
104 entsprecht gesetzt.
105 .SH FEHLER
106 .TP 0.8i
107 .B EBADF
108 .I sockfd
109 ist kein gültiger Deskriptor.
110 .TP
111 .B EINVAL
112 Der Socket ist bereits an eine Adresse gebunden. Dies kann sich in
113 Zukunft ändern. Siehe
114 .I linux/unix/sock.c
115 für Details.
116 .TP
117 .B EACCES
118 Die Adresse ist geschützt und der Benutzer ist nicht der Super-User.
119 .PP
120 Die folgenden Fehlermeldungen sind spezifisch für UNIX-Domänensockets
121 (AF_UNIX):
122 .TP 0.8i
123 .B EINVAL
124 Die
125 .I addr_len
126 war falsch oder der Socket gehörte nicht zur
127 .B AF_UNIX
128 Familie.
129 .TP
130 .B EROFS
131 Die Socket "Inode" sollte auf einem schreibgeschützten Dateisystem
132 residieren.
133 .TP
134 .B EFAULT
135 .I my_addr
136 weist auf eine Adresse außerhalb des erreichbaren Adressraumes zu.
137 .TP
138 .B ENAMETOOLONG
139 .I my_addr
140 ist zu lang.
141 .TP
142 .B ENOENT
143 Die Datei existiert nicht.
144 .TP
145 .B ENOMEM
146 Nicht genug Kernelspeicher vorhanden.
147 .TP
148 .B ENOTDIR
149 Eine Komponente des Pfad-Präfixes ist kein Verzeichnis.
150 .TP
151 .B EACCES
152 Keine berechtigung um eine Komponente des Pfad-prefixes zu durchsuchen.
153 .TP
154 .B ELOOP
155 .I my_addr
156 enthält eine Kreis-Referenz (zum Beispiel durch einen symbolischen
157 Link)
158
159 .SH GESCHICHTE
160 Der 
161 .B bind
162 Funktionruf erschien zuerst in BSD 4.2.
163 .SH "SIEHE AUCH"
164 .BR accept (2),
165 .BR connect (2),
166 .BR listen (2),
167 .BR socket (2),
168 .BR getsockname (2).