Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pipe(2) [hpux man page]

pipe(2) 							System Calls Manual							   pipe(2)

NAME
pipe() - create an interprocess channel SYNOPSIS
DESCRIPTION
creates an I/O mechanism called a pipe and returns two file descriptors, fildes[0] and fildes[1]. fildes[0] is opened for reading and fildes[1] is opened for writing. A read-only file descriptor fildes[0] accesses the data written to fildes[1] on a first-in-first-out (FIFO) basis. For details of the I/O behavior of pipes see read(2) and write(2). By default, HP-UX pipes are not STREAMS-based. It is possible to generate the kernel so that all pipes created on a system are STREAMS- based. This can only be done for HP-UX releases 10.0 and later. STREAMS-based FIFOs (created by or are not supported on HP-UX. To generate a kernel that supports STREAMS-based pipes: o STREAMS/UX must be installed. o The module and the driver must be included in the file. (When STREAMS/UX is installed, and are automatically added to the system file.) o The tunable parameter (see streampipes(5)) must be set to 1 in the file. (This is not automatically done when STREAMS/UX is installed.) o The kernel must be generated and the system rebooted. Once this is done, all pipes created by will be STREAMS-based. For more information, see EXAMPLES
The following example uses to implement the command string RETURN VALUE
returns one of the following values: Successful completion. Failure. is set to indicate the error. ERRORS
sets to one of the following error values if the corresponding condition is true. or more file descriptors are currently open. The system file table is full. The file system lacks sufficient space to create the pipe. Could not allocate resources for both Stream heads (STREAMS-based pipes only). SEE ALSO
sh(1), read(2), write(2), popen(3S), privileges(5), streampipes(5), streamio(7). STANDARDS CONFORMANCE
pipe(2)

Check Out this Related Man Page

pipe(2) 							   System Calls 							   pipe(2)

NAME
pipe - create an interprocess channel SYNOPSIS
#include <unistd.h> int pipe(int fildes[2]); DESCRIPTION
The pipe() function creates an I/O mechanism called a pipe and returns two file descriptors, fildes[0] and fildes[1]. The files associated with fildes[0] and fildes[1] are streams and are both opened for reading and writing. The O_NDELAY, O_NONBLOCK, and FD_CLOEXEC flags are cleared on both file descriptors. The fcntl(2) function can be used to set these flags. A read from fildes[0] accesses the data written to fildes[1] on a first-in-first-out (FIFO) basis and a read from fildes[1] accesses the data written to fildes[0] also on a FIFO basis. Upon successful completion pipe() marks for update the st_atime, st_ctime, and st_mtime fields of the pipe. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The pipe() function will fail if: EMFILE More than {OPEN_MAX} file descriptors are already in use by this process. ENFILE The number of simultaneously open files in the system would exceed a system-imposed limit. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), fcntl(2), fstat(2), getmsg(2), poll(2), putmsg(2), read(2), write(2), attributes(5), standards(5), streamio(7I) NOTES
Since a pipe is bi-directional, there are two separate flows of data. Therefore, the size (st_size) returned by a call to fstat(2) with argument fildes[0] or fildes[1] is the number of bytes available for reading from fildes[0] or fildes[1] respectively. Previously, the size (st_size) returned by a call to fstat() with argument fildes[1] (the write-end) was the number of bytes available for reading from fildes[0] (the read-end). SunOS 5.10 23 Apr 2002 pipe(2)
Man Page