首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

gethostbyname:Operation not permitted解决方法

2012-04-13 
gethostbyname:Operation not permittedRTcode:C/C++ coderc gethostname(hname, sizeof(hname))if (rc

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和网上的例子都差不多,没看出来有什么问题
[解决办法]
权限不够?
[解决办法]
运行时加权限?

热点排行