读书人

gethostbyname:Operation not permit

发布时间: 2012-04-13 13:50:24 作者: rapoo

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

读书人网 >C语言

热点推荐