嗨我尝试编译这个程序:
#include <sys/types.h>
#include <sys/dlpi_ether.h>
#include <sys/dlpi_common.h>
#include <stropts.h>
#include <unistd.h>
int main(int argc,char *argv[])
{
int fd, status;
struct strioctl strcmd;
unsigned char addr[6];
fd = open(argv[1],0,0);
if (fd == -1) {
perror("enaddr: open");
exit(1);
}
strcmd.ic_cmd = DLIOCGENADDR;
strcmd.ic_timout = 0;
strcmd.ic_len = sizeof(addr);
strcmd.ic_dp = addr;
status = ioctl(fd,I_STR,&strcmd);
if (status == -1) {
perror("enaddr: ioctl");
exit(1);
}
printf("%02.2x:%02.2x:%02.2x:%02.2x:%02.2x:%02.2x\n",addr[0],addr[1],addr[2],addr[3],addr[4],addr[5]);
}
终端返回这个致命错误:
prova.c:3:30:致命错误:sys/dlpi_common.h:没有此类文件或目录编译终止。
为什么?这个图书馆在哪里?