Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. static ssize_t procfile_read(struct file *file, char *buffer, size_t length, loff_t *offset) {
  2. static int finished = 0;
  3. int ret = 0;
  4.  
  5. printk(KERN_INFO "procfile_read (/proc/%s) called, len: %zun", procfs_name, length);
  6.  
  7. if (finished) {
  8. printk(KERN_INFO "procfs_read: ENDn");
  9. finished = 0;
  10. return 0;
  11. }
  12.  
  13. finished = 1;
  14. ret = sprintf(buffer, "Hello,world!n");
  15. return ret;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement