diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2012-06-08 21:57:36 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2012-06-08 21:57:36 +0000 |
commit | b379932fc0f836f9f3f5ac89ef7f6cd38377dff8 (patch) | |
tree | 18db9ddd684d6278a8a49b3850dc7c757c7e8348 /wait.h | |
parent | 3e4da6f5b3dfa3b4ff9caabcbc673d721a1a9bf0 (diff) | |
download | src-b379932fc0f836f9f3f5ac89ef7f6cd38377dff8.tar.gz src-b379932fc0f836f9f3f5ac89ef7f6cd38377dff8.zip |
Import the 6-May-2012 release of the "Portable" BSD make tool (from NetBSD).vendor/NetBSD/bmake/20120606
Submitted by: sjg@juniper.net
Notes
Notes:
svn path=/vendor/NetBSD/bmake/dist/; revision=236769
svn path=/vendor/NetBSD/bmake/20120606/; revision=236770; tag=vendor/NetBSD/bmake/20120606
Diffstat (limited to 'wait.h')
-rw-r--r-- | wait.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/wait.h b/wait.h new file mode 100644 index 000000000000..7408d15fb070 --- /dev/null +++ b/wait.h @@ -0,0 +1,81 @@ +/* NAME: + * wait.h - compensate for what vendors leave out + * + * AUTHOR: + * Simon J. Gerraty <sjg@crufty.net> + */ +/* + * RCSid: + * $Id: wait.h,v 1.6 2002/11/26 07:53:06 sjg Exp $ + * + * @(#)Copyright (c) 1994, Simon J. Gerraty. + * + * This is free software. It comes with NO WARRANTY. + * Permission to use, modify and distribute this source code + * is granted subject to the following conditions. + * 1/ that the above copyright notice and this notice + * are preserved in all copies and that due credit be given + * to the author. + * 2/ that any changes to this code are clearly commented + * as such so that the author does not get blamed for bugs + * other than his own. + * + * Please send copies of changes and bug-fixes to: + * sjg@crufty.net + */ + +#include <sys/wait.h> + +#ifdef sun386 +# define UNION_WAIT +# define WEXITSTATUS(x) ((&x)->w_retcode) +# define WTERMSIG(x) ((&x)->w_termsig) +# define WSTOPSIG(x) ((&x)->w_stopsig) +# define HAVE_WAIT4 +#endif + +#ifndef WAIT_T +# ifdef UNION_WAIT +# define WAIT_T union wait +# define WAIT_STATUS(x) (x).w_status +# else +# define WAIT_T int +# define WAIT_STATUS(x) x +# endif +#endif + +#ifndef WEXITSTATUS +# define WEXITSTATUS(_X) (((int)(_X)>>8)&0377) +#endif +#ifndef WSTOPPED +# define WSTOPPED 0177 +#endif +#ifndef WSTOPSIG +# define WSTOPSIG(x) WSTOPPED +#endif + +#ifdef UNION_WAIT +#ifndef WSET_STOPCODE +#define WSET_STOPCODE(x, sig) ((&x)->w_stopsig = (sig)) +#endif +#ifndef WSET_EXITCODE +#define WSET_EXITCODE(x, ret, sig) ((&x)->w_termsig = (sig), (&x)->w_retcode = (ret)) +#endif +#else +#ifndef WSET_STOPCODE +#define WSET_STOPCODE(x, sig) ((x) = ((sig) << 8) | 0177) +#endif +#ifndef WSET_EXITCODE +#define WSET_EXITCODE(x, ret, sig) ((x) = (ret << 8) | (sig)) +#endif +#endif + +#ifndef HAVE_WAITPID +# ifdef HAVE_WAIT4 +# define waitpid(pid, statusp, flags) wait4(pid, statusp, flags, (char *)0) +# else +# ifdef HAVE_WAIT3 +# define waitpid(pid, statusp, flags) wait3(statusp, flags, (char *)0) +# endif +# endif +#endif |