syscall的设计原理是什么?

发布于 2024-11-17 21:35:01 字数 48 浏览 1 评论 0原文

Linux 如何确定某些功能应归类为系统调用,而其他功能可以直接在用户空间中实现?

How does Linux determine that some functionality should be classified as syscall while others can be directly implemented in user space?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼眸印温柔 2024-11-24 21:35:01

当必须在内核中进行处理时,就会执行系统调用 - 这意味着它需要升级权限或访问内核私有资源。通常,如果某些内容可以保存在用户空间中,那么它就在那里完成。当事情转移到内核处理时,可能会存在性能原因,因此需要系统调用来执行。另一方面是用户空间和内核空间之间的转换相对昂贵。

A system call is performed when processing must occur in the Kernel - meaning that it requires escalated privileges or access to kernel-private resources. Typically if something can be kept in userspace, it's done there. There could be performance reasons when things are moved to kernel processing, and therefore would require a system call to perform. Another facet is that the transition between userspace and kernelspace is relatively expensive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文