Skip to content

Fix aarch64 syscall numbers for inotify_add_watch and inotify_rm_watch#1492

Open
igravious wants to merge 1 commit into
jart:masterfrom
igravious:fix-aarch64-inotify-syscalls
Open

Fix aarch64 syscall numbers for inotify_add_watch and inotify_rm_watch#1492
igravious wants to merge 1 commit into
jart:masterfrom
igravious:fix-aarch64-inotify-syscalls

Conversation

@igravious

Copy link
Copy Markdown

Summary

Fix incorrect aarch64 Linux syscall numbers for inotify_add_watch and inotify_rm_watch. These were set to the placeholder value 4095 instead of the correct Linux syscall numbers 27 and 28.

Problem

On aarch64 Linux, calling inotify_add_watch() or inotify_rm_watch() would fail because the syscall numbers were incorrectly set to 4095 (placeholder for "not implemented") instead of the actual Linux syscall numbers.

The Fix

Changed the arm_linux parameter in the .scall macro from 4095 to the correct values:

  • inotify_add_watch: 409527 (0x1b)
  • inotify_rm_watch: 409528 (0x1c)

Also updated the .syscon constants in __NR_inotify_*.S to match.

Verification

Verified against official Linux kernel syscall tables:

  • Linux kernel: include/uapi/asm-generic/unistd.h
  • arm64.syscall.sh confirms: 27 and 28 for these syscalls
  • inotify_init1 already had the correct value (26), confirming this was an oversight, not intentional

Files Changed

  • libc/sysv/calls/sys_inotify_add_watch.S
  • libc/sysv/calls/sys_inotify_rm_watch.S
  • libc/sysv/consts/__NR_inotify_add_watch.S
  • libc/sysv/consts/__NR_inotify_rm_watch.S

The aarch64 Linux syscall numbers were incorrectly set to 4095 (placeholder)
instead of the correct values:
- inotify_add_watch: 27 (was 4095)
- inotify_rm_watch: 28 (was 4095)

These syscalls have been supported on aarch64 Linux since the architecture
was introduced. The inotify_init1 syscall already had the correct value (26),
confirming this was an oversight during the initial aarch64 port.

Verified against Linux kernel syscall tables:
- https://gpages.juszkiewicz.com.pl/syscalls-table/syscalls.html
- https://arm64.syscall.sh/
@github-actions github-actions Bot added the libc label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant