summaryrefslogtreecommitdiff
path: root/mcon/U/d_dliterphdr.U
blob: 0fa3cd402178955d922b48db84d560db1bd143ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
?RCS: $Id: d_dliterphdr.U 167 2013-05-08 17:58:00Z rmanfredi $
?RCS:
?RCS: Copyright (c) 2012, 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_dliterphdr: Trylink cat
?MAKE:	-pick add $@ %<
?S:d_dliterphdr:
?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.
?S:.
?C:HAS_DL_ITERATE_PHDR:
?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.
?C:.
?H:#$d_dliterphdr HAS_DL_ITERATE_PHDR	/**/
?H:.
?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;
}
EOC
cyn=dl_iterate_phdr
set d_dliterphdr
eval $trylink