Pages

c program in linux to find the maximum length allowed for a host name

The following is a C program to find out the maximum length allowed for a host name in the system We can make use of the function sysconf and pass the argument _SC_HOST_NAME_MAX
We need the header file unistd.h to use sysconf.



Save the program as get_max_hostname.c. Compile and execute the code.




No comments:

Post a Comment