On Oct 28, 2008, at 5:44 PM, gerbilio wrote: > > I am trying to write a kernel module that will call the getpid() > routine. However, it doesn't seem to be defined in the kernel > headers--though it is defined in /usr/include. I'm using the > following make file for kernel modules: > > obj-m += a4.o > > all: > make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules > > clean: > make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean > > and it keeps flagging getpid() as not defined. > > Also, getpid() is supposed to need the following: > > #include <sys/types.h> > #include <unistd.h> > > but it can't find these header files in the kernel headers. > > What's the story? What do I have to do to get this to work?
unistd.h is a standard UNIX include file. It's not directly tied to the Linux kernel, but is more of a loose contract between all UNIX- like kernels. So unistd.h won't be with the kernel headers, 'cause it isn't directly part of the kernel. Registered Linux Addict #431495 http://profile.xfire.com/mrstalinman | John 3:16! http://www.fsdev.net/ | http://lordsauron.wordpress.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [EMAIL PROTECTED] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
