63 #if defined (__APPLE__) 64 #include <crt_externs.h> 67 #if defined (unix) || defined (__CYGWIN__) 68 static int do_system ();
76 #if defined(HAVE_SYSTEM) 79 #elif defined(NO_EXEC) 91 #if defined (unix) || defined (__CYGWIN__) 94 return do_system (ptr,
s);
116 #if defined (unix) && !defined (__CYGWIN__) && !defined(__rtems__) 117 #if !defined(__APPLE__) 118 extern char **environ;
123 static char ***p_environ = &environ;
125 #if defined(__APPLE__) 126 static char ***p_environ = _NSGetEnviron();
139 argv[2] = (
char *)
s;
142 if ((pid = _fork_r (ptr)) == 0)
144 _execve (
"/bin/sh", argv, *p_environ);
151 int rc = _wait_r (ptr, &status);
154 status = (status >> 8) & 0xff;
160 #if defined (__CYGWIN__) 171 argv[2] = (
char *)
s;
174 if ((pid = vfork ()) == 0)
181 char *sh =
getenv (
"SH_PATH");
184 execve (sh, argv, environ);
191 int rc = wait (&status);
194 status = (status >> 8) & 0xff;
int system(s) _CONST char *s
int _system_r(ptr, s) struct _reent *ptr
char * getenv(const char *s)