summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2013-09-10 11:07:20 +0000
committerrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2013-09-10 11:07:20 +0000
commitfd88285592058969b8de7412564413ed7679c6a4 (patch)
treeaf2058a87dfada92773ee1ddff20b50df3aeb817
parent5332a1d4bb70383c277cb88977c512ef3f6af42b (diff)
Added check for sigaltstack().
git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@172 2592e710-e01b-42a5-8df0-11608a6cc53d
-rw-r--r--MANIFEST1
-rw-r--r--mcon/U/d_sigaltstack.U42
2 files changed, 43 insertions, 0 deletions
diff --git a/MANIFEST b/MANIFEST
index 7c458ed..6393e1c 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -385,6 +385,7 @@ mcon/U/d_shmctl.U Do we have shmctl()?
mcon/U/d_shmdt.U Do we have shmdt()?
mcon/U/d_shmget.U Do we have shmget()?
mcon/U/d_sigaction.U Do we have sigaction()?
+mcon/U/d_sigaltstack.U Do we have sigaltstack()?
mcon/U/d_sigblock.U Do we have sigblock()?
mcon/U/d_sighold.U Do we have sighold()?
mcon/U/d_siglist.U Do we have sys_siglist[]?
diff --git a/mcon/U/d_sigaltstack.U b/mcon/U/d_sigaltstack.U
new file mode 100644
index 0000000..e9e4891
--- /dev/null
+++ b/mcon/U/d_sigaltstack.U
@@ -0,0 +1,42 @@
+?RCS:
+?RCS: Copyright (c) 2013, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_sigaltstack: Trylink cat
+?MAKE: -pick add $@ %<
+?S:d_sigaltstack:
+?S: This variable conditionally defines the HAS_SIGALTSTACK symbol, which
+?S: indicates that the sigaltstack() routine is available to define an
+?S: alternate signal stack.
+?S:.
+?C:HAS_SIGALTSTACK:
+?C: This symbol, if defined, indicates that the sigaltstack() routine
+?C: is available to define an alternate signal stack.
+?C:.
+?H:#$d_sigaltstack HAS_SIGALTSTACK /**/
+?H:.
+?LINT:set d_sigaltstack
+: see if we have sigaltstack
+$cat >try.c <<EOC
+#include <stdio.h>
+#include <signal.h>
+int main(void)
+{
+ stack_t ss;
+ static int ret;
+ ss.ss_sp = NULL;
+ ss.ss_flags |= SS_ONSTACK | SS_DISABLE;
+ ss.ss_size = SIGSTKSZ + MINSIGSTKSZ;
+ ret |= sigaltstack(&ss, NULL);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=sigaltstack
+set d_sigaltstack
+eval $trylink
+