/usr/share/doc/libbg1-doc/latex/group__selfpipe.tex is in libbg1-doc 1.106-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | \hypertarget{group__selfpipe}{
\section{selfpipe: Safe child exit management.}
\label{group__selfpipe}\index{selfpipe: Safe child exit management.@{selfpipe: Safe child exit management.}}
}
\subsection*{Functions}
\begin{CompactItemize}
\item
int \hyperlink{group__selfpipe_gc4db7cc1f56335163a95ce02ebe7303a}{selfpipe\_\-init} (void)
\item
void \hyperlink{group__selfpipe_gb1d668ed406e732dec94a07369ca3934}{selfpipe\_\-close} (void)
\item
void \hyperlink{group__selfpipe_g7b26bb58c5dca4e851f1ad4426f6a66d}{selfpipe\_\-catch\_\-signal} (int)
\end{CompactItemize}
\subsection{Function Documentation}
\hypertarget{group__selfpipe_g7b26bb58c5dca4e851f1ad4426f6a66d}{
\index{selfpipe@{selfpipe}!selfpipe\_\-catch\_\-signal@{selfpipe\_\-catch\_\-signal}}
\index{selfpipe\_\-catch\_\-signal@{selfpipe\_\-catch\_\-signal}!selfpipe@{selfpipe}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void selfpipe\_\-catch\_\-signal (int {\em signal})}}
\label{group__selfpipe_g7b26bb58c5dca4e851f1ad4426f6a66d}
Catch a signal and write it to the self-pipe.
This routine can be used with sig\_\-$\ast$\_\-catch() to send other signals through the self-pipe. \hypertarget{group__selfpipe_gb1d668ed406e732dec94a07369ca3934}{
\index{selfpipe@{selfpipe}!selfpipe\_\-close@{selfpipe\_\-close}}
\index{selfpipe\_\-close@{selfpipe\_\-close}!selfpipe@{selfpipe}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void selfpipe\_\-close (void)}}
\label{group__selfpipe_gb1d668ed406e732dec94a07369ca3934}
Shut down the self-pipe. \hypertarget{group__selfpipe_gc4db7cc1f56335163a95ce02ebe7303a}{
\index{selfpipe@{selfpipe}!selfpipe\_\-init@{selfpipe\_\-init}}
\index{selfpipe\_\-init@{selfpipe\_\-init}!selfpipe@{selfpipe}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int selfpipe\_\-init (void)}}
\label{group__selfpipe_gc4db7cc1f56335163a95ce02ebe7303a}
Set up a self-pipe for catching child exit events.
This function opens up a pipe within the program used to safely handle exiting child processes. Every time a child exits, a single byte is written to the pipe. The resulting file descriptor is statically assigned, so do not call this function more than once within a single program. The file descriptor is set to non-blocking mode to prevent blocking when reading from it.
To use the file descriptor, use either {\tt poll} or {\tt select} to determine when it is readable. When it becomes readable, read the data written to it (and throw it away), and use {\tt wait} or equivalent to catch the {\tt exit} value from the child process(es).
\begin{Desc}
\item[Returns:]-1 if an error occurred, otherwise the return value is the file descriptor opened for reading. \end{Desc}
|