How to call execve() form a function under linux2.4.x/drivers/char/?

Jul 13, 2007 3 Replies

Hi all,



I am writing a driver for GPIO device, gpio_int.c, and I put it under / linux-2.4.x/drivers/char. I need to call execve() in a function, v_hwrb_timer_handler() in gpio_int.c:



void v_hwrb_timer_handler() { ... execve(path, argv, argc); ... }



When I make it, I get the result:



drivers/char/char.o(.text+0xe9c4): In function `v_hwrb_timer_handler': : undefined reference to `execve' make[1]: *** [linux] Error 1 make[1]: Leaving directory `/home/uClinux-dist/linux-2.4.x' make: *** [linux] Error 1



Can anyone present ideas for it?



Sincerely,



Ken



On Fri, 13 Jul 2007 00:43:22 -0700, Ken rearanged some electrons and created:

You may need to include .

execve() is not supported inside the kernel. It is only available in user space.

Read this:

formatting link

regards

Wolfgang

Thank you for your advices, this problem has been solved by add a macro before #KERNEL_CALL #include

regards,

Ken

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required