c - VDSO(7) 和 SYSCALL(2) 之间有什么关系?

标签 c operating-system kernel system-calls

来自this post ,我学会了

  • syscall 是在 x86-64 上进入内核模式的默认方式。
  • 实际上,最近的内核正在实现VDSO

然后我在 http://man7.org/linux/man-pages/man2/syscall.2.html 中查找手册。 :

The first table lists the instruction used to transition to kernel mode (which might not be the fastest or best way to transition to the kernel, so you might have to refer to vdso(7)), the register used to indicate the system call number, the register used to return the sys‐ tem call result, and the register used to signal an error.....

但我缺乏一些必要的知识来理解这些陈述。

VDSO(7) 是否是 syscall(2) 的实现,或者 syscall(2) 将调用>VDSO(7) 完成系统调用

如果不成立,VDSO(7)SYSCALL(2) 之间的关系是什么?

最佳答案

VDSO(7) 不是 syscall(2) 的实现。 如果没有 VDSO(7),系统调用将在用户空间应用程序中运行。在这种情况下将会发生上下文切换。 如果使用 VDSO(7),将运行系统调用而无需上下文切换。 内核通过 vDSO 自动映射到所有用户空间应用程序的地址空间。

关于c - VDSO(7) 和 SYSCALL(2) 之间有什么关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50185684/

相关文章:

c - GetWindowText() 函数未从 INPUT ("EDIT"类型窗口获取/输出任何文本)

c - 将项目从 64 位移植到 32 位时 : float changed to long double gives error for %f

C 解析文件内容

使用 execl 创建的子进程不接受任何输入

c - 我是否正确地在 C 中实现了双向链表的删除节点函数?

.net - <decimal>.ToString ("P3") 在 Win7 和 Windows 10 上返回不同的结果

CMake如何包含头文件以便它们可以与尖括号一起使用?

c - 直接打印到文本视频内存时出现意外输出

linux - 在 linux 内核中读取和写入文件

linux - 应该如何同步定制的内核补丁?