aarch64: Fix sve/acle/general/ldff1_8.c failures
[gcc.git] / libphobos / libdruntime / core / sys / netbsd / dlfcn.d
blob3785592fcd6fbd77e43fc80c3e7a3d62483aaec3
1 /**
2 * D header file for NetBSD.
4 * Copyright: Copyright Martin Nowak 2012.
5 * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6 * Authors: Martin Nowak
8 * http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/include/dlfcn.h
9 */
10 module core.sys.netbsd.dlfcn;
12 public import core.sys.posix.dlfcn;
14 version (NetBSD):
15 extern (C):
16 nothrow:
17 @nogc:
19 enum __BSD_VISIBLE = true;
22 * Request arguments for dlinfo().
24 enum RTLD_DI_LINKMAP = 3; /* Obtain link map. */
25 enum RTLD_DI_SERINFO = 5; /* Obtain search path info. */
26 enum RTLD_DI_SERINFOSIZE = 6; /* ... query for required space. */
27 enum RTLD_DI_ORIGIN = 7; /* Obtain object origin */
28 enum RTLD_DI_MAX = RTLD_DI_ORIGIN;
31 * Special handle arguments for dlsym()/dlinfo().
33 enum RTLD_NEXT = cast(void *)-1; /* Search subsequent objects. */
34 enum RTLD_DEFAULT = cast(void *)-2; /* Use default search algorithm. */
35 enum RTLD_SELF = cast(void *)-3; /* Search the caller itself. */
37 static if (__BSD_VISIBLE)
39 /*-
40 * The actual type declared by this typedef is immaterial, provided that
41 * it is a function pointer. Its purpose is to provide a return type for
42 * dlfunc() which can be cast to a function pointer type without depending
43 * on behavior undefined by the C standard, which might trigger a compiler
44 * diagnostic. We intentionally declare a unique type signature to force
45 * a diagnostic should the application not cast the return value of dlfunc()
46 * appropriately.
48 struct __dlfunc_arg {
49 int __dlfunc_dummy;
52 alias dlfunc_t = void function(__dlfunc_arg);
55 * Structures, returned by the RTLD_DI_SERINFO dlinfo() request.
57 struct Dl_serpath {
58 char * dls_name; /* single search path entry */
59 uint dls_flags; /* path information */
62 struct Dl_serinfo {
63 size_t dls_size; /* total buffer size */
64 uint dls_cnt; /* number of path entries */
65 Dl_serpath[1] dls_serpath; /* there may be more than one */
69 /* XSI functions first. */
70 extern(C) {
71 static assert(is(typeof(&dlclose) == int function(void*)));
72 static assert(is(typeof(&dlerror) == char* function()));
73 static assert(is(typeof(&dlopen) == void* function(const scope char*, int)));
74 static assert(is(typeof(&dlsym) == void* function(void*, const scope char*)));
77 static if (__BSD_VISIBLE)
79 int dlinfo(void*, int, void*);
80 void* dlvsym(void*, const(char)*, const(char)*);