在哪里可以获得 UNIX 系统调用列表?
UNIX 上的系统调用列表在哪里?
这不是我最初的问题,但无论如何还是谢谢:)
Where are some lists of system calls on UNIX?
This wasn't my original question, but thanks anyway :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
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)
阅读Fine手册。对于系统调用,请从
这就是我开始使用 UNIX 的方式。那时我们还没有华丽的互联网......
Read The Fine Manual. For system calls, start with
That's how I got started in UNIX. We didn't have no fancy internet back then ...
对于官方、权威的 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).
到底是什么操作系统? Man 第 2 节记录了系统调用,但是完整的系统调用会根据您使用的 UNIX 风格而有所不同。
POSIX.1 定义了一组标准的操作系统接口,但是没有操作系统仅限于这些接口。一般来说,BSD 和 SYSV 风格的语义略有不同。然而,现在所谓的系统调用实际上是准库函数。
唯一正确的答案需要特定的安装和文件检查
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
在 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
你真正应该做的就是拿起一本 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
在大多数环境中,
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.http://docs.cs.up.ac.za/编程/asm/derick_tut/syscalls.html
http://www.metasploit .com/users/opcode/syscalls.html
http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html
http://www.metasploit.com/users/opcode/syscalls.html