CP210 driver installation on linux - makefile

I have been unsuccessfully trying to install the CP210x drivers on my linux machine. The current version of kernel on my machine is 2.6.18.
Although I have heard, all kernel > 2.6.12 comes pre-loaded with CP210 drivers, I was unable to find one on mine, when I tried,
modprobe cp210x
It returned an error.
So when I tried to install the Cp210x driver from Silabs, I'm constantly ending with the following error,
make -C /lib/modules/2.6.18-194.8.1.el5/build
M=/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source modules
make-3.79.1-p7[1]: Entering directory `/usr/src/kernels/2.6.18-194.8.1.el5-x86_64'
CC [M] /users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.o
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:45: warning: 'struct ktermios' declared inside parameter list
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:45: warning: its scope is only this definition or declaration, which is probably not what you want
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:47: warning: 'struct ktermios' declared inside parameter list
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:175: error: unknown field 'usb_driver' specified in initializer
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:175: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:178: error: unknown field 'bulk_in_size' specified in initializer
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:178: warning: missing braces around initializer
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:178: warning: (near initialization for 'cp210x_device.driver_list')
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:178: warning: initialization makes pointer from integer without a cast
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:179: error: unknown field 'bulk_out_size' specified in initializer
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:179: warning: initialization makes pointer from integer without a cast
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:180: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:181: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:182: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:183: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:184: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:185: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:186: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:188: error: unknown field 'release' specified in initializer
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:188: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:189: error: unknown field 'dtr_rts' specified in initializer
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:190: warning: initialization from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: In function 'cp210x_open':
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:446: warning: passing argument 1 of 'usb_serial_generic_open' from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:446: warning: passing argument 2 of 'usb_serial_generic_open' from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: In function 'cp210x_close':
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:453: error: too few arguments to function 'usb_serial_generic_close'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:455: error: 'struct usb_serial' has no member named 'disc_mutex'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:456: error: 'struct usb_serial' has no member named 'disconnected'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:459: error: 'struct usb_serial' has no member named 'disc_mutex'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: In function 'cp210x_get_termios':
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:535: error: implicit declaration of function 'tty_encode_baud_rate'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: At top level:
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:702: warning: 'struct ktermios' declared inside parameter list
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:703: error: conflicting types for 'cp210x_change_speed'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:45: error: previous declaration of 'cp210x_change_speed' was here
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: In function 'cp210x_change_speed':
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:706: error: 'struct termios' has no member named 'c_ospeed'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:720: error: dereferencing pointer to incomplete type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: At top level:
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:729: warning: 'struct ktermios' declared inside parameter list
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:730: error: conflicting types for 'cp210x_set_termios'
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:47: error: previous declaration of 'cp210x_set_termios' was here
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: In function 'cp210x_set_termios':
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:741: error: dereferencing pointer to incomplete type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:743: warning: passing argument 3 of 'cp210x_change_speed' from incompatible pointer type
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c: In function '__check_debug':
/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.c:1019: warning: return from incompatible pointer type
make-3.79.1-p7[2]: *** [/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source/cp210x.o] Error 1
make-3.79.1-p7[1]: *** [_module_/users/phunchik/Desktop/Linux_3.x.x_VCP_Driver_Source] Error 2
make-3.79.1-p7[1]: Leaving directory `/usr/src/kernels/2.6.18-194.8.1.el5-x86_64'
make-3.79.1-p7: *** [all] Error 2 **
It would be great if some one could help me fix this error or suggest a way to update my kernel

It seems that your driver needs Linux_3.x.x as suggests the directory name.
For information, Linux 3.x.x is equivalent to Linux 2.6.40+. So you are at least 22 versions behind.
To upgrade your kernel, just use your distribution upgrade system (apt-get, aptitude, yum, ...).
You can also build a new kernel by hand, but it is far more difficult.

I think you've just downloaded the wrong driver. The one for the 2.6 kernel is here:
http://www.silabs.com/Support%20Documents/Software/Linux_2.6.x_VCP_Driver_Source.zip
hth

