implement ffsl and ffsll functions
[musl] / src / process / system.c
index 0aa34cd..8cbdda0 100644 (file)
@@ -1,5 +1,5 @@
 #include <unistd.h>
-#include <fcntl.h>
+#include <stdlib.h>
 #include <signal.h>
 #include <sys/wait.h>
 #include <spawn.h>
@@ -7,13 +7,7 @@
 #include "pthread_impl.h"
 #include "libc.h"
 
-static void dummy_0()
-{
-}
-weak_alias(dummy_0, __acquire_ptc);
-weak_alias(dummy_0, __release_ptc);
-
-extern char **environ;
+extern char **__environ;
 
 int system(const char *cmd)
 {
@@ -40,7 +34,7 @@ int system(const char *cmd)
        posix_spawnattr_setsigdefault(&attr, &reset);
        posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGDEF|POSIX_SPAWN_SETSIGMASK);
        ret = posix_spawn(&pid, "/bin/sh", 0, &attr,
-               (char *[]){"sh", "-c", (char *)cmd, 0}, environ);
+               (char *[]){"sh", "-c", (char *)cmd, 0}, __environ);
        posix_spawnattr_destroy(&attr);
 
        if (!ret) while (waitpid(pid, &status, 0)<0 && errno == EINTR);