Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_pipe() create a pipe (os/2)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _pipe()                 Create a Pipe (OS/2)

 #include   <fcntl.h>
 #include   <errno.h>
 #include   <io.h>

 int _pipe(phandles, psize, textmode);
 int *phandles;                 Pointer to read/write handles
                                    (phandles[0] and phandles[1])
 unsigned psize;                Size of pipe in bytes
 int textmode;                  O_BINARY or O_TEXT

    _pipe() creates an OS/2 pipe, which is a structure used to
    transfer data between programs. A pipe is much like a temporary
    file in that it can be read from or written to using a file
    descriptor and a file pointer, as well as the standard
    input/output functions.

    A pipe can be written to and read from by different programs at
    different rates; it is frequently used between a parent and child
    process. For that reason, _pipe() returns two pipe handles, one
    for reading (phandles[0]) and one for writing (phandles[1]).
    One pipe handle is passed to the child process through shared
    memory in most cases. Use these handles as you would handles for a
    file.

    textmode specifies the translation mode of the pipe; you can
    select either text translation with the constant O_TEXT or binary
    translation with O_BINARY.

    Note that closing a pipe's handles destroys the pipe.

    Returns:    0 for success; -1 otherwise.

    Notes:      This function only works under OS/2.

 Portability:   OS/2 only. Not supported by the ANSI standard.


See Also: cwait() _pclose() _popen()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson