c5861cae6855d63a86b7f802d6cbe41723507adb
2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * dlfcn.h compatibility layer.
9 #ifndef _UST_COMMON_COMPAT_DLFCN_H
10 #define _UST_COMMON_COMPAT_DLFCN_H
13 #error "Please include compat/dlfcn.h before dlfcn.h."
18 * glibc declares dlsym() and dlerror() with __attribute__((leaf)) (see
19 * THROW annotation). Unfortunately, this is not in sync with reality,
20 * as those functions call the memory allocator. Work-around this glibc
21 * bug by declaring our own symbols.
23 * There has been a similar issue for dlopen() and dlclose(), as
24 * constructors and destructors are called from these functions, so they
25 * are clearly non-leaf. Work-around the issue for those too for older
26 * glibc where these have not been fixed.
28 #define dlopen glibc_dlopen_proto_lies_about_leafness
29 #define dlclose glibc_dlclose_proto_lies_about_leafness
30 #define dlsym glibc_dlsym_proto_lies_about_leafness
31 #define dlerror glibc_dlerror_proto_lies_about_leafness
32 #define dlmopen glibc_dlmopen_proto_lies_about_leafness
33 #define dlvsym glibc_dlvsym_proto_lies_about_leafness
42 extern void *dlopen(__const
char *__file
, int __mode
);
43 extern int dlclose(void *__handle
) __nonnull ((1));
44 extern void *dlsym(void *__restrict __handle
,
45 __const
char *__restrict __name
) __nonnull ((2));
46 extern char *dlerror(void);
48 extern void *dlmopen(Lmid_t __nsid
, const char *__file
, int __mode
);
49 extern void *dlvsym(void *__restrict __handle
,
50 __const
char *__restrict __name
,
51 __const
char *__restrict __version
);
55 #endif /* __GLIBC__ */
57 #endif /* _UST_COMMON_COMPAT_DLFCN_H */
This page took 0.041807 seconds and 5 git commands to generate.