3 /* system( const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 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 * const argv[] = { "sh", "-c", (char const * const)string, NULL };
25 execve( "/bin/sh", (char * * const)argv, NULL );
29 while( wait( NULL ) != pid );
36 /* TODO: Work around the following undef */
38 #include <_PDCLIB_test.h>
40 #define SHELLCOMMAND "echo 'SUCCESS testing system()'"
44 TESTCASE( system( SHELLCOMMAND ) );