Related

FFmpeg Make Errors with v4l2

I tried checking out ffmpeg to build it as follows:
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
cd ffmpeg
./configure --disable-asm --disable-v4l2-m2m --disable-indev=v4l2 --disable-outdev=v4l2
make
But I get the following errors:
libavcodec/v4l2_m2m_enc.c: In function ‘v4l2_set_ext_ctrl’:
libavcodec/v4l2_m2m_enc.c:51: warning: braces around scalar initializer
libavcodec/v4l2_m2m_enc.c:51: warning: (near initialization for
‘ctrls.count’) libavcodec/v4l2_m2m_enc.c:55: error: ‘struct v4l2_ext_controls’ has no member named ‘ctrl_class’ libavcodec/v4l2_m2m_enc.c:60:
error: ‘struct v4l2_ext_control’ has no member named ‘value’
libavcodec/v4l2_m2m_enc.c: In function ‘v4l2_get_ext_ctrl’:
libavcodec/v4l2_m2m_enc.c:71: warning: braces around scalar initializer
libavcodec/v4l2_m2m_enc.c:71: warning: (near initialization for
‘ctrls.count’) libavcodec/v4l2_m2m_enc.c:76: error: ‘struct v4l2_ext_controls’ has no member named ‘ctrl_class’ libavcodec/v4l2_m2m_enc.c:89:
error: ‘struct v4l2_ext_control’ has no member named ‘value’ make: ***
[libavcodec/v4l2_m2m_enc.o] Error 1
Any idea how to proceed ?

How to get better error output with Visual Studio

I was working on a project and got the following errors
Error (active) the default constructor of "Input" cannot be referenced -- it is a deleted function EquationSolver c:\Users\Kim\Documents\Visual Studio 2015\Projects\EquationSolver\EquationSolver\main.cpp 10
Error C2280 'Input::Input(void)': attempting to reference a deleted function EquationSolver <project_dir>\main.cpp 10
Since it is almost impossible to find the cause of the error from this, I tried compiling with gcc with -Wall and got following output
main.cpp: In function 'int main()':
main.cpp:10:9: error: use of deleted function 'Input::Input()'
Input input;
^~~~~
In file included from main.cpp:2:0:
Input.hpp:16:7: note: 'Input::Input()' is implicitly deleted because the default definition would be ill-formed:
class Input
^~~~~
Input.hpp:16:7: error: use of deleted function 'Expressions::Expressions()'
In file included from Input.hpp:11:0,
from main.cpp:2:
Expressions.hpp:8:7: note: 'Expressions::Expressions()' is implicitly deleted because the default definition would be ill-formed:
class Expressions
^~~~~~~~~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
Expressions.hpp:17:8: note: 'Expressions::Vec& Expressions::left' should be initialized
Vec& left;
^~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
class Expressions
^~~~~~~~~~~
Expressions.hpp:18:8: note: 'Expressions::Vec& Expressions::right' should be initialized
Vec& right;
^~~~~
This output is much more verbose and quickly helped me find the origin, which was a misplaced & (class member should be Vec left, was Vec& left).
Is it possible to make Visual Studio as verbose?
When putting Visual Studio to /Wall, I get >1800 warnings, most completely unrelated to my project, but I still only get those two errors.

Can't compile CapacitiveSensor example in Arduino

