Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道,在 Linux 中使用 _syscall0 到 _syscall6 来处理不同数量的参数的原因是什么。仅使用 _syscall6 并让调用代码为未使用的参数传入空值是否存在任何安全/性能问题?
需要减少所需的寄存器副本数量并提高性能。
每个参数都需要从用户的 ABI 转移到内核内部的参数传递约定中。
此外,某些此类系统调用的行为与地址参数不同。但是在少数拱门上需要这种转换。