为什么它们在 x86-64 Linux 内核源代码中的系统调用编号在 334 和 424 之间存在差距?
Why is their a gap in syscall numbering between 334 and 424 in the x86-64 Linux kernel source?
在 arch/x86/entry/syscalls/syscall_64.tbl
中,系统调用从 0 到 334 编号,然后在系统调用编号恢复到 424 之前有一个间隙。源的相关部分如下所示:
...
333 common io_pgetevents sys_io_pgetevents
334 common rseq sys_rseq
# don't use numbers 387 through 423, add new calls after the last
# 'common' entry
424 common pidfd_send_signal sys_pidfd_send_signal
425 common io_uring_setup sys_io_uring_setup
...
由于在编号 439 之后添加了新的系统调用(如评论中所述),为什么会存在这个大的编号差距?
目的似乎是跨架构同步系统调用编号 (source)。
查看 git blame
for the commented line in that file,可以找到此提交消息:
arch: add split IPC system calls where needed
The IPC system call handling is highly inconsistent across architectures,
some use sys_ipc, some use separate calls, and some use both. We also
have some architectures that require passing IPC_64 in the flags, and
others that set it implicitly.
For the addition of a y2038 safe semtimedop() system call, I chose to only
support the separate entry points, but that requires first supporting
the regular ones with their own syscall numbers.
The IPC_64 is now implied by the new semctl/shmctl/msgctl system
calls even on the architectures that require passing it with the ipc()
multiplexer.
I'm not adding the new semtimedop() or semop() on 32-bit architectures,
those will get implemented using the new semtimedop_time64() version
that gets added along with the other time64 calls.
Three 64-bit architectures (powerpc, s390 and sparc) get semtimedop().
在 arch/x86/entry/syscalls/syscall_64.tbl
中,系统调用从 0 到 334 编号,然后在系统调用编号恢复到 424 之前有一个间隙。源的相关部分如下所示:
...
333 common io_pgetevents sys_io_pgetevents
334 common rseq sys_rseq
# don't use numbers 387 through 423, add new calls after the last
# 'common' entry
424 common pidfd_send_signal sys_pidfd_send_signal
425 common io_uring_setup sys_io_uring_setup
...
由于在编号 439 之后添加了新的系统调用(如评论中所述),为什么会存在这个大的编号差距?
目的似乎是跨架构同步系统调用编号 (source)。
查看 git blame
for the commented line in that file,可以找到此提交消息:
arch: add split IPC system calls where needed
The IPC system call handling is highly inconsistent across architectures, some use sys_ipc, some use separate calls, and some use both. We also have some architectures that require passing IPC_64 in the flags, and others that set it implicitly.
For the addition of a y2038 safe semtimedop() system call, I chose to only support the separate entry points, but that requires first supporting the regular ones with their own syscall numbers.
The IPC_64 is now implied by the new semctl/shmctl/msgctl system calls even on the architectures that require passing it with the ipc() multiplexer.
I'm not adding the new semtimedop() or semop() on 32-bit architectures, those will get implemented using the new semtimedop_time64() version that gets added along with the other time64 calls. Three 64-bit architectures (powerpc, s390 and sparc) get semtimedop().