diff options
author | rmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d> | 2010-11-27 11:55:39 +0000 |
---|---|---|
committer | rmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d> | 2010-11-27 11:55:39 +0000 |
commit | 13158f86e3904284dce3dad36b64f07414459551 (patch) | |
tree | 12cc7b8d1b808c8c3505bb44cf067bd9ab98b1e6 /mcon/U/d_waitpid.U | |
parent | 194d1db97053d853d5f81c362c461d71c05ea80e (diff) |
Applied mega patch from Christian Biere to greatly improve feature detection
and make a huge step towards better support for cross-compiling.
git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@34 2592e710-e01b-42a5-8df0-11608a6cc53d
Diffstat (limited to 'mcon/U/d_waitpid.U')
-rw-r--r-- | mcon/U/d_waitpid.U | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/mcon/U/d_waitpid.U b/mcon/U/d_waitpid.U index f0e4c53..892eb7d 100644 --- a/mcon/U/d_waitpid.U +++ b/mcon/U/d_waitpid.U @@ -12,7 +12,7 @@ ?RCS: Revision 3.0 1993/08/18 12:08:02 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: -?MAKE:d_waitpid: Inlibc +?MAKE:d_waitpid: Trylink cat i_syswait ?MAKE: -pick add $@ %< ?S:d_waitpid: ?S: This variable conditionally defines HAS_WAITPID if waitpid() is @@ -26,6 +26,22 @@ ?H:. ?LINT:set d_waitpid : see if waitpid exists -set waitpid d_waitpid -eval $inlibc +$cat >try.c <<EOC +#include <sys/types.h> +#$i_syswait I_SYS_WAIT +#ifdef I_SYS_WAIT +#include <sys/wait.h> +#endif +int main(void) +{ + static pid_t ret, pid; + static int status, options; + options |= WNOHANG; + options |= WUNTRACED; + ret |= waitpid(pid, &status, options); + return ret ? 0 : 1; +} +EOC +set d_waitpid +eval $trylink |