LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   schedule_work Problem (https://www.linuxquestions.org/questions/programming-9/schedule_work-problem-851343/)

Vermidias 12-20-2010 06:09 AM

schedule_work Problem
 
I want to run
ret = call_usermodehelper(path, argv, envp, 0);
in
int schedule_work();
but i dont really get how does that work. has anyone a little example for me?
all I could found was this:

workqueue.c ( http://lxr.free-electrons.com/source/kernel/workqueue.c )
...
2527 int schedule_work(struct work_struct *work)
2528 {
2529 return queue_work(system_wq, work);
2530 }
2531 EXPORT_SYMBOL(schedule_work);
...

workqueue.h ( http://lxr.free-electrons.com/source...ux/workqueue.h )
...
330 extern int schedule_work(struct work_struct *work);
...

repo 01-16-2011 11:38 AM

Glad you got it solved, could you perhaps share the solution?

Kind regards

Vermidias 01-17-2011 08:03 AM

Quote:

static void sysfs_add_func(struct work_struct *w)
{ call_usermodehelper(path, argv, envp, 0); }
...
static DECLARE_WORK(sysfs_add_work, sysfs_add_func);
...
in Function X --> schedule_work(&sysfs_add_work);
example for schedule_work:
http://lxr.free-electrons.com/source/mm/slub.c


All times are GMT -5. The time now is 12:33 PM.