In a C project (POSIX), how do I get the fully qualified name for the current system?
For example, I can get just the hostname of my machine by doing gethostna
gethostna
gethostname() is POSIX way to get local host name. Check out man.
gethostname()
man
BSD function getdomainname() can give you domain name so you can build fully qualified hostname. There is no POSIX way to get a domain I'm afraid.
getdomainname()