2

In our development team we are modifying a driver for our own needs. We need it to execute an external binary (user space application) in the linux filesystem.

Is it correct to do this? What would be the best way to call a binary from inside the linux kernel? system(), popen()?

Thanks for your answer.

4
  • 1
    binary is a kernel module or user space application???? need more clarification on external binary. Commented Jul 16, 2012 at 11:32
  • I hope the this will help you. Commented Jul 16, 2012 at 11:56
  • 2
    Well, I found this, I think it may help me: ibm.com/developerworks/linux/library/l-user-space-apps/… Commented Jul 16, 2012 at 12:10
  • 1
    @fazineroso that's correct; you should write that as an answer! Commented Jul 16, 2012 at 12:30

1 Answer 1

5

Well, I found a very well explained solution to my question.

char *argv[] = { "/usr/bin/logger", "help!", NULL }; static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/bin:/usr/sbin:/usr/bin", NULL }; return call_usermodehelper( argv[0], argv, envp, UMH_WAIT_PROC ); 

I need to use the call_usermodehelper system calls. The example is self-explanatory. Source: http://www.ibm.com/developerworks/linux/library/l-user-space-apps/index.html

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.