#include <crt_externs.h>
#define environ (*_NSGetEnviron())
+#include <TargetConditionals.h>
+
#if __DARWIN_UNIX03
#include <pthread.h>
__system(command)
const char *command;
{
+#if TARGET_OS_IPHONE && (TARGET_OS_SIMULATOR || !TARGET_OS_IOS)
+ // Don't abort() on iOS for now
+ LIBC_ABORT("system() is not supported on this platform.");
+#else
pid_t pid, savedpid;
int pstat, err;
struct sigaction ign, intact, quitact;
#endif /* __DARWIN_UNIX03 */
if (!command) { /* just checking... */
+#if TARGET_OS_IPHONE
+ return(0);
+#else
if (access(_PATH_BSHELL, F_OK) == -1) /* if no sh or no access */
return(0);
else
return(1);
+#endif
}
if ((err = posix_spawnattr_init(&attr)) != 0) {
pthread_mutex_unlock(&__systemfn_mutex);
#endif /* __DARWIN_UNIX03 */
return(pstat);
+#endif /* TARGET_OS_IPHONE && (TARGET_OS_SIMULATOR || !TARGET_OS_IOS) */
}
__weak_reference(__system, system);