unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (HP-UX-11.11)
Page:
Section:
Apropos / Subsearch:
optional field



 sethostname(2)						      sethostname(2)




 NAME
      sethostname - set name of host cpu

 SYNOPSIS
      #include <&lt&lt&lt;unistd.h>&gt&gt&gt;

      int sethostname(const char *name, size_t namelen);

 DESCRIPTION
      The sethostname() system call sets the name of the host processor to
      name, which has a length of namelen characters.  At system boot time
      sethostname() is normally executed by the hostname command (see
      hostname(1)) in the /sbin/init.d/hostname script.	 Host names are
      limited to MAXHOSTNAMELEN characters, as defined in <&lt&lt&lt;sys/param.h>&gt&gt&gt;.

 RETURN VALUE
      sethostname() returns the following values:

	    0	Successful completion.
	   -1	Failure.  errno is set to indicate the error.

 ERRORS
      If sethostname() fails, errno is set to one of the following values.

	   [EFAULT]	  name points to an illegal address.  The reliable
			  detection of this error is implementation
			  dependent.

	   [EPERM]	  The user does not have appropriate privileges.

 AUTHOR
      sethostname() was developed by the University of California, Berkeley.

 SEE ALSO
      hostname(1), uname(1), gethostname(2), uname(2).



















 Hewlett-Packard Company	    - 1 -   HP-UX Release 11i: November 2000