【发布时间】:2017-09-21 10:25:13
【问题描述】:
我正在尝试在 ClearOS 7.3 64 位上执行简单程序
#include <sys/socket.h>
#include <linux/netlink.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
int main()
{
int flags =0;
int bus = NETLINK_NETFILTER;
int sock_fd = socket(AF_NETLINK, SOCK_RAW | flags, bus);
if(sock_fd<0)
{
printf("\nsocket failed with error no = %d and error msg = %s\n",
errno, strerror(errno));
return -1;
}
printf("\nOP completed successfully..!\n");
return 0;
}
我收到以下错误:
套接字失败,错误号 = 93,错误消息 = 协议不 支持
我的操作系统详细信息是:
- ClearOS 7.3.0 版(最终版)
- Linux 3.10.0-514.26.2.v7.x86_64 #1 SMP 2017 年 7 月 5 日星期三 10:37:54 MDT x86_64 x86_64 x86_64 GNU/Linux
请帮忙。
【问题讨论】: