S
sjain
Guest
Hi,
What is the maximum host name length defined by the OS. i mean, i had defined a 100 bytes of array which stores the hostname of my OS. I am porting the code for various flavours of Unix( Linux, HP UX, Solaris, AIX) and now MAC. But on MAC, i faced this issue where my hostname length exceeded this value of 100 and i got this segmentation fault. merely increasing it to 256 runs me into more issues. so by hit and trial method i have ended up taking 156 as the value of the array which works fine with me. but i am not satisfied with this approach. There must be a maximum value defined by the OS itself that it assigns itself for the hostname, ( some form of macro), which will give me a better approach to solve the issue. If anybody has any idea regarding this, please let me know ASAP.
Thanks a lot in advance
Regards
Sjain
What is the maximum host name length defined by the OS. i mean, i had defined a 100 bytes of array which stores the hostname of my OS. I am porting the code for various flavours of Unix( Linux, HP UX, Solaris, AIX) and now MAC. But on MAC, i faced this issue where my hostname length exceeded this value of 100 and i got this segmentation fault. merely increasing it to 256 runs me into more issues. so by hit and trial method i have ended up taking 156 as the value of the array which works fine with me. but i am not satisfied with this approach. There must be a maximum value defined by the OS itself that it assigns itself for the hostname, ( some form of macro), which will give me a better approach to solve the issue. If anybody has any idea regarding this, please let me know ASAP.
Thanks a lot in advance
Regards
Sjain