Why do some Linux system calls have two man pages?

Aquarius_Girl :

Example:

http://linux.die.net/man/2/socket
http://linux.die.net/man/7/socket

In what way they are different?

Martin Tournoij :

socket(2) provides documentation for the socket() system call; socket(7) describes how to use sockets (in general) on Linux.

man man gives you an overview of sections:

   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]

This list is more or less (though not quite) "universal" across UNIX systems, and the sections you're interested in most of the time. Wikipedia has more documentation on man sections as used in various UNIX systems.

There are many "duplicate" manpages, for example crontab(1) describes /sbin/crontab, and crontab(5) describes the crontab file format.

You can configure which section man uses if you don't explicitly add a section with the MANSECT environment variable; this defaults to 1 n l 8 3 0 2 5 4 9 6 7 on Linux.

For an introduction to each section, look at man <n> intro (ie. man 7 intro).

Bonus tip:
apropos is your friend:

$ apropos crontab
anacrontab (5)       - configuration file for Anacron
crontab (1)          - maintains crontab files for individual users
crontab (1p)         - schedule periodic background work
crontab (5)          - files used to schedule the execution of programs

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Why do some Linux system calls not have a wrapper, but are documented as if they do?

From Dev

Why do some commands have man pages and other commands use --help?

From Dev

Some system call man pages missing

From Dev

Why do some system users have /usr/bin/false as their shell?

From Dev

Why Do Some USB Cables Have Two USB Connectors at the End?

From Dev

Why do some Linux files have a 'd' suffix?

From Dev

Why don't man pages have examples?

From Dev

Why do I have outdated man pages and what can I do about it?

From Dev

Why do some Micro-USB plugs have these two slits/springs on one side and some don't?

From Dev

Why are rmdir and unlink two separate system calls?

From Dev

Why are linux system calls different across architectures

From Dev

Why does `man -k cron` say `vixie-cron (rpm)` for some results, and how do I read those pages?

From Java

Why do x86-64 Linux system calls modify RCX, and what does the value mean?

From Dev

Why do x86-64 Linux system calls work with 6 registers set?

From Dev

Why some .h file have two classes?

From Dev

Why don't shell builtins have proper man pages?

From Dev

Why do system calls use a different stack?

From Dev

Why don't some websites have a .html extension in their pages?

From Dev

Need of some system calls

From Dev

Why do some primitives have byte-codes and some do not?

From Dev

Why do some laptops not have a GPU slot?

From Dev

Why do some routers not have a WAN port?

From Dev

Why do some of functions have pass

From Dev

Why man -k or Apropos cannot find some pages while man -a can?

From Dev

missing man pages of some commands

From Dev

Why do some some files in /etc have a numeric prefix?

From Dev

Why execve and brk(NULL) are always the first two system calls?

From Dev

why do they have a system string and standard string

From Dev

Why do some function calls fail to work without a type application?

Related Related

  1. 1

    Why do some Linux system calls not have a wrapper, but are documented as if they do?

  2. 2

    Why do some commands have man pages and other commands use --help?

  3. 3

    Some system call man pages missing

  4. 4

    Why do some system users have /usr/bin/false as their shell?

  5. 5

    Why Do Some USB Cables Have Two USB Connectors at the End?

  6. 6

    Why do some Linux files have a 'd' suffix?

  7. 7

    Why don't man pages have examples?

  8. 8

    Why do I have outdated man pages and what can I do about it?

  9. 9

    Why do some Micro-USB plugs have these two slits/springs on one side and some don't?

  10. 10

    Why are rmdir and unlink two separate system calls?

  11. 11

    Why are linux system calls different across architectures

  12. 12

    Why does `man -k cron` say `vixie-cron (rpm)` for some results, and how do I read those pages?

  13. 13

    Why do x86-64 Linux system calls modify RCX, and what does the value mean?

  14. 14

    Why do x86-64 Linux system calls work with 6 registers set?

  15. 15

    Why some .h file have two classes?

  16. 16

    Why don't shell builtins have proper man pages?

  17. 17

    Why do system calls use a different stack?

  18. 18

    Why don't some websites have a .html extension in their pages?

  19. 19

    Need of some system calls

  20. 20

    Why do some primitives have byte-codes and some do not?

  21. 21

    Why do some laptops not have a GPU slot?

  22. 22

    Why do some routers not have a WAN port?

  23. 23

    Why do some of functions have pass

  24. 24

    Why man -k or Apropos cannot find some pages while man -a can?

  25. 25

    missing man pages of some commands

  26. 26

    Why do some some files in /etc have a numeric prefix?

  27. 27

    Why execve and brk(NULL) are always the first two system calls?

  28. 28

    why do they have a system string and standard string

  29. 29

    Why do some function calls fail to work without a type application?

HotTag

Archive