NAME
pipe_internal, pipecoe, pipenb, pipenbcpe - create a pipe
SYNOPSIS
#include <limb/djbunix.h>
int pipe_internal(int *fds, unsigned int flags) int pipecoe(int *fds) int pipenb(int *fds) int pipenbcoe(int *fds)
DESCRIPTION
The pipe_internal
() creates a pipe and places two file descriptors in fds[0]
and fds[1]
, the reading and writing ends, respectively, of the pipe.
The created pipe will have its O_NONBLOCK and O_CLOEXEC flags cleared,
unless specified (as a bitwise OR value) in flags
.
The pipecoe
() macro is similar to pipe_internal
() with O_CLOEXEC set.
The pipenb
() macro is similar to pipe_internal
() with O_NONBLOCK set.
The pipenbcoe
() macro is similar to pipe_internal
() with both O_CLOEXEC
| O_NONBLOCK set.
RETURN VALUE
These functions return 0 on success. Otherwise they return -1 and set errno
to
indicate the error.
ERRORS
These functions may fail and set errno
for any of the errors specified for
pipe2(3) when available, pipe(3), coe(3) and ndelay_on(3) when not.