Hi Jovi,
/* this is the data variable where we receive the data written by sysctl
interface */
static char event_handler[256];
static struct ctl_table_header *handler_header_table;
static struct ctl_table my_event_table[] = {
{
.ctl_name = KERN_EVENT_HANDLER, /* this needs to be
defined in linux/sysctl.h */
.procname = "event_handler", /*
this is the name by which the file will be created in /proc/sys/kernel */
.data = &event_handler,
/* data variable */
.maxlen = sizeof(event_handler),
.mode = 0644,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string,
},
{ },
};
static struct ctl_table my_root_table[] = {
{
.ctl_name = CTL_KERN, /* create
entry in the /proc/sys/kernel */
.procname = "kernel",
.maxlen = 0,
.mode = 0555,
.child = my_event_table, /* here
we specify our child table */
},
{ },
};
static int __init my_handler_init(void)
{
.................
.................
.................
handler_header_table = register_sysctl_table(my_root_table);
/* register the entry */
if (!handler_header_table)
return -ENOMEM;
.................
.................
.................
}
static void __exit my_handler_exit(void)
{
.................
.................
.................
unregister_sysctl_table(handler_header_table);
.................
.................
.................
}
Thanks and Regards,
Prasad.
On Sat, Aug 9, 2008 at 8:34 AM, Jovi Jia <jovi.jia@gmail.com> wrote:
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Kamalesh Babulal | [BUG] Linux 2.6.25-rc2 - Kernel Ooops while running dbench |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Paul Jackson | Re: cpuset-remove-sched-domain-hooks-from-cpusets |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Steven Rostedt | Re: -rt scheduling: wakeup bug? |
| David Miller | Re: [GIT]: Networking |
