summaryrefslogtreecommitdiff
path: root/mcon/U/d_msem_lck.U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U/d_msem_lck.U')
-rw-r--r--mcon/U/d_msem_lck.U42
1 files changed, 42 insertions, 0 deletions
diff --git a/mcon/U/d_msem_lck.U b/mcon/U/d_msem_lck.U
new file mode 100644
index 0000000..f35de33
--- /dev/null
+++ b/mcon/U/d_msem_lck.U
@@ -0,0 +1,42 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 1991-1997, 2004-2006, 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:
+?RCS: $Log: d_msem_lck.U,v $
+?MAKE:d_msem_lck: Trylink cat i_sysmman
+?MAKE: -pick add $@ %<
+?S:d_msem_lck:
+?S: This variable conditionally defines HAS_MSEM_LOCK if msem_lock() is
+?S: available, thereby indicating kernel support for memory semaphores.
+?S:.
+?C:HAS_MSEM_LOCK:
+?C: This symbol, if defined, indicates that memory semaphores are
+?C: available to protect mmap()'ed regions.
+?C:.
+?H:#$d_msem_lck HAS_MSEM_LOCK /**/
+?H:.
+?LINT:set d_msem_lck
+: see if msem_lock exists
+$cat >try.c <<EOC
+#$i_sysmman I_SYS_MMAN
+#ifdef I_SYS_MMAN
+#include <sys/mman.h>
+#endif
+int main(void)
+{
+ static int ret;
+ static msemaphore *sem;
+ ret |= msem_lock(sem, MSEM_IF_NOWAIT);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=msem_lock
+set d_msem_lck
+eval $trylink
+