GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
TRIMDOMAIN(3) FreeBSD Library Functions Manual TRIMDOMAIN(3)

trimdomain
trim the current domain name from a host name

System Utilities Library (libutil, -lutil)

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

void
trimdomain(char *fullhost, int hostsize);

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].

The trimdomain() function does not return a value.

gethostname(3)

The function trimdomain() first appeared in FreeBSD 3.2.
April 7, 1999 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.