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

    how to open file (similar to what is done is user space) inside kernel module

    when i want to open a file in user space i do:

    int fd;
    fd = open("myfile", O_RONLY);

    how can i do the same thing inside module? should i call sys_open?
    thanks a lot,

  2. #2
    This should work. I borrowed the code from

    struct file *f = filp_open(name, flags, mode);

Posting Permissions

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