UnixUtils.openPipe

Similar to the UNIX pipe() call, but on modern systems like Linux uses the pipe2() system call, which atomically creates a pipe with the configured flags. The only supported flag currently is FD_CLOEXEC. If for example you want to configure O_NONBLOCK, that must still be done separately with fcntl(). Note This function does *not* take O_CLOEXEC, it takes FD_CLOEXEC as if for fcntl(); these are different on Linux/glibc. Since 2.30

class UnixUtils
static
int
openPipe
(
int[] fds
,
int flags
)

Parameters

fds int[]

Array of two integers

flags int

Bitfield of file descriptor flags, see "man 2 fcntl"

Return Value

Type: int

TRUE on success, FALSE if not (and errno will be set).

Throws

GException on failure.

Meta