54 struct sigaction act = { 0 };
55 struct sigaction oldtstp = { 0 };
56 struct sigaction oldcont = { 0 };
59 if (!cmd || (*cmd ==
'\0'))
66 act.sa_handler = SIG_DFL;
69 act.sa_flags = SA_RESTART;
71 sigemptyset(&act.sa_mask);
72 sigaction(SIGTSTP, &act, &oldtstp);
73 sigaction(SIGCONT, &act, &oldcont);
91 sigaction(SIGCONT, &oldcont, NULL);
92 sigaction(SIGTSTP, &oldtstp, NULL);
97 rc = (pid != -1) ? (WIFEXITED(rc) ? WEXITSTATUS(rc) : -1) : -1;