SHARE
TWEET

Untitled

a guest Jan 20th, 2020 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct file_operations proc_fops = {
  2.     .owner  = THIS_MODULE,
  3.     .read   = proc_read,
  4.     .write  = proc_write,
  5. };
  6.  
  7. int proc_create(void)
  8. {
  9.     struct proc_dir_entry *proc_entry = proc_create("my_proc",
  10.                                                     0666,
  11.                                                     NULL,
  12.                                                     &proc_fops);
  13.     if (!proc_entry) {
  14.       printk(KERN_ERR "proc filesystem can't be created");
  15.       return -ENOMEM;
  16.     }
  17.  
  18.     return 0;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top