NAME
kjb_system - KJB library version of system(2)
SYNOPSIS
#include "l/l_sys_lib.h"
Example compile flags (system dependent):
-DLINUX_386 -DLINUX_386_P4
-I/home/kobus/include
-L/home/kobus/load/linux_386_p4 -L/usr/local/lib -L/usr/lib
-lKJB -llapack -lblas -lg2c -lXext -lX11
int kjb_system(const char *command);
DESCRIPTION
For simple system commands, this routine is similar to the unix system(2)
routine except that the user's PATH variable is searched, and the
success/failure of the effort is returned. 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.
The above does not apply to complex requests. The implementation used to get
the above features is not viable in the case of multiple commands, piped
commands, redirected commands, and commands with arguments in single quotes
(eg sed). Thus if the string in "command" contains a pipe symbol, a single
quote, a semi-colon, or a redirection symbol, then kjb_system simply uses
system(2) instead.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTOR
Kobus Barnard
SEE ALSO
is_interactive
,
get_user_id
,
get_group
,
kjb_get_env
,
create_system_command_process
,
kjb_exec
,
kjb_waitpid
,
kjb_waitpid2
,
check_child
,
check_child2
,
add_cleanup_function
,
kjb_cleanup
,
kjb_cleanup_for_abort
,
kjb_abort
,
kjb_exit
,
kjb_exit_2
,
terminate_child_process
,
process_is_alive
,
get_idle_time
,
get_temp_file_name
,
kjb_fork