[Click] #include <unistd.h> header in kernel ?

ndritsos ndritsos at gmail.com
Sun Aug 25 16:35:16 EDT 2013


Hello everyone ,

i have created an element that uses  the library unistd.h,  and in the 
user level it works fine .
Now i'm working in kernel level , and it doesn't work.

in kernel level i have imported :

#include <linux/unistd.h>

and i have this  compile time error:
---
In file included from 
/home/dritsos/click/linuxmodule/../elements/local/ndritso.cc:23:0:
/home/dritsos/click/include/click-linuxmodule/include2/linux/unistd.h:5:3: 
error: #error "missing #include <click/cxxprotect.h>"
In file included from 
/home/dritsos/click/include/click-linuxmodule/include2/linux/unistd.h:12:0,
                  from 
/home/dritsos/click/linuxmodule/../elements/local/ndritso.cc:23:
/home/dritsos/click/include/click-linuxmodule/include0/asm/unistd.h:4:3: 
error: #error "missing #include <click/cxxprotect.h>"
In file included from 
/home/dritsos/click/include/click-linuxmodule/include0/asm/unistd.h:8:0,
                  from 
/home/dritsos/click/include/click-linuxmodule/include2/linux/unistd.h:12,
from /home/dritsos/click/linuxmodule/../elements/local/ndritso.cc:23:
/home/dritsos/click/include/click-linuxmodule/include0/asm/unistd_32.h:5:3: 
error: #error "missing #include <click/cxxprotect.h>"
/home/dritsos/click/linuxmodule/../elements/local/ndritso.cc: In member 
function 'virtual int NdritsoElement::initialize(ErrorHandler*)':
/home/dritsos/click/linuxmodule/../elements/local/ndritso.cc:59:8: 
error: 'getpid' was not declared in this scope
make[3]: *** [/home/dritsos/click/linuxmodule/ndritso.o] Error 1
make[2]: *** [_module_/home/dritsos/click/linuxmodule] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-3.0.0-12-generic'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/dritsos/click/linuxmodule'
make: *** [install-linuxmodule] Error 2


---


Any idea how i can fix this error??

thanks in advance


More information about the click mailing list