freebsd man page for trimdomain

Query: trimdomain

OS: freebsd

Section: 3

Links: freebsd man pages   all man pages

Forums: unix linux community   forum categories

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

TRIMDOMAIN(3)						   BSD Library Functions Manual 					     TRIMDOMAIN(3)

NAME
trimdomain -- trim the current domain name from a host name
LIBRARY
System Utilities Library (libutil, -lutil)
SYNOPSIS
#include <sys/types.h> #include <libutil.h> void trimdomain(char *fullhost, int hostsize);
DESCRIPTION
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
The trimdomain() function does not return a value.
SEE ALSO
gethostname(3)
BSD
April 7, 1999 BSD
Related Man Pages
atscanuser(3) - debian
realhostname(3) - freebsd
setdomainname(3) - freebsd
trimdomain(3) - freebsd
yppoll(8) - freebsd
Similar Topics in the Unix Linux Community
How can i truncate filenmes?
trim file name extension????
How to end a host concurrent program in WARNING?
Help with awk trim
When do you need a separate service/IO domain?