* Copyright (c) 1988 The Regents of the University of California.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)system.c 5.10 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
if (!command
) /* just checking... */
omask
= sigblock(sigmask(SIGCHLD
));
execl(_PATH_BSHELL
, "sh", "-c", command
, (char *)NULL
);
intsave
= signal(SIGINT
, SIG_IGN
);
quitsave
= signal(SIGQUIT
, SIG_IGN
);
pid
= waitpid(pid
, (int *)&pstat
, 0);
(void)signal(SIGINT
, intsave
);
(void)signal(SIGQUIT
, quitsave
);
return(pid
== -1 ? -1 : pstat
.w_status
);