Re: linux/module.h does not exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



He he tried what you said.
I wont 2 cents :)

It did not worked
Following is new program

#include <linux/kernel.h>
#include <sys/syscalls.h>
#include <linux/module.h>
extern void *sys_table[];
asmlinkage int(*main_sys_exit)(int);
asmlinkage int alt_exit_function(int err_code)
{
        printk("Sys_exit called with err_code=%d\n",err_code);
        return main_sys_exit(err_code);
}

int init_module()
{
        main_sys_exit=sys_table[__NR_exit];
        sys_table[__NR_exit]=alt_exit_function;
}
void cleanup_module()
{
        sys_table[__NR_exit]=main_sys_exit;
}



Following is way I compiled
gcc -I /usr/include/ -Wall -DMODULE -D__KERNEL__ -DLINUX -c sample2.c
and following are the errors
http://pastebin.com/u3mPhfUf

Then I compiled it also in following way
gcc -I /usr/src/linux-headers-2.6.28-11-generic/include/linux/ -Wall
-DMODULE -D__KERNEL__ -DLINUX -c sample2.c

and got following errors
http://pastebin.com/HzX0DBz1
.
So 2 cents :)
any how this is the original link where I was trying the code
page 48 left hand column
https://docs.google.com/fileview?id=0B2A4urYOAf6POTI1OGE1MjctM2UyMC00OGUzLThlNDUtZDBhOWFjY2Y1MDUz&hl=en

Any more suggestions.
-- 
Tapas
http://mightydreams.blogspot.com
http://wiki.xensource.com/xenwiki/Xen_on_4_app_servers

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux