| Main index | Section 3 | 日本語 | Options |
#include <unistd.h>
The sethostname() function sets the name of the host machine to be name, which has length namelen. This call is restricted to the super-user and is normally used only when the system is bootstrapped.
Applications should use sysconf(_SC_HOST_NAME_MAX) to find the maximum length of a host name (not including the terminating null).
| [EFAULT] | |
| The name or namelen argument gave an invalid address. | |
| [ENAMETOOLONG] | |
| The current host name is longer than namelen. (For gethostname() only.) | |
| [EPERM] | |
| The caller tried to set the host name and was not the super-user. | |
| GETHOSTNAME (3) | July 13, 2020 |
| Main index | Section 3 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. | ” |
| — The Unix Haters' handbook | ||