X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fust-dlfcn.h;fp=include%2Flttng%2Fust-dlfcn.h;h=0000000000000000000000000000000000000000;hb=ae4b659d95f8dab9f2aa4b890d6937d7d5375f07;hp=2a76fe5b624eee5b243f6631a4e40d5b2750ad1d;hpb=ba5b3d2bf3ecd8614e74efc1db2f5a626c5d9a92;p=lttng-ust.git diff --git a/include/lttng/ust-dlfcn.h b/include/lttng/ust-dlfcn.h deleted file mode 100644 index 2a76fe5b..00000000 --- a/include/lttng/ust-dlfcn.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright (C) 2014 Mathieu Desnoyers - * - * dlfcn.h compatibility layer. - */ - -#ifndef _LTTNG_UST_DLFCN_H -#define _LTTNG_UST_DLFCN_H - -#ifdef _DLFCN_H -#error "Please include lttng/ust-dlfcn.h before dlfcn.h." -#endif /* _DLFCN_H */ - -#ifdef __GLIBC__ -/* - * glibc declares dlsym() and dlerror() with __attribute__((leaf)) (see - * THROW annotation). Unfortunately, this is not in sync with reality, - * as those functions call the memory allocator. Work-around this glibc - * bug by declaring our own symbols. - * - * There has been a similar issue for dlopen() and dlclose(), as - * constructors and destructors are called from these functions, so they - * are clearly non-leaf. Work-around the issue for those too for older - * glibc where these have not been fixed. - */ -#define dlopen glibc_dlopen_proto_lies_about_leafness -#define dlclose glibc_dlclose_proto_lies_about_leafness -#define dlsym glibc_dlsym_proto_lies_about_leafness -#define dlerror glibc_dlerror_proto_lies_about_leafness -#define dlmopen glibc_dlmopen_proto_lies_about_leafness -#define dlvsym glibc_dlvsym_proto_lies_about_leafness -#include -#undef dlvsym -#undef dlmopen -#undef dlerror -#undef dlsym -#undef dlclose -#undef dlopen - -extern void *dlopen(__const char *__file, int __mode); -extern int dlclose(void *__handle) __nonnull ((1)); -extern void *dlsym(void *__restrict __handle, - __const char *__restrict __name) __nonnull ((2)); -extern char *dlerror(void); -#ifdef __USE_GNU -extern void *dlmopen(Lmid_t __nsid, const char *__file, int __mode); -extern void *dlvsym(void *__restrict __handle, - __const char *__restrict __name, - __const char *__restrict __version); -#endif -#else -#include -#endif /* __GLIBC__ */ - -#endif /* _LTTNG_UST_DLFCN_H */