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

  man pages->FreeBSD man pages -> trimdomain (3)              
Title
Content
Arch
Section
 

TRIMDOMAIN(3)

Contents


NAME    [Toc]    [Back]

     trimdomain -- trim the current domain name from a host name

LIBRARY    [Toc]    [Back]

     System Utilities Library (libutil, -lutil)

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <libutil.h>

     void
     trimdomain(char *fullhost, int hostsize);

DESCRIPTION    [Toc]    [Back]

     The function trimdomain() removes the current domain name from the passed
     fullhost name by writing a NUL character over the first period of the
     passed name.  The current domain name is determined by calling
     gethostname(3) and removing everything up to the first period.  The name
     is determined the first time this function is called and is cached for
     future use.

     The trimdomain() function will only trim the domain name if the passed
     fullname ends with the current domain name and if the length of the
     resulting host name does not exceed hostsize.

     If the passed fullname is actually a DISPLAY specification of the form
     host.domain:nn[.nn] and the domain name is the same as the local domain
     name, trimdomain() will remove the embedded domain name, copying the
     screen and display numbers to the end of the base host name and resulting
     in host:nn[.nn].

RETURN VALUES    [Toc]    [Back]

     The trimdomain() function does not return a value.

SEE ALSO    [Toc]    [Back]

      
      
     gethostname(3)


FreeBSD 5.2.1			 April 7, 1999			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
setdomainname NetBSD get/set domain name of current host
getdomainname NetBSD get/set domain name of current host
setdomainname OpenBSD get/set YP domain name of current host
getdomainname OpenBSD get/set YP domain name of current host
setdomainname FreeBSD get/set the NIS domain name of current host
getdomainname FreeBSD get/set the NIS domain name of current host
domainname OpenBSD set or print YP domain of current host system
host FreeBSD look up host names using domain server
setdomainname Tru64 get or set name of current domain
getdomainname IRIX get/set name of current NIS domain
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service