From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/MAN/gethostname.htm | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 reference/C/MAN/gethostname.htm (limited to 'reference/C/MAN/gethostname.htm') diff --git a/reference/C/MAN/gethostname.htm b/reference/C/MAN/gethostname.htm new file mode 100644 index 0000000..4b5256c --- /dev/null +++ b/reference/C/MAN/gethostname.htm @@ -0,0 +1,99 @@ +gethostname + +
+
+
+
+
+

GETHOSTNAME(2) Linux Programmer's Manual GETHOSTNAME(2) +

+ +

NAME +

gethostname, sethostname - get/set host name + +

SYNOPSIS +

#include <unistd.h> + + int gethostname(char *name, size_t len); + int sethostname(const char *name, size_t len); + +

DESCRIPTION +

These functions are used to access or to change the host + name of the current processor. + +

RETURN VALUE +

On success, zero is returned. On error, -1 is returned, + and errno is set appropriately. + +

ERRORS +

EINVAL len is negative or, for sethostname, len is larger + than the maximum allowed size, or, for gethostname + on Linux/i386, len is smaller than the actual size. + + EPERM For sethostname, the caller was not the superuser. + + EFAULT name is an invalid address. + +

CONFORMING TO +

POSIX.1 does not define these functions, but ISO/IEC + 9945-1:1990 mentions them in B.4.4.1. + +

BUGS +

Some other implementations of gethostname successfully + return len bytes even if name is longer. Linux/Alpha com- + plies with this behaviour. Linux/i386, however, returns + EINVAL in this case (as of DLL 4.6.27 libraries). + +

NOTES +

Under Linux/Alpha, gethostname is a system call. Under + Linux/i386, gethostname is implemented at the library + level by calling uname(2). + +
+
+

SEE ALSO +

+getdomainname, +setdomainname, +uname, +

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Linux 1.3.6 22 July 1995 1 +

+ +
+

+


+

+

+ + + + +
+Top + +Master Index + +Keywords + +Functions +
+
+

+


+ +This manual page was brought to you by mjl_man V-2.0 -- cgit v1.2.3-54-g00ecf