如何在xnu或macOS上使用SO_DEBUG套接字选项?

我使用setsockopt在macOS上设置SO_DEBUG,但找不到调试输出在哪里。

我在Mac上尝试过控制台appdmesg命令,但没有找到调试输出。

int res;
    int debug = 1;
    printf("begin set socket option,debug: %d\n",debug);
    res = setsockopt(sockfd,SOL_SOCKET,SO_DEBUG,&debug,sizeof(debug));
    if(res < 0) {
            printf("Error happened when set socket options: %d\n",res);
            exit(1);
    }

我想查看套接字处理的调试输出。有人可以帮我吗?

jueyuanti01 回答:如何在xnu或macOS上使用SO_DEBUG套接字选项?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3169192.html

大家都在问