mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
Saner seq_file example adapted from kernel doc
This commit is contained in:
@@ -11,9 +11,17 @@ cat 'lkmc_seq_file'
|
||||
# => 2
|
||||
|
||||
cat 'lkmc_seq_file'
|
||||
# => 3
|
||||
# => 4
|
||||
# => 5
|
||||
# => 0
|
||||
# => 1
|
||||
# => 2
|
||||
|
||||
# TODO understand, why does this print nothing?
|
||||
dd if='lkmc_seq_file' bs=1 count=2 skip=2
|
||||
dd if='lkmc_seq_file' bs=1 count=2 skip=0 status=none
|
||||
# => 0
|
||||
dd if='lkmc_seq_file' bs=1 count=4 skip=0 status=none
|
||||
# => 0
|
||||
# => 1
|
||||
dd if='lkmc_seq_file' bs=1 count=2 skip=2 status=none
|
||||
# => 1
|
||||
dd if='lkmc_seq_file' bs=4 count=1 skip=0 status=none
|
||||
# => 0
|
||||
# => 1
|
||||
|
||||
@@ -3,6 +3,8 @@ set -ex
|
||||
insmod /seq_file_single.ko
|
||||
cd /sys/kernel/debug
|
||||
cat 'lkmc_seq_file_single'
|
||||
# => abcd
|
||||
dd if='lkmc_seq_file_single' bs=1 skip=2
|
||||
# => ab
|
||||
# => cd
|
||||
dd if='lkmc_seq_file_single' bs=1 count=3 skip=1
|
||||
# => b
|
||||
# => c
|
||||
|
||||
Reference in New Issue
Block a user