NAME

kjb_system - KJB library version of system(2)

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_system(const char *command);

DESCRIPTION

On the surface, this function is similar to the unix system(2) routine except that we follow the KJB error reporting conventions, we ensure that the user's PATH variable is searched (it usually is anyway), the success/failure of the effort is returned, and there is slightly better error reporting on failure. In addition, the stderr of the executed command is added to error messages. In addition, we create a process to handle the requests which are fed to it via a pipe to reduce forking. This strategy has not been analyzed recently as to whether there is a worthwhile performance gain. The function kjb_system_2() can be used as if this is not desired. (The function kjb_system() is implemented using kjb_system_2(). If the command succeeds, then NO_ERROR is returned, otherwise ERROR is returned with an error message being set. This routine can fail if there is a problem initiating the command, or if the command itself fails.

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_2 , kjb_exec , kjb_waitpid , kjb_waitpid2 , 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