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

    user space pthread application read a variable changed by kernel


    If I define a new variable in kernel (e.g. sched.c) codes,
    I want a user space thread (pthread) can read the value of this variable.

    What is the best way (faster and low overhead) to implement it,
    either creating a new /proc file or defining some system calls?



  2. #2
    Linux Guru
    Join Date
    Dec 2013
    Victoria, B.C. Canada
    Without knowing what you are planning on doing I'd say using the proc filesystem is easier. Changes to the kernel require you to recompile it and reboot to see the changes. That includes adding a system call. On the other hand you can write to the proc filesystem using an lkm which can be dynamically loaded.

Posting Permissions

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