系统调用实现 [英] System calls Implementation
问题描述
如果用户应用程序进行系统调用,则会触发软件中断/异常.如何查看用于生成软件中断的源代码?
If a user application makes a system call , a software interrupt/exception is triggered. How can I see the source code for generating a software interrupt ?
推荐答案
在 Linux汇编中进行了解释如何操作.并且您应该阅读Wikipedia 系统调用页(以及有关简介(2)& syscalls(2)手册页.另请参见此答案和此一.还要查看 Gnu Libc & musl-libc 源代码.还学习使用strace
找出由给定命令或进程进行的系统调用.
It is explained in Linux Assembly Howto. And you should read wikipedia syscall page (and also about VDSO), and also intro(2) & syscalls(2) man pages. See also this answer and this one. Look also inside Gnu Libc & musl-libc source code. Learn also to use strace
to find out which syscalls are made by a given command or process.
另请参阅与系统相关的调用约定和应用程序二进制接口规范.对于x86-64,它是此处.
See also the calling conventions and Application Binary Interface specification relevant to your system. For x86-64 it is here.
这篇关于系统调用实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!