summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2013-01-30 18:15:29 +0000
committerrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2013-01-30 18:15:29 +0000
commit10b9626e257744a4505701a7871c68e3c0f7ed09 (patch)
treea89465d7641e8918531ecd079c30eaa9adb9a8ed
parent20c74efeeb701e4966e96e2176a573119c30053a (diff)
Added check for pthread_attr_setstack().
git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@162 2592e710-e01b-42a5-8df0-11608a6cc53d
-rw-r--r--MANIFEST1
-rw-r--r--mcon/U/d_ptattr_setstack.U40
2 files changed, 41 insertions, 0 deletions
diff --git a/MANIFEST b/MANIFEST
index 406ebf0..cc9f6d9 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -223,6 +223,7 @@ mcon/U/d_fgetpos.U Do we have fgetpos()?
mcon/U/d_flexfnam.U Long filenames?
mcon/U/d_flock.U Do we have flock()?
mcon/U/d_fmod.U Do we have fmod()?
+mcon/U/d_ptattr_setstack.U Do we have pthread_attr_setstack()?
mcon/U/d_fork.U Do we have fork()?
mcon/U/d_fsetpos.U Do we have fsetpos()?
mcon/U/d_ftime.U Do we have ftime()?
diff --git a/mcon/U/d_ptattr_setstack.U b/mcon/U/d_ptattr_setstack.U
new file mode 100644
index 0000000..15e1c15
--- /dev/null
+++ b/mcon/U/d_ptattr_setstack.U
@@ -0,0 +1,40 @@
+?RCS:
+?RCS: Copyright (c) 2013 Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?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 Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_ptattr_setstack: Trylink cat
+?MAKE: -pick add $@ %<
+?S:d_ptattr_setstack:
+?S: This variable conditionally defines the HAS_PTHREAD_ATTR_SETSTACK symbol,
+?S: which indicates to the C program that pthread_attr_setstack() should be
+?S: used to set the thread stack, instead of pthread_attr_setstackaddr().
+?S:.
+?C:HAS_PTHREAD_ATTR_SETSTACK:
+?C: This symbol is defined when pthread_attr_setstack() can be used to set
+?C: the thread stack. Otherwise, use obsoleted pthread_attr_setstackaddr().
+?C:.
+?H:#$d_ptattr_setstack HAS_PTHREAD_ATTR_SETSTACK
+?H:.
+?LINT: set d_ptattr_setstack
+: can we use pthread_attr_setstack
+$cat >try.c <<'EOC'
+#include <pthread.h>
+int main(void)
+{
+ pthread_attr_t attr;
+ void *p = NULL;
+ static int ret;
+
+ ret |= pthread_attr_setstack(&attr, p, 4096);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=pthread_attr_setstack
+set d_ptattr_setstack '-lpthread'
+eval $trylink
+