--- Deepak Joshi <deepak_cins@xxxxxxxxxxx> wrote: > #include <linux/module.h> > #include <linux/kernel.h> > #include <linux/wait.h> > #include <linux/sched.h> > #include <linux/list.h> > MODULE_LICENSE("GPL"); > > > > static DECLARE_WAIT_QUEUE_HEAD (my_queue); > int init_module(void) > { > struct task_struct *my_task ; > my_task = find_task_by_pid(1477); > DECLARE_WAITQUEUE(wait, my_task); > my_task->state = TASK_UNINTERRUPTIBLE ; > init_waitqueue_entry( &wait, my_task); > add_wait_queue( &my_queue , &wait); > sleep_on(&my_queue); > interruptible_sleep_on(&my_queue); > schedule( ); > return 0; > } > > > void cleanuo_module() > { > printk("Bye"); > wake_up( &my_queue ); > } > > > > > Hi everyone, > > In the above module I want to sleep the process > having > pid 1477 ( which is mpg123 player in my case in wait > queue ). Instead of sleeping the process with the > given pid it is hanging insmod command. so plz tell > me > what is wrong in the above code. > I tried the same module without schedule() function and instead of TASK_UNINTERRUPTIBLE I used TASK_INTERRUPTIBLE but i am getting the same result. and the output of ps command gives D status for insmod command. I think it is sleeping the current process i.e insmod sleep.o only. But i want to sleep the process of which i gave the pid. plz reply me where i am wrong. Thanks and regrads, Deepak Joshi. ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/