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_setregid.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_setregid.U')
-rw-r--r-- | mcon/U/d_setregid.U | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/mcon/U/d_setregid.U b/mcon/U/d_setregid.U index 642a006..6f40026 100644 --- a/mcon/U/d_setregid.U +++ b/mcon/U/d_setregid.U @@ -12,7 +12,7 @@ ?RCS: Revision 3.0 1993/08/18 12:07:12 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: -?MAKE:d_setregid d_setresgid: Inlibc +?MAKE:d_setregid d_setresgid: Trylink cat i_unistd ?MAKE: -pick add $@ %< ?S:d_setregid: ?S: This variable conditionally defines HAS_SETREGID if setregid() is @@ -39,8 +39,38 @@ ?H:. ?LINT: set d_setregid d_setresgid : see if setregid exists -set setregid d_setregid -eval $inlibc -set setresgid d_setresgid -eval $inlibc +$cat >try.c <<EOC +#include <sys/types.h> +#$i_unistd I_UNISTD +#ifdef I_UNISTD +#include <unistd.h> +#endif +int main(void) +{ + static int ret; + static gid_t rgid, egid; + ret |= setregid(rgid, egid); + if (ret) + return 1; + return 0; +} +EOC +set d_setregid +eval $trylink + +$cat >try.c <<EOC +#$i_unistd I_UNISTD +#ifdef I_UNISTD +#include <unistd.h> +#endif +int main(void) +{ + static int ret; + static gid_t rgid, egid, sgid; + ret |= setresgid(rgid, egid, sgid); + return ret ? 0 : 1; +} +EOC +set d_setresgid +eval $trylink |