inotify_rm_watch on x64
remove an existing watch from an inotify instance
sys_inotify_rm_watch(int fd, __s32 wd)
| number | 255 (0xff) |
|---|---|
| abi | common |
| kconfig | CONFIG_INOTIFY_USER |
| family | inotify see the whole family on x64 |
| entry point | sys_inotify_rm_watch |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | inotify_rm_watch(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 255, the syscall number |
rdi | int fd |
rsi | __s32 wd |
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 293
- arm64 28
- arm 318
- riscv64 28
- ia32 293
- x32 1073742079
- loongarch64 28
- ppc64 277
- ppc 277
- s390x 286
- mips64 5245
- mipsn32 6249
- mipso32 4286
- alpha 446
- arc 28
- blackfin 293, removed in 4.17
- cris 293, removed in 4.17
- csky 28
- frv 293, removed in 4.17
- hexagon 28
- ia64 1279, removed in 6.7
- m32r 293, removed in 4.17
- m68k 286
- metag 28, removed in 4.17
- microblaze 293
- mn10300 294, removed in 4.17
- nds32 28, removed in 5.18
- nios2 28
- openrisc 28
- parisc 271
- score 28, removed in 4.17
- sh 292
- sparc 156
- sparc64 156
- tilegx 28, removed in 4.17
- tilepro 28, removed in 4.17
- xtensa 278
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/inotify_rm_watch