如何在Linux中获取C函数的手册页而不是bash命令的手册?

问题描述 投票:20回答:2

如何在Linux中获取C函数的手册页而不是shell命令手册?

例如,当我输入man bind时,我得到shell命令绑定的man而不是socket绑定C函数的man。

c linux man
2个回答
30
投票
man 2 bind

您需要手册不同部分的结果!人搜索各个部分以获取所需信息。如下面的devnull列表,该数字表示要搜索的部分。

顺便说一下,bind是系统调用,而不是C库函数。系统调用(内核调用)在本手册的第2部分中,库函数在第3节中。

man man会告诉你如何使用man命令!


25
投票

man man会告诉你:

SYNOPSIS
   man ... [[section] page ...] ...
   The table below shows the section numbers of the manual followed by the
   types of pages they contain.

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous  (including  macro  packages  and  conventions), e.g.
       man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

例如,man 1 printf将显示printf shell实用程序的手册,而man 3 printf将显示libc中的printf()手册。

(当有疑问时,请说man -k foobar。它将提供一个以foobar作为正则表达式的手册页列表。)

© www.soinside.com 2019 - 2024. All rights reserved.