Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.sao.ru/hq/sts/linux/book/c_marshall/subsubsection2_18_4_2_2.html
Дата изменения: Unknown Дата индексирования: Sat Sep 11 20:52:07 2010 Кодировка: Поисковые слова: п п п п п п п п п п п п п п п п п п п |
int pipe(int fd[2]) - creates a pipe and returns two file descriptors, fd[0], fd[1]. fd[0] is opened for reading, fd[1] for writing.
pipe() returns 0 on success, -1 on failure and sets errno accordingly.
The standard programming model is that after the pipe has been set up, two (or more) cooperative processes will be created by a fork and data will be passed using read() and write().
Pipes opened with pipe() should be closed with close(int fd).
Example: Parent writes to a child
An example of piping in a C program is plot.c and subroutines and is detailed in Appendix .