The type of functions to be called when a UNIX fd watch source
triggers.
%FALSE if the source should be removed
the fd that triggered the event
the IO conditions reported on @fd
user data passed to g_unix_fd_add()
A Unix pipe. The advantage of this type over `int[2]` is that it can
be closed automatically when it goes out of scope, using `g_auto(GUnixPipe)`,
on compilers that support that feature.
A pair of file descriptors, each negative if closed or not yet opened.
The file descriptor with index %G_UNIX_PIPE_END_READ is readable.
The file descriptor with index %G_UNIX_PIPE_END_WRITE is writable.
Close both ends of the pipe, unless they have already been closed or
stolen. Any errors are ignored: use g_unix_pipe_close() or g_clear_fd()
if error-handling is required.
This function is async-signal safe if @error is %NULL and each member
of @fds are either negative or a valid open file descriptor.
As a result, it is safe to call this function or use `g_auto(GUnixPipe)`
(on compilers that support it) in a signal handler or a
#GSpawnChildSetupFunc, as long as those conditions are ensured to be true.
See [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7)) for more details.
This function preserves the value of `errno`.
a #GUnixPipe
Close one of the ends of the pipe and set the relevant member of @fds
to `-1` before returning, equivalent to g_clear_fd().
Like g_close(), if closing the file descriptor fails, the error is
stored in both %errno and @error. If this function succeeds,
%errno is undefined.
This function is async-signal safe if @error is %NULL and the relevant
member of @fds is either negative or a valid open file descriptor.
This makes it safe to call from a signal handler or a #GSpawnChildSetupFunc
under those conditions.
See [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7)) for more details.
To close both file descriptors and ignore any errors, use
g_unix_pipe_clear() instead.
%TRUE on success
A pair of file descriptors
One of the ends of the pipe
Return one of the ends of the pipe. It remains owned by @self.
This function is async-signal safe (see [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a
signal handler or a #GSpawnChildSetupFunc.
This function preserves the value of `errno`.
a non-negative file descriptor owned by @self, which must not
be closed by the caller, or a negative number if the corresponding
end of the pipe was already closed or stolen
A pair of file descriptors
One of the ends of the pipe
Open a pipe. This is the same as g_unix_open_pipe(), but uses the
#GUnixPipe data structure.
%TRUE on success
A pair of file descriptors
Flags to pass to g_unix_open_pipe(), typically `O_CLOEXEC`
Return one of the ends of the pipe. It becomes owned by the caller,
and the file descriptor in the data structure is set to `-1`,
similar to g_steal_fd().
This function is async-signal safe (see [`signal(7)`](man:signal(7)) and
[`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a
signal handler or a #GSpawnChildSetupFunc.
This function preserves the value of `errno`.
a non-negative file descriptor, which becomes owned by the
caller and must be closed by the caller if required, or a negative
number if the corresponding end of the pipe was already closed or stolen
A pair of file descriptors
One of the ends of the pipe
Mnemonic constants for the ends of a Unix pipe.
The readable file descriptor 0
The writable file descriptor 1