1、Implicit declaration of function 'inet_addr' is invalid in C99
添加 #include <arpa/inet.h>
2、Implicit declaration of function 'read' is invalid in C99
Implicit declaration of function 'write' is invalid in C99
Implicit declaration of function 'close' is invalid in C99
相应的改为 fread,fwrite,fclose,对应函数的参数也要调整
3、Implicit declaration of function 'access' is invalid in C99
添加 #include <unistd.h>
#include <fcntl.h>
4、Implicit declaration of function 'sign_extend' is invalid in C99
在Linux Kernel 的源文件里有定义
static __inline int
sign_extend(int n, int num_bits)
{
int shift = (int)(sizeof(int) * 8 - num_bits);
return (n << shift) >> shift;
}