#include <unistd.h>
a). 管道系统调用
int pipe(int fd[2])
b). read, write系统调用
/* Read NBYTES into BUF from FD. Return the
number read, -1 for errors or 0 for EOF.
This function is a cancellation point and therefore not marked with
__THROW. */
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur;
/* Write N bytes of BUF to FD. Return the number written, or -1.
This function is a cancellation point and therefore not marked with
__THROW. */
extern ssize_t write (int __fd, __const void *__buf, size_t __n) __wur;
c). 各种错误定义
EAGAIN
EWOULDBLOCK
ECHILD等
本文介绍了Unix/Linux系统中的管道创建系统调用pipe(),以及文件描述符操作的read()与write()系统调用。此外,还列举了一些常见的错误代码如EAGAIN、EWOULDBLOCK和ECHILD等。

530

被折叠的 条评论
为什么被折叠?



