*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> sethostname (2)              
Title
Content
Arch
Section
 

sethostname(2)

Contents


NAME    [Toc]    [Back]

       sethostname - Set the name of the current host

SYNOPSIS    [Toc]    [Back]

       int sethostname(
               char *name,
               int name_len );

PARAMETERS    [Toc]    [Back]

       Points to an array of bytes where the host name is stored.
       Specifies the length of the array pointed to by  the  name
       parameter.

DESCRIPTION    [Toc]    [Back]

       The  sethostname()  function allows a calling process with
       root user authority to set the internal  host  name  of  a
       machine on a network.

       System host names are limited to MAXHOSTNAMELEN as defined
       in the /usr/include/sys/param.h file.

       The sethostid() function fails if the calling process does
       not have the superuser privilege.

RETURN VALUES    [Toc]    [Back]

       Upon  successful completion, the system returns a value of
       0 (zero).  If the  sethostname()  function  fails,  -1  is
       returned and errno is set to indicate the error.

ERRORS    [Toc]    [Back]

       If  the  sethostname() function fails, errno may be set to
       one of the following values: The  name  parameter  or  the
       name_len  parameter  gives  an  address that is not valid.
       The calling process does not have appropriate privilege.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: gethostid(2), sethostid(2), gethostname(2)



                                                   sethostname(2)
[ Back ]
 Similar pages
Name OS Title
sethostname NetBSD get/set name of current host
sethostname FreeBSD get/set name of current host
gethostname HP-UX get name of current host
gethostname NetBSD get/set name of current host
gethostname FreeBSD get/set name of current host
sethostname OpenBSD get/set name of current host
gethostname IRIX get/set name of current host
gethostname OpenBSD get/set name of current host
setdomainname FreeBSD get/set the NIS domain name of current host
gethostid HP-UX get an identifier for the current host
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service