]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/getdomainname.2
Global change of email address for MTK (now: mtk-manpages@gmx.net)
[thirdparty/man-pages.git] / man2 / getdomainname.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 1997-08-25 by Nicolás Lichtmaier <nick@debian.org>
26 .\" Modified 2004-06-17 by Michael Kerrisk <mtk-manpages@gmx.net>
27 .\"
28 .TH GETDOMAINNAME 2 2004-06-17 "Linux 2.6.7" "Linux Programmer's Manual"
29 .SH NAME
30 getdomainname, setdomainname \- get/set domain name
31 .SH SYNOPSIS
32 .B #include <unistd.h>
33 .sp
34 .BI "int getdomainname(char *" name ", size_t " len );
35 .br
36 .BI "int setdomainname(const char *" name ", size_t " len );
37 .SH DESCRIPTION
38 These functions are used to access or to change the domain name of the
39 current processor.
40 If the NUL-terminated domain name requires more than \fIlen\fP bytes,
41 .B getdomainname
42 returns the first \fIlen\fP bytes (glibc) or returns an error (libc).
43 .SH "RETURN VALUE"
44 On success, zero is returned. On error, \-1 is returned, and
45 .I errno
46 is set appropriately.
47 .SH ERRORS
48 .TP
49 .B EFAULT
50 For
51 .BR setdomainname :
52 .I name
53 pointed outside of user address space.
54 .TP
55 .B EINVAL
56 For
57 .BR getdomainname
58 under libc:
59 .I name
60 is
61 .B NULL
62 or
63 .I name
64 is longer than
65 .I len
66 bytes.
67 .TP
68 .B EINVAL
69 For
70 .BR setdomainname :
71 .I len
72 was negative or too large.
73 .TP
74 .B EPERM
75 For
76 .BR setdomainname :
77 the caller is unprivileged (Linux: does not have the
78 .B CAP_SYS_ADMIN
79 capability).
80 .SH "CONFORMING TO"
81 POSIX does not specify these calls.
82 .SH "SEE ALSO"
83 .BR gethostname (2),
84 .BR sethostname (2),
85 .BR uname (2)