
私はdebian8(jessie)を使用しており、openのマニュアルページを見つけに行きました。代わりに、私は警告を受けました。
$ man 3 open
No manual entry for open in section 3
See 'man 7 undocumented' for help when manual pages are not available.
マンページ-devパッケージをインストールしましたが、開くことができるプログラマーのマンページ(man 3)はどこにありますか?
答え1
man 2 open
代わりにCライブラリインタフェースが必要ですman 3 open
。実際にはそうではmanpages-dev
ありませんmanpage-dev
。man 3 open
Perlのマニュアルページがあります。
# Show the corresponding source groff file
man -w 2 open
/usr/share/man/man2/open.2.gz
# Show which package this file belongs to
dpkg -S /usr/share/man/man2/open.2.gz
manpages-dev: /usr/share/man/man2/open.2.gz
# Or use dlocate to show which package this file belongs to
dlocate /usr/share/man/man2/open.2.gz
manpages-dev: /usr/share/man/man2/open.2.gz
答え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 conventions), e.g.
man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
セクション2ではシステムコールを説明し、セクション3ではライブラリルーチンについて説明します。セクション2では、システムコールラッパーであるライブラリルーチンも説明します。
答え3
その理由をより明確にするために、マンページはセクション2にあります。これは、システムコール(Cライブラリではなくカーネルの一部としてほぼ直接実装されている)であるためです。
これらの区別は、特に現在のライブラリ関数である以前のシステムコールの場合は少しランダムに見えます(forkは現在複製されているラッパーですが、まだセクション2にあります)。通常、パート3を最初にチェックし、見つからないか関連性がないようであれば、パート2を試してください。また、セクション2の一部の機能は、通常のプログラム(getdents、gettidなど)から呼び出すべきではない内部機能、または廃止されたLinux関連の機能です。
また、manpages-posix-dev パッケージをインストールして Linux 関連情報を含めるのではなく、移植可能な観点から書かれたマニュアルページセットを取得することもできます。このパッケージのC関数に提供されたすべてのマンページはセクション3pにあります。
答え4
この場合、次のいずれかのコマンドを使用して、このマンページ名を含むすべての利用可能なページの完全なリストを表示すると便利です。
$ man -k ^open$
$ apropos -r ^open$
$ man -f open
$ whatis open
結果は同じです:
open (1) - start a program on a new virtual terminal (VT).
open (2) - open and possibly create a file or device
または、既存のマンページの内容をすべて確認して、必要なものを決定してください。
$ man -a open