Imported tab->space correction by redhat
[infodrom/manpages-de] / man2 / gethostname.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one
13 .\" 
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\" 
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified 22 July 1995 by Michael Chastain (mec@duracef.shout.net):
26 .\"   'gethostname' is real system call on Linux/Alpha.
27 .\"
28 .\" German translation by René Tschirley (gremlin@cs.tu-berlin.de)
29 .\"
30 .TH GETHOSTNAME 2 "22. July 1995" "Linux 1.3.6" "Systemaufrufe"
31 .SH BEZEICHNUNG
32 gethostname, sethostname \- hole/setze Hostname
33 .SH ÜBERSICHT
34 .B #include <unistd.h>
35 .sp
36 .BI "int gethostname(char *" name ", size_t " len );
37 .br
38 .BI "int sethostname(const char *" name ", size_t " len );
39 .SH BESCHREIBUNG
40 Diese Funktionen werden dazu benutzt, den Hostnamen des Systems
41 abzufragen oder zu setzen.
42 .SH "RÜCKGABEWERT"
43 Bei Erfolg wird 0 zurückgeliefert, bei aufgetretenem Fehler -1 und 
44 .I errno
45 wird entsprechend gesetzt.
46 .SH FEHLER
47 .TP
48 .B EINVAL
49 .I len
50 ist negativ, oder bei
51 .BR sethostname
52 ist
53 .I len
54 größer als die maximal zulässige Größe, oder bei
55 .BR gethostname
56 unter Linux/i386 ist
57 .I len
58 kleiner als die aktuelle Größe.
59 .TP
60 .B EPERM
61 .BR sethostname 
62 wurde nicht vom Superuser aufgerufen.
63 .TP
64 .B EFAULT
65 .I name
66 ist eine ungültige Adresse.
67 .SH "KOMPATIBEL ZU"
68 Diese Funktionen werden nicht in POSIX.1 definiert, doch werden sie in
69 B.4.4.1 der ISO/IEC 9945-1:1990 erwähnt.
70 .SH BUGS
71 Einige andere Implementationen von
72 .B gethostname
73 liefern erfolgreich
74 .I len
75 bytes, auch wenn 
76 .I name
77 länger ist.
78 Linux/Alpha verhält sich analog, während Linux/i386 in diesem Falle
79 .B EINVAL
80 zurückliefert.
81 .SH ANMERKUNGEN
82 In Linux/Alpha ist
83 .B gethostname
84 ein System Call, in Linux/i386 ist
85 .B gethostname
86 auf Libraryebene als Aufruf von 
87 .BR uname (2)
88 realisiert.
89 .SH "SIEHE AUCH"
90 .BR getdomainname (2),
91 .BR setdomainname (2),
92 .BR uname (2).