为什么我有些函数和宏定义没法使用?
环境如下:
Linux forhu-debian 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux
gcc version 4.7.2 (Debian 4.7.2-5)
test.c:17:18: error: storage size of ‘req’ isn’t known
test.c:17:22: error: storage size of ‘rem’ isn’t known
test.c:38:3: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
make: *** [main.o] Error 1
6 #include <time.h>
...
17 struct timespec req,rem;
18 req.tv_sec=0;
19 req.tv_nsec=10000000;
...
38 nanosleep(&req,&rem);
#define __need_timespec
#include <time.h>