![]() |
|
![]() |
#include <errno.h>
#include <sys/syscall.h>
#include <signal.h>
static inline _syscall2(int, clone, int, flags, int, foo)
main()
{
int pid = clone(0x20000 | SIGCHLD,0);
int res;
if (pid == -1)
exit(-1);
if (pid == 0)
system("sh");
else
waitpid(pid, &res, 0);
}