Where can I obtain a list of UNIX system calls?

2019-02-05 04:02发布

Where are some lists of system calls on UNIX?

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

8条回答
【Aperson】
2楼-- · 2019-02-05 04:41

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)

查看更多
该账号已被封号
3楼-- · 2019-02-05 04:47

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

查看更多
我命由我不由天
5楼-- · 2019-02-05 04:54

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).

查看更多
We Are One
6楼-- · 2019-02-05 04:57

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

查看更多
迷人小祖宗
7楼-- · 2019-02-05 04:59

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
查看更多
登录 后发表回答