malloc(3)
只是提示malloc
是手册第三节的一部分。第三节是库函数所在的地方,相对于第二节手册中系统调用所在的位置。没有malloc(2)
。
例如:
fwrite
是一个库函数,有时写成fwrite(3)
write
是一个系统调用,有时写成write(2)
如果你运行命令:
$ man man
它会告诉你
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 convenâ
tions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
看起来作者只是非常具体。
如果可能存在相同功能的例如 shell 版本,则指定对 man 手册第 3 节的引用通常很有用。例如,man 1 printf
适用于 printf(1) vs. printf(3)。
但在 malloc
的情况下,文档应仅存在于第 3 节。
3
的含义,但我真的很好奇为什么人们这样做。对于对内存管理器感兴趣的人来说,他们知道malloc是什么,而那些不知道malloc是什么的人可能不会理解3
的含义。 - undefined