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.
13 /* This is an example implementation of system() fit for use with POSIX kernels.
19 int system( const char * string )
21 char const * const argv[] = { "sh", "-c", (char const * const)string, NULL };
27 execve( "/bin/sh", (char * * const)argv, NULL );
31 while( wait( NULL ) != pid );
38 #include <_PDCLIB_test.h>
40 #define SHELLCOMMAND "echo 'SUCCESS testing system()'"
44 TESTCASE( system( SHELLCOMMAND ) );