Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Run user space application from kernel space


    Hi,

    I am trying to run user space application from a kernel module.

    I am using call_usermodehelper() API for this. I could run user space application from the kernel module and open() ,read(), write() syscalls are executing but printf() and system() is not executing.

    What could be the reason that 'printf' is not working. Do i need any changes to get this working.

    Please reply.

    Thanks

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    13,161
    You will need to use printk instead of printf and its ilk. IE, you cannot do anything to read/write standard input/output streams in the kernel, at least as I understand it.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Quote Originally Posted by Rubberman View Post
    You will need to use printk instead of printf and its ilk. IE, you cannot do anything to read/write standard input/output streams in the kernel, at least as I understand it.
    Hi,
    Thanks for your reply.

    Printk() is using in a driver files.How can i use printk() in C application?
    read() write() open() calls are working.


    Thanks

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •