path: root/mcon/U/d_dliterphdr.U
diff options
Diffstat (limited to 'mcon/U/d_dliterphdr.U')
1 files changed, 44 insertions, 0 deletions
diff --git a/mcon/U/d_dliterphdr.U b/mcon/U/d_dliterphdr.U
new file mode 100644
index 0000000..0fa3cd4
--- /dev/null
+++ b/mcon/U/d_dliterphdr.U
@@ -0,0 +1,44 @@
+?RCS: $Id: d_dliterphdr.U 167 2013-05-08 17:58:00Z rmanfredi $
+?RCS: Copyright (c) 2012, Raphael Manfredi
+?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.
+?MAKE:d_dliterphdr: Trylink cat
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines HAS_DL_ITERATE_PHDR when
+?S: dl_iterate_phdr() is available to walk through the list of shared
+?S: objects.
+?C: This symbol, if defined, indicates that the dl_iterate_phdr() function is
+?C: available to walk through the list of shared objects. One needs to
+?C: define _GNU_SOURCE before including <link.h> to get the proper signature.
+?H:#$d_dliterphdr HAS_DL_ITERATE_PHDR /**/
+?LINT:set d_dliterphdr
+: see if dl_iterate_phdr exists
+$cat >try.c <<EOC
+#define _GNU_SOURCE
+#include <link.h>
+int cb(struct dl_phdr_info *info, size_t size, void *data)
+ return NULL == info && NULL == data && size != 0 ? 0 : 1;
+int main(void)
+ int ret;
+ ret = dl_iterate_phdr(cb, NULL);
+ return ret ? 0 : 1;
+set d_dliterphdr
+eval $trylink