hpux man page for sethostname

Query: sethostname

OS: hpux

Section: 2

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

sethostname(2)							System Calls Manual						    sethostname(2)

NAME
sethostname() - set name of current host system
SYNOPSIS
DESCRIPTION
The system call sets the name of the current system to name, which has a length of namelen characters. At system boot time is normally executed by the command (see hostname(1)) in the script. Host names are limited to characters, as defined in Security Restrictions The actions associated with this system call require the privilege Processes owned by the superuser have this privilege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges.
RETURN VALUE
returns the following values: Successful completion. Failure. is set to indicate the error.
ERRORS
If fails, is set to one of the following values. name points to an illegal address. The reliable detection of this error is implementation dependent. The user does not have appropriate privileges.
WARNINGS
Setting a hostname of more than 64 bytes with is possible only with the appropriate configuration options enabled (see nodehostname- size(5)). It is strongly recommended that all related documentation be completely understood before setting a larger hostname. A hostname larger than 64 bytes can cause anomalous behavior or failure in applications which use the command or the system function to obtain the name.
AUTHOR
was developed by the University of California, Berkeley.
SEE ALSO
hostname(1), uname(1), gethostname(2), uname(2), nodehostnamesize(5), privileges(5). sethostname(2)
Related Man Pages
sethostname(3c) - opensolaris
gethostname(3c) - sunos
uname(2) - hpux
gethostname(3c) - minix
sethostname(3c) - debian
Similar Topics in the Unix Linux Community
hp-ux or not?
Change HostName
Question about the system() function in C