fanotify_mark on x64
add, remove, or modify an fanotify mark on a filesystem object
sys_fanotify_mark(int fanotify_fd, unsigned int flags, u64 mask, int fd, const char *pathname)
| number | 301 (0x12d) |
|---|---|
| abi | common |
| kconfig | CONFIG_FANOTIFY |
| family | fanotify see the whole family on x64 |
| entry point | sys_fanotify_mark |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | fanotify_mark(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 301, the syscall number |
rdi | int fanotify_fd |
rsi | unsigned int flags |
rdx | u64 mask |
r10 | int fd |
r8 | const char *pathname |
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 339
- arm64 263
- arm 368
- riscv64 263
- ia32 339
- x32 1073742125
- loongarch64 263
- ppc64 324
- ppc 324
- s390x 333
- mips64 5296
- mipsn32 6301
- mipso32 4337
- alpha 495
- arc 263
- blackfin 372, removed in 4.17
- cris 343, removed in 4.17
- csky 263
- hexagon 263
- ia64 1324, removed in 6.7
- m68k 338
- metag 263, removed in 4.17
- microblaze 369
- nds32 263, removed in 5.18
- nios2 263
- openrisc 263
- parisc 323
- score 263, removed in 4.17
- sh 338
- sparc 330
- sparc64 330
- tilegx 263, removed in 4.17
- tilepro 263, removed in 4.17
- xtensa 321
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/fanotify_mark