2 * Copyright 2004-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
14 #include <errno_private.h>
15 #include <syscall_utils.h>
19 system(const char *command
)
24 const char *argv
[] = { "/bin/sh", "-c", command
, NULL
};
27 thread_id thread
= load_image(argc
, argv
, (const char **)environ
);
29 RETURN_AND_SET_ERRNO_TEST_CANCEL(thread
);
31 resume_thread(thread
);
35 while ((result
= waitpid(thread
, &exitStatus
, 0)) < 0
36 && errno
== B_INTERRUPTED
) {
37 // waitpid() was interrupted by a signal, retry...