When does libc’s gethostname return the “hostname”, rather than the FQDN (or “host name”)?
On my test system, hostname --fqdn
returns the Fully Qualified Domain Name (FQDN) which is foo.example.com
.
When does libc’s gethostname return the “hostname”, rather than the FQDN (or “host name”)?
On my test system, hostname --fqdn
returns the Fully Qualified Domain Name (FQDN) which is foo.example.com
.
C++ and syscalls: ignoring return value and checking errno instead
Error checking in C is a task that is very verbose and makes the code unreadable. In C++ you have exceptions, but when I use C++ to call C functions, the headaches come back. I wish there was a “syscalls wrapper for C++” where all the functions have the same names and parameters, but where errors are turned into exceptions and that’s all. That would be game changing.