Re: module

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

 



On 9/4/05, raja <vnagaraju@xxxxxxxxxxxx> wrote:
> Hi,
>    I am writing a module to find out the number of running processes.And
> i am trying to access the run queue.But while compiling it is showing an
> error.I will give the code.
> 
> #include <linux/init.h>
> #include <linux/module.h>
> #include <linux/sched.h>
> 
> MODULE_LICENSE("GPL");
> MODULE_DESCRIPTION("RUN QUEUES");
> 
> static int __init init_module3(void);
> static void __exit exit_module3(void);
> 
> static int __init init_module3()
> {
>     printk("Hello Module3\n");
>     struct runqueue *rq;
>     rq = (struct runqueue *)this_rq();

this_rq() is a #define in sched.c. Not sure why you would think this
should build at all... I'm not sure how you'd get to the run-queue
from a module, or why you'd want to, since runqueues (the per-cpu
struct that this_rq() accesses) is static to sched.c.

Thanks,
Nish

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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