From 9b4c1984fc2cb04de0b4d62749cc1f8eabf26c6f Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Fri, 6 Jul 2018 09:26:42 +0100 Subject: [PATCH] Improve file operation intro Done while answering: https://stackoverflow.com/questions/3290590/what-options-do-we-have-for-communication-between-a-user-program-and-a-linux-ker/51206012#51206012 --- README.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.adoc b/README.adoc index 16a059a..e9e2656 100644 --- a/README.adoc +++ b/README.adoc @@ -3687,12 +3687,13 @@ Sources: Bibliography: https://stackoverflow.com/questions/5970595/how-to-create-a-device-node-from-the-init-module-code-of-a-linux-kernel-module/45531867#45531867 - === Pseudo files ==== File operations -File operations are the main method of userland driver communication. `struct file_operations` determines what the kernel will do on filesystem system calls of <>: +File operations are the main method of userland driver communication. `struct file_operations` determines what the kernel will do on filesystem system calls of <>. + +This example illustrates the most basic system calls: `open`, `read`, `write`, `close` and `lseek`: .... /fops.sh @@ -3919,7 +3920,7 @@ This example gets an anonymous inode via <> from a debugfs entry by using Reads to that inode return the sequence: `1`, `10`, `100`, ... `10000000`, `1`, `100`, ... -Bibliography: https://stackoverflow.com/questions/4508998/what-is-an-anonymous-inode-in-linux +Bibliography: https://stackoverflow.com/questions/4508998/what-is-an-anonymous-inode-in-linux/44388030#44388030 ==== netlink sockets