mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
netlink: move docs to README
This commit is contained in:
36
README.adoc
36
README.adoc
@@ -3920,6 +3920,42 @@ Reads to that inode return the sequence: `1`, `10`, `100`, ... `10000000`, `1`,
|
||||
|
||||
Bibliography: https://stackoverflow.com/questions/4508998/what-is-an-anonymous-inode-in-linux
|
||||
|
||||
==== netlink sockets
|
||||
|
||||
Netlink sockets offer a socket API for kernel / userland communication:
|
||||
|
||||
....
|
||||
/netlink.sh
|
||||
echo $?
|
||||
....
|
||||
|
||||
Outcome: the test passes:
|
||||
|
||||
....
|
||||
0
|
||||
....
|
||||
|
||||
Sources:
|
||||
|
||||
* link:kernel_module/netlink.c[]
|
||||
* link:kernel_module/netlink.h[]
|
||||
* link:kernel_module/user/netlink.c[]
|
||||
* link:rootfs_overlay/netlink.sh[]
|
||||
|
||||
Launch multiple user requests in parallel to stress our socket:
|
||||
|
||||
....
|
||||
insmod /netlink.ko sleep=1
|
||||
for i in `seq 16`; do /netlink.out & done
|
||||
....
|
||||
|
||||
TODO: what is the advantage over `read`, `write` and `poll`? https://stackoverflow.com/questions/16727212/how-netlink-socket-in-linux-kernel-is-different-from-normal-polling-done-by-appl
|
||||
|
||||
Bibliography:
|
||||
|
||||
* https://stackoverflow.com/questions/3299386/how-to-use-netlink-socket-to-communicate-with-a-kernel-module
|
||||
* https://en.wikipedia.org/wiki/Netlink
|
||||
|
||||
=== Linux kernel asynchronous APIs
|
||||
|
||||
In this section we will document asynchronous APIs of Linux kernel, especially kthread-related scheduled events.
|
||||
|
||||
Reference in New Issue
Block a user