我想在网卡上记下硬件时间戳。我从Solarflare找到了一些示例代码,用于检查是否定义了以下标签:
#ifdef SIOCSHWTSTAMP
struct ifreq ifr;
struct hwtstamp_config hwc;
#else
static_assert(false); // I added this to check whether my system has the label defined
#endif
但是
static_assert
正在被触发,因此此标签未在系统中定义。
#include <netinet/in.h>
#include <arpa/inet.h>
#include <time.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
很明显,这些都没有定义。
我们安装了
linux-libc-dev
但这似乎没有帮助。
哪个头应该存在,所以我可以检查?
我的内核版本是3.10.0-1062.4.1.el7.x86_64和CentOS 7