Anonymous Pipeとは?
anonymous pipeは、読み取り端と書き込み端を持ち、filesystem上に名前を持たない、kernelが管理するバッファです。関連するプロセス間、通常は親とそれがforkした子との間で共有され、これによりshellはあるコマンドを次のコマンドへつなぎます。書き込み端に書かれたデータは、読み取り端を読む側へ順序どおりに流れます。
なぜ重要か
pipeこそが、あるツールの出力を次のツールへそのまま流すshellのコマンド連結を成り立たせています。これを理解すると、bufferingや、読み取り側が壊れると書き込み側が止まりうる理由が分かります。
関連ガイド
What Is a Named Pipe?A named pipe is a special file on disk that lets two unrelated processes communicate by one writing bytes int…
What Is a File Descriptor Table?A file descriptor table is the per-process list that maps small integer descriptors to the open files, socket…
What Is SIGPIPE?SIGPIPE is the signal sent to a process that writes to a pipe or socket whose reading end has already been cl…