我有一个作业,需要使用 UNIX 中的一些系统调用(例如 mktime() 和 fnmatch())来完成一些操作。我们只得到了用于查找函数的手册页的名称。
现在,这对于任务的目的来说是很好的。但将来当我进行 UNIX 编程时,我可能不知道确切的名称(如果不先知道它的名称,我永远不会知道 fnmatch 的存在)。
所以问题是:如何获得所有 UNIX 系统函数的综合列表?我真的不在乎它是否已分类或排序(尽管这会很好),但我想让列表包含描述,以便可以搜索。这样,当我需要某个功能时,我可以进行一些搜索来找到潜在的候选者,然后我可以指导他们找到确切的用法。
I have an assignment where I need to use some system calls in UNIX, like mktime() and fnmatch(), to complete some operations. We're given only the names of the man pages to look up to find the functions.
Now, this is fine for the purpose of the assignment. But in the future when I do UNIX programming, I may not know the exact name (I never would have known fnmatch exists without knowing its name first).
So the question is: how can I get a comprehensive list of ALL UNIX system functions? I really don't care if it's categorized or sorted (though it would be nice), but I'd like to have the list include the descriptions so it's searchable. That way when I need a function, I can do a few searches to locate potential candidates, then I can man them to find the exact usage.
发布评论
评论(3)
还有一个有用的实用程序,称为“apropos”
There's also a useful utility called "apropos"
系统调用记录在
man
文档的第 2 节中。根据您的 Unix 版本,您应该能够在man
数据目录中找到这些页面。在 Linux 上,此目录为
/usr/share/man/man2
;您的 Unix 版本可能有所不同。另外,man man
应该告诉您其他部分的内容。System calls are documented in section 2 of the
man
documentation. Depending on your version of Unix, you should be able to find these pages in theman
data directory.On Linux, this directory is
/usr/share/man/man2
; your version of Unix may differ. Alsoman man
should tell you what is in the other sections.我曾经保存过《单一 UNIX 规范第 3 版授权指南》的 部分内容的打印副本 随处可见 - 该表显示了各种不同标准中呼叫的可用性,这对于支持多个目标非常有用。
I used to keep a printed copy of part of "The Authorized Guide to Version 3 of the Single UNIX Specification" lying around - the table shows availability of calls in a variety of different standards, which was extremely useful for supporting multiple targets.