在哪里可以获得 UNIX 系统调用列表?

发布于 2024-08-29 07:58:53 字数 54 浏览 3 评论 0原文

UNIX 上的系统调用列表在哪里?

这不是我最初的问题,但无论如何还是谢谢:)

Where are some lists of system calls on UNIX?

This wasn't my original question, but thanks anyway :)

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

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

发布评论

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

评论(8

凌乱心跳 2024-09-05 07:58:53

man 2 syscalls

除此之外,您还可以查看 /usr/include/sys/syscall.h (在我的系统上仅 #includes /usr/include/bits/syscall.h)。这是在 libc 构建时从内核系统调用列表生成的。

您还可以 grep Linux 内核源代码来查找 SYSCALL_DEFINE。 (我不是 BSD 专家,但我认为 FreeBSD 中的等效项是 SYSCALL_MODULE)

man 2 syscalls

Aside from that, you can look in /usr/include/sys/syscall.h (which on my system merely #includes /usr/include/bits/syscall.h). That's generated at libc build time from kernel syscall list.

You can also grep the Linux kernel source for SYSCALL_DEFINE. (I'm not a BSD expert, but I think the equivalent in FreeBSD is SYSCALL_MODULE)

神经暖 2024-09-05 07:58:53

阅读Fine手册。对于系统调用,请从

man 2 intro

这就是我开始使用 UNIX 的方式。那时我们还没有华丽的互联网......

Read The Fine Manual. For system calls, start with

man 2 intro

That's how I got started in UNIX. We didn't have no fancy internet back then ...

寄人书 2024-09-05 07:58:53

对于官方、权威的 IEEE Std。 1003.1 / 单一 UNIX 规范 (UNIX 2004) 联机帮助页,请参阅:

完整的函数列表(系统接口) 可以在“系统接口”下或链接处找到。我还想借此机会宣传我的开发/ Coding Search 自定义搜索引擎,其中包括并严重偏向单一 UNIX 规范 / IEEE Std。 1003.1。例如,标准搜索 fopen关闭unix等都进行了促销,以确保权威文档的结果位于最前面。在查询前面添加“man”会极大地提高结果的权重,有利于 IEEE 标准。 1003.1 手册页,如 手动查找免费man inttypes.h 等,尽管大多数查询应该支持 IEEE Std。 1003.1,即使不添加“man”(如果不是,请输入 错误查询并告诉我)。

For the official, authoritative IEEE Std. 1003.1 / Single UNIX Specification (UNIX 2004) manpages, see:

A full list of functions (system interfaces) may be found under "System Interfaces" or at the link. I would also like to use this as an opportunity to plug my Development / Coding Search custom search engine, which includes and is heavily biased towards the Single UNIX Specification / IEEE Std. 1003.1. For example, a standard search for fopen, close, unix, etc. have promotions taken out to ensure that results from the authoritative documentation are at the very top. Adding "man" in front of a query heavily weights the result in favor of the IEEE Std. 1003.1 man page as in man find, man free, man inttypes.h, etc., although most queries should favor IEEE Std. 1003.1 even without adding "man" (if it isn't, type bad query and tell me).

壹場煙雨 2024-09-05 07:58:53

到底是什么操作系统? Man 第 2 节记录了系统调用,但是完整的系统调用会根据您使用的 UNIX 风格而有所不同。

POSIX.1 定义了一组标准的操作系统接口,但是没有操作系统仅限于这些接口。一般来说,BSD 和 SYSV 风格的语义略有不同。然而,现在所谓的系统调用实际上是准库函数。

唯一正确的答案需要特定的安装和文件检查

 /usr/include/syscall.h

What operating system, exactly? Man section 2 documents the syscalls, however the complete set varies depending upon what flavor of UNIX you are on.

POSIX.1 defines a standard set of operating system interfaces, however no operating system limits itself to just those. In general you have the BSD and SYSV flavors which have slightly different semantics. However, nowdays the supposed syscalls are actually quasi library functions.

The only TRUE answer requires a specific installation and examination of the file

 /usr/include/syscall.h
痞味浪人 2024-09-05 07:58:53

在 FreeBSD 中,查找系统调用的最佳位置是文件 /usr/src/sys/sys/syscall.h。这是在 FreeBSD 9.0 上

In FreeBSD, the best place to look for what the system calls are is in the file /usr/src/sys/sys/syscall.h. This is on FreeBSD 9.0

望她远 2024-09-05 07:58:53

你真正应该做的就是拿起一本 W. Richard Stevens 所著的《Unix 环境中的高级编程》。这是关于如何对类 Unix 操作系统进行编程的经典书籍。这本书很老了,MacOs/iPhoneOs 是一种不同的最传统的 Unix 风格,但是这本书是学习基础知识和了解 API 应该如何使用的好方法。请访问亚马逊查看

What you should really do is pick up a copy of "Advanced Programming in the Unix Environment" by W. Richard Stevens. This is the classic book on how to program Unix-like OS's. The book is old and MacOs/iPhoneOs are a different most traditional flavors of Unix, but the book is a great way to learn the basics and get a feel for how the API's are supposed to be used. Check it out at Amazon

倾其所爱 2024-09-05 07:58:53

在大多数环境中,ls /usr/man/2/ 就可以解决问题,尽管它可能是 /usr/local/man/usr/share/ man 甚至 /usr/local/share/man

编辑:甚至可能有一个 MANPATH 环境变量将您指向正确的位置。

In most environments, ls /usr/man/2/ will do the trick, although it could be /usr/local/man or /usr/share/man or even /usr/local/share/man.

EDIT: There might even be a MANPATH environment variable pointing you to the right place.

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