I am trying to use the Capacitive Sensors Library from the Arduino Playground with Arduino 1.5.3 for Intel Galileo.
While trying to compile the example Sketch of the library with nothing touched I get the following error:
Arduino: 1.5.3 (Windows 7), Board: "Intel® Galileo"
CapacitiveSensor.cpp: In constructor
'CapacitiveSensor::CapacitiveSensor(uint8_t, uint8_t)':
CapacitiveSensor.cpp:30:63: error: 'F_CPU' was not declared in this
scope CapacitiveSensor.cpp:43:10: error: 'PinDescription' has no
member named 'ulPin' CapacitiveSensor.cpp:44:10: error:
'PinDescription' has no member named 'pPort'
CapacitiveSensor.cpp:45:31: error: 'portModeRegister' was not declared
in this scope CapacitiveSensor.cpp:46:9: error: base operand of '->'
is not a pointer CapacitiveSensor.cpp:48:9: error: 'PinDescription'
has no member named 'ulPin' CapacitiveSensor.cpp:49:10: error:
'PinDescription' has no member named 'pPort'
CapacitiveSensor.cpp:51:9: error: base operand of '->' is not a
pointer CapacitiveSensor.cpp:52:12: error: base operand of '->' is not
a pointer CapacitiveSensor.cpp:55:18: error: 'noInterrupts' was not
declared in this scope CapacitiveSensor.cpp:57:16: error: 'interrupts'
was not declared in this scope CapacitiveSensor.cpp: In member
function 'void CapacitiveSensor::set_CS_Timeout_Millis(long unsigned
int)': CapacitiveSensor.cpp:133:73: error: 'F_CPU' was not declared in
this scope CapacitiveSensor.cpp: In member function 'int
CapacitiveSensor::SenseOneCycle()': CapacitiveSensor.cpp:141:18:
error: 'noInterrupts' was not declared in this scope
CapacitiveSensor.cpp:151:16: error: 'interrupts' was not declared in
this scope
I downloaded the files and imported the "CapacitiveSensor"-Folder into (I did those steps one after the other, not at the same time.):
The libraries folder under Documents/arduino/.
The libraries folder in the arduino folder where the arduino.exe is stored.
Onto arduino-1.5.3/hardware/libraries/ (because this is mentioned on the site where I downloaded it)
And I tried this: Here Because it seemed to be the same error as I had. But it didnt work.
I also deleted my Arduino and reinstalled it.
Anyone has an Idea?
Thanks in advance,
Clemens
There is a similar question on the Arduino forum but I don't know if your issue is exactly the same: [FIXED][CapacitiveSensor] Can't compile with Due (port manipulation)
It doesn't look like the Arduino folks are very responsive. The user modified register names and eventually put his own library out there.
*"...changed the uint8_t registers to RwReg (compiler doesn't complain) and I replaced the use of portModeRegister(PIN) with simple pinMode(PIN, MODE) calls (it's slower but it works)."*

Error compiling with Poco in XCode 4

I am working on a project at work that includes a project that was built using the Poco library. When I attempt to compile the project, XCode gives me many errors related to the STL. After some searching around on the internet, I was able to deduce that including Poco can be the cause of this, but no answers on how to fix this problem.
Here are the errors:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:298:9: No member named 'memmove' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:7: Use of undeclared identifier 'ostreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:27: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:35: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:9: Use of undeclared identifier 'ostreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:29: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:37: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:5: Variable '__copy_aux' declared as a template
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:16: Use of undeclared identifier 'istreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:36: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:43: Expected expression
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:18: Use of undeclared identifier 'ostreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:38: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:46: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:446:9: No member named 'memmove' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:600:10: No member named 'memset' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:608:10: No member named 'memset' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:616:10: No member named 'memset' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:908:31: No member named 'memcmp' in namespace 'std'
Any help would be greatly appreciate. I should note that I am not calling the Poco library directly, but some of the code from the other project makes reference to it.

C Libraries with Makefile

