| Top | Description | ||||
#include <tubo.h> pid_t Tubo_threads (void (*fork_function) (void *),void *fork_function_data,int *stdin_fd,void (*stdout_f) (void *stdout_data, void *stream, int childFD),void (*stderr_f) (void *stderr_data, void *stream, int childFD),void (*tubo_done_f) (void *),void *user_function_data,int reap_child,gboolean check_valid_ansi_sequence);
The functionality is similar to the glib function g_spawn_async_with_pipes() except that all pipe setup and monitoring is taken care of. The calling function only has to provide the functions with which to process the input/output of the remote process.
pid_t Tubo_threads (void (*fork_function) (void *),void *fork_function_data,int *stdin_fd,void (*stdout_f) (void *stdout_data, void *stream, int childFD),void (*stderr_f) (void *stderr_data, void *stream, int childFD),void (*tubo_done_f) (void *),void *user_function_data,int reap_child,gboolean check_valid_ansi_sequence);
|
pointer to function to execute after forking. This is executed by the main calling process. |
|
pointer to data to be sent to fork_function, or NULL. |
|
pointer for file descriptor for stdin, or NULL |
|
pointer to thread safe function to process stdout, or NULL. |
|
pointer to thread safe function to process stderr, or NULL. |
|
pointer to function to execute when remote process has terminated. Execution of this function does not mean all pipe data has been processed yet. |
|
pointer to data to be sent to stdout_f, stderr_f
and tubo_done_f (yeah, same data block for all three). |
|
flag to reap child. Set to TRUE to have the child process reaped.
If this is set to FALSE, then the user is responsible to reap the child
(i.e., with waitpid()) to avoid leaving a zombie. |
|
flag to filter out non printer safe output. If set to TRUE, output to stdout/stderr will be checked for escape sequences that are not valid on a printer terminal and if any such sequence is found, the child will be terminated without much more ado. |
Returns : |
pid of spawned process (child pid). This pid is not the pid of the program being executed. It is a process that ensures pipes will remain open while pipe output is still to be read. To send a TERM signal to the actual process which is executing the remote command, send a USR1 signal to child_pid. To send a KILL to the actual process which is executing the remote command, send a USR1 signal to child_pid. |