Home > News > Content
Pipeline Rules Of Reading And Writing
- May 13, 2016 -

Pipe ends can be used to describe word FD[0] and FD[1] to describe, is in need of attention, both ends of the pipe is fixed to the task. That can only read, described by the word FD[0] said, calling it read the pipe end; it can only be used to write on the other end, described by the word FD[1] to represent, says its written for pipe end. If you attempt to read data from the pipe write-side, or write data to a read the pipe end will result in an error. File I/O functions can be used for pipes in General, like close, read, write, and so on. From pipeline in the read data: If pipeline of wrote end not exists, is think has read to has data of end, read function returns of read out byte number for 0; Dang pipeline of wrote end exists Shi, if requests of byte number is greater than PIPE_BUF, is returns pipeline in the existing of data byte number, if requests of byte number not is greater than PIPE_BUF, is returns pipeline in the existing data byte number (at, pipeline in the data volume is less than requests of data volume); or returns requests of byte number (at, Pipeline in the amount not less than the amount of data requested). Note: (PIPE_BUF defined in include/Linux/limits.h, different kernel versions may vary. Posix.1 requires at least 512 PIPE_BUF bytes, redhat7.2 to 4096)..