I am trying to create a kernel module which needs to generate random numbers to work properly. To achieve this, I have included <stdlib.h> and <time.h> to my code but I can't compile the module with the make command.
I searched for help on the web and tried to include EXTRA_CFLAGS := -I/usr/include into the Makefile, but after this I keep getting even more errors.
Here is the error message That I received:
kernel#KernelDev:~/Modulos/DropProb$ make
make -C /lib/modules/3.2.0-37-generic/build SUBDIRS=/home/kernel/Modulos/DropProb modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-37-generic'
CC [M] /home/kernel/Modulos/DropProb/drop_prob.o
In file included from /home/kernel/Modulos/DropProb/drop_prob.c:15:0:
/usr/include/stdlib.h: In function ‘atof’:
/usr/include/stdlib.h:280:1: error: SSE register return with SSE disabled
In file included from include/linux/compiler.h:48:0,
from include/linux/linkage.h:4,
from include/linux/kernel.h:13,
from /home/kernel/Modulos/DropProb/drop_prob.c:19:
include/linux/compiler-gcc.h: At top level:
include/linux/compiler-gcc.h:87:0: warning: "__attribute_const__" redefined [enabled by default]
/usr/include/sys/cdefs.h:241:0: note: this is the location of the previous definition
In file included from include/linux/compiler.h:48:0,
from include/linux/linkage.h:4,
from include/linux/kernel.h:13,
from /home/kernel/Modulos/DropProb/drop_prob.c:19:
include/linux/compiler-gcc.h:106:0: warning: "__always_inline" redefined [enabled by default]
/usr/include/sys/cdefs.h:312:0: note: this is the location of the previous definition
In file included from include/linux/kernel.h:15:0,
from /home/kernel/Modulos/DropProb/drop_prob.c:19:
include/linux/types.h:23:26: error: conflicting types for ‘fd_set’
/usr/include/sys/select.h:76:5: note: previous declaration of ‘fd_set’ was here
include/linux/types.h:24:25: error: conflicting types for ‘dev_t’
/usr/include/sys/types.h:61:17: note: previous declaration of ‘dev_t’ was here
include/linux/types.h:33:26: error: conflicting types for ‘timer_t’
/usr/include/time.h:104:19: note: previous declaration of ‘timer_t’ was here
include/linux/types.h:53:26: error: conflicting types for ‘loff_t’
/usr/include/sys/types.h:45:18: note: previous declaration of ‘loff_t’ was here
include/linux/types.h:120:17: error: conflicting types for ‘u_int64_t’
/usr/include/sys/types.h:204:1: note: previous declaration of ‘u_int64_t’ was here
include/linux/types.h:121:17: error: conflicting types for ‘int64_t’
/usr/include/sys/types.h:198:1: note: previous declaration of ‘int64_t’ was here
include/linux/types.h:142:23: error: conflicting types for ‘blkcnt_t’
/usr/include/sys/types.h:236:20: note: previous declaration of ‘blkcnt_t’ was here
In file included from include/linux/stat.h:60:0,
from include/linux/module.h:10,
from /home/kernel/Modulos/DropProb/drop_prob.c:20:
include/linux/time.h:14:8: error: redefinition of ‘struct timespec’
/usr/include/time.h:120:8: note: originally defined here
include/linux/time.h:20:8: error: redefinition of ‘struct timeval’
/usr/include/bits/time.h:31:8: note: originally defined here
include/linux/time.h:74:22: error: conflicting types for ‘mktime’
/usr/include/time.h:193:15: note: previous declaration of ‘mktime’ was here
include/linux/time.h:206:8: error: redefinition of ‘struct tm’
/usr/include/time.h:133:8: note: originally defined here
include/linux/time.h:289:0: warning: "FD_SET" redefined [enabled by default]
/usr/include/sys/select.h:91:0: note: this is the location of the previous definition
include/linux/time.h:290:0: warning: "FD_CLR" redefined [enabled by default]
/usr/include/sys/select.h:92:0: note: this is the location of the previous definition
include/linux/time.h:291:0: warning: "FD_ISSET" redefined [enabled by default]
/usr/include/sys/select.h:93:0: note: this is the location of the previous definition
include/linux/time.h:292:0: warning: "FD_ZERO" redefined [enabled by default]
/usr/include/sys/select.h:94:0: note: this is the location of the previous definition
include/linux/time.h:302:8: error: redefinition of ‘struct itimerspec’
/usr/include/time.h:161:8: note: originally defined here
include/linux/time.h:337:0: warning: "TIMER_ABSTIME" redefined [enabled by default]
/usr/include/bits/time.h:82:0: note: this is the location of the previous definition
In file included from include/linux/mmzone.h:9:0,
from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /home/kernel/Modulos/DropProb/drop_prob.c:20:
include/linux/wait.h:4:0: warning: "WNOHANG" redefined [enabled by default]
/usr/include/bits/waitflags.h:26:0: note: this is the location of the previous definition
include/linux/wait.h:5:0: warning: "WUNTRACED" redefined [enabled by default]
/usr/include/bits/waitflags.h:27:0: note: this is the location of the previous definition
include/linux/wait.h:6:0: warning: "WSTOPPED" redefined [enabled by default]
/usr/include/bits/waitflags.h:30:0: note: this is the location of the previous definition
include/linux/wait.h:7:0: warning: "WEXITED" redefined [enabled by default]
/usr/include/bits/waitflags.h:31:0: note: this is the location of the previous definition
include/linux/wait.h:8:0: warning: "WCONTINUED" redefined [enabled by default]
/usr/include/bits/waitflags.h:32:0: note: this is the location of the previous definition
In file included from /usr/src/linux-headers-3.2.0-37-generic/arch/x86/include/asm/param.h:1:0,
from include/linux/param.h:4,
from include/linux/timex.h:172,
from include/linux/jiffies.h:8,
from include/linux/ktime.h:25,
from include/linux/timer.h:5,
from include/linux/workqueue.h:8,
from include/linux/pm.h:25,
from /usr/src/linux-headers-3.2.0-37-generic/arch/x86/include/asm/apic.h:5,
from /usr/src/linux-headers-3.2.0-37-generic/arch/x86/include/asm/smp.h:13,
from /usr/src/linux-headers-3.2.0-37-generic/arch/x86/include/asm/mmzone_64.h:10,
from /usr/src/linux-headers-3.2.0-37-generic/arch/x86/include/asm/mmzone.h:4,
from include/linux/mmzone.h:815,
from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /home/kernel/Modulos/DropProb/drop_prob.c:20:
include/asm-generic/param.h:7:0: warning: "CLOCKS_PER_SEC" redefined [enabled by default]
/usr/include/bits/time.h:49:0: note: this is the location of the previous definition
In file included from include/linux/signal.h:4:0,
from include/linux/sched.h:73,
from /usr/src/linux-headers-3.2.0-37-generic/arch/x86/include/asm/compat.h:8,
from include/linux/compat.h:18,
from include/linux/ethtool.h:17,
from include/linux/netdevice.h:47,
from include/net/sock.h:50,
from include/linux/tcp.h:211,
from /home/kernel/Modulos/DropProb/drop_prob.c:25:
/usr/src/linux-headers-3.2.0-37-generic/arch/x86/include/asm/signal.h:32:3: error: conflicting types for ‘sigset_t’
/usr/include/sys/select.h:38:20: note: previous declaration of ‘sigset_t’ was here
/home/kernel/Modulos/DropProb/drop_prob.c: In function ‘drop_tcp_hookfn’:
/home/kernel/Modulos/DropProb/drop_prob.c:76:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/home/kernel/Modulos/DropProb/drop_prob.c: At top level:
/home/kernel/Modulos/DropProb/drop_prob.c:31:36: warning: ‘nfho_out’ defined but not used [-Wunused-variable]
make[2]: *** [/home/kernel/Modulos/DropProb/drop_prob.o] Error 1
make[1]: *** [_module_/home/kernel/Modulos/DropProb] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-37-generic'
make: *** [default] Error 2
You're not allowed to include the stdlib.h from the libc library within the kernel (even in modules).
Take a look at this page for the list of basic C library functions which are allowed and how to use them: http://www.kernel.org/doc/htmldocs/kernel-api/libc.html
If you're looking to get the current time in kernel space, you can take a look at the time_to_tm function. It would return the structure tm. Timezone should also be available in a variable called sys_tz, and can be used to adjust the offset and get the local time.

Resources