Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static ssize_t procfile_read(struct file *file, char *buffer, size_t length, loff_t *offset) {
- static int finished = 0;
- int ret = 0;
- printk(KERN_INFO "procfile_read (/proc/%s) called, len: %zun", procfs_name, length);
- if (finished) {
- printk(KERN_INFO "procfs_read: ENDn");
- finished = 0;
- return 0;
- }
- finished = 1;
- ret = sprintf(buffer, "Hello,world!n");
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement