In Linux, how do I get man pages for C functions rather than for bash commands?

man 2 bind

You need a result from a different section of the manual! Man searches various sections for the information you want. As devnull lists below, the number indicates which section to search.

Incidentally, bind is a system call, not a C library function. System calls (kernel calls) are in section 2 of the manual, library functions are in section 3.

man man will tell you how to use the man command!


Saying man man would tell you:

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]

For example, man 1 printf would show the manual for the printf shell utility, while man 3 printf would show the manual for printf() in libc.

(When in doubt, say man -k foobar. It will provide a list of man pages with foobar as the regex.)

Tags:

Linux

C

Manpage