]> pd.if.org Git - pdclib.old/blobdiff - platform/example/functions/stdlib/system.c
* platform/example is now a "stub" platform - it should compile anywhere, but
[pdclib.old] / platform / example / functions / stdlib / system.c
index fb3c40685da55e10c0d832efe6d1228f3f6c99ad..2cf7534b2faf99671408ab044ac56dcb399fe630 100644 (file)
@@ -8,40 +8,19 @@
 
 #include <stdlib.h>
 
-/* This is an example implementation of system() fit for use with POSIX kernels.
+/* This is a stub implementation of getenv
 */
 
-#include <unistd.h>
-#include <sys/wait.h>
-
 int system( const char * string )
 {
-    char const * const argv[] = { "sh", "-c", (char const * const)string, NULL };
-    if ( string != NULL )
-    {
-        int pid = fork();
-        if ( pid == 0 )
-        {
-            execve( "/bin/sh", (char * * const)argv, NULL );
-        }
-        else if ( pid > 0 )
-        {
-            while( wait( NULL ) != pid );
-        }
-    }
     return -1;
 }
 
 #ifdef TEST
-/* TODO: Work around the following undef */
-#undef SEEK_SET
 #include <_PDCLIB_test.h>
 
-#define SHELLCOMMAND "echo 'SUCCESS testing system()'"
-
 int main( void )
 {
-    TESTCASE( system( SHELLCOMMAND ) );
     return TEST_RESULTS;
 }