gethostbyname:Operation not permitted
RT
code:
rc = gethostname(hname, sizeof(hname)); if (rc == -1) { printf("%s: failed in gethostname,lien=%d,%s\n", __FUNCTION__, __LINE__, strerror(errno)); return -1; } printf("hostname is %s\n", hname); ht = gethostbyname(hname); if (ht == NULL) { printf("%s: failed in gethostbyname,line=%d,%s\n", __FUNCTION__, __LINE__, strerror(h_errno)); return -1; }