1GETDOMAINNAME(2) Linux Programmer's Manual GETDOMAINNAME(2)
2
3
4
6 getdomainname, setdomainname - get/set domain name
7
9 #include <unistd.h>
10
11 int getdomainname(char *name, size_t len);
12 int setdomainname(const char *name, size_t len);
13
15 These functions are used to access or to change the domain name of the
16 current processor. If the null-terminated domain name requires more
17 than len bytes, getdomainname() returns the first len bytes (glibc) or
18 returns an error (libc).
19
21 On success, zero is returned. On error, -1 is returned, and errno is
22 set appropriately.
23
25 EFAULT For setdomainname(): name pointed outside of user address space.
26
27 EINVAL For getdomainname() under libc: name is NULL or name is longer
28 than len bytes.
29
30 EINVAL For setdomainname(): len was negative or too large.
31
32 EPERM For setdomainname(): the caller is unprivileged (Linux: does not
33 have the CAP_SYS_ADMIN capability).
34
36 POSIX does not specify these calls.
37
39 gethostname(2), sethostname(2), uname(2)
40
41
42
43Linux 2.6.7 2004-06-17 GETDOMAINNAME(2)