5 /* system( const char * )
7 This file is part of the Public Domain C Library (PDCLib).
8 Permission is granted to use, modify, and / or redistribute at will.
11 /* This is an example implementation of system() fit for use with POSIX kernels.
17 int system( const char * string )
19 char * const argv[] = { "sh", "-c", (char * const)string, NULL };
25 execve( "/bin/sh", argv, NULL );
29 while( wait( NULL ) != pid );
36 #include <_PDCLIB_test.h>
37 #include <_PDCLIB_config.h>
39 #define SHELLCOMMAND "echo 'SUCCESS testing system()'"
44 TESTCASE( system( SHELLCOMMAND ) );