gethostbyname:Operation not permitted
RT
code:
- C/C++ 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; }
请高手指教~~~~~~
[解决办法]
google gethostbyname:Operation not permitted
http://hi.baidu.com/atomxu/blog/item/782772083739e0a52eddd487.html
[解决办法]
.信息不足,在MSDN和网上的例子都差不多,没看出来有什么问题
[解决办法]
权限不够?
[解决办法]
运行时加权限?