NAME

kjb_waitpid2 - KJB library process waiting

SYNOPSIS

#include "l/l_sys_lib.h"

Example compile flags (system dependent):
  -DLINUX_X86_64 -DLINUX_X86_64_OPTERON  -DGNU_COMPILER 
   -I/home/kobus/include
   -L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
  -lKJB                               -lfftw3  -lgsl -lgslcblas -ljpeg  -lSVM -lstdc++                    -lpthread -lSLATEC -lg2c    -lacml -lacml_mv -lblas -lg2c      -lncursesw 


int kjb_waitpid2
(
	pid_t pid,
	int *exit_argument_ptr,
	int *termination_signal_ptr
);

DESCRIPTION

The routine kjb_waitpid2 waits until a specified child process terminates or a signal is received (by the process doing the waiting). Unlike the typical system waitpid(), if the process only changes state, this routine continues waiting. Once the child process terminates, then NO_ERROR is returned, and the argument passed to exit2() is put into the location exit_argument_ptr, or the signal causing termination is put into the location termination_signal_ptr. Only one of these two is relavent. The other is set to NOT_SET. If the waiting process is interrupted during the wait, then INTERRUPTED is returned instead.

RETURNS

If the child process terminates, then NO_ERROR is returned, and either *exit_argument_ptr or *termination_signal_ptr is set. If a signal interrupted the wait, then INTERRUPTED is returned. ERROR may be returned if there is a problem with the call.

NOTES

See check_child/check_child2 for similar capability that has an immediate return.

RELATED

kjb_waitpid, check_child, check_child2, terminate_child_process

DISCLAIMER

This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.

AUTHOR

Kobus Barnard

DOCUMENTER

Kobus Barnard

SEE ALSO

is_interactive , get_user_id , get_group , kjb_get_env , create_system_command_process , kjb_system , kjb_system_2 , kjb_exec , kjb_waitpid , check_child , check_child2 , reset_cleanup_for_fork , add_cleanup_function , kjb_cleanup , kjb_cleanup_for_abort , kjb_optional_abort , kjb_abort , kjb_exit , kjb_exit_2 , terminate_child_process , process_is_alive , get_idle_time , get_temp_file_name , kjb_fork