Move to kernel style SPDX license identifiers
[lttng-ust.git] / include / lttng / ust-dlfcn.h
index c92f1bb6f320c99f38f61829340377945e7dfb3a..2a76fe5b624eee5b243f6631a4e40d5b2750ad1d 100644 (file)
@@ -1,36 +1,19 @@
-#ifndef _LTTNG_UST_DLFCN_H
-#define _LTTNG_UST_DLFCN_H
-
 /*
- * lttng/ust-dlfcn.h
+ * SPDX-License-Identifier: MIT
  *
- * Copyright 2014 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
  * dlfcn.h compatibility layer.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
  */
 
+#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,
 #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 <dlfcn.h>
+#undef dlvsym
+#undef dlmopen
 #undef dlerror
 #undef dlsym
 #undef dlclose
@@ -57,5 +44,14 @@ 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 <dlfcn.h>
+#endif /* __GLIBC__ */
 
 #endif /* _LTTNG_UST_DLFCN_H */
This page took 0.024027 seconds and 4 git commands to generate.