]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/getdomainname.2
Added/updated glibc feature test macro requirements
[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 2007-07-26 "Linux" "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 .sp
38 .in -4n
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
41 .in
42 .sp
43 .ad l
44 .BR getdomainame (),
45 .BR setdomainame ():
46 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
47 .ad b
48 .SH DESCRIPTION
49 These functions are used to access or to change the domain name of the
50 current processor.
51 If the null-terminated domain name requires more than \fIlen\fP bytes,
52 .BR getdomainname ()
53 returns the first \fIlen\fP bytes (glibc) or returns an error (libc).
54 .SH "RETURN VALUE"
55 On success, zero is returned.
56 On error, \-1 is returned, and
57 .I errno
58 is set appropriately.
59 .SH ERRORS
60 .TP
61 .B EFAULT
62 For
63 .BR setdomainname ():
64 .I name
65 pointed outside of user address space.
66 .TP
67 .B EINVAL
68 For
69 .BR getdomainname ()
70 under libc:
71 .I name
72 is NULL or
73 .I name
74 is longer than
75 .I len
76 bytes.
77 .TP
78 .B EINVAL
79 For
80 .BR setdomainname ():
81 .I len
82 was negative or too large.
83 .TP
84 .B EPERM
85 For
86 .BR setdomainname ():
87 the caller is unprivileged (Linux: does not have the
88 .B CAP_SYS_ADMIN
89 capability).
90 .SH "CONFORMING TO"
91 POSIX does not specify these calls.
92 .\" But they appear on most systems...
93 .SH "SEE ALSO"
94 .BR gethostname (2),
95 .BR sethostname (2),
96 .BR uname (2)