fanotify_init on x64
create and initialize fanotify group
sys_fanotify_init(unsigned int flags, unsigned int event_f_flags)
| number | 300 (0x12c) |
|---|---|
| abi | common |
| kconfig | CONFIG_FANOTIFY |
| family | fanotify see the whole family on x64 |
| entry point | sys_fanotify_init |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | fanotify_init(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 300, the syscall number |
rdi | unsigned int flags |
rsi | unsigned int event_f_flags |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- x86 338
- arm64 262
- arm 367
- riscv64 262
- ia32 338
- x32 1073742124
- loongarch64 262
- ppc64 323
- ppc 323
- s390x 332
- mips64 5295
- mipsn32 6300
- mipso32 4336
- alpha 494
- arc 262
- blackfin 371, removed in 4.17
- cris 342, removed in 4.17
- csky 262
- hexagon 262
- ia64 1323, removed in 6.7
- m68k 337
- metag 262, removed in 4.17
- microblaze 368
- nds32 262, removed in 5.18
- nios2 262
- openrisc 262
- parisc 322
- score 262, removed in 4.17
- sh 337
- sparc 329
- sparc64 329
- tilegx 262, removed in 4.17
- tilepro 262, removed in 4.17
- xtensa 320
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/fanotify_init