]>
Commit | Line | Data |
---|---|---|
bc3b7c8c | 1 | .Dd May 11, 2020 |
bac542e6 A |
2 | .Os |
3 | .Dt DLOPEN_PREFLIGHT 3 | |
4 | .Sh NAME | |
5 | .Nm dlopen_preflight | |
6 | .Nd preflight the load of a dynamic library or bundle | |
7 | .Sh SYNOPSIS | |
8 | .In dlfcn.h | |
9 | .Ft bool | |
10 | .Fn dlopen_preflight "const char* path" | |
11 | .Sh DESCRIPTION | |
12 | .Fn dlopen_preflight | |
13 | examines the mach-o file specified by | |
14 | .Fa path . | |
15 | It checks if the file and libraries it depends on are all compatible with the current process. | |
bc3b7c8c A |
16 | That is, they contain the correct architecture and are not otherwise ABI incompatible. |
17 | .Pp | |
18 | .Fn dlopen_preflight | |
19 | was created for the PowerPC to Intel transition for use by apps with plugins that the user chooses to load. | |
20 | The app could use dlopen_preflight() to show only loadable plugins to the user (such as in a menu). | |
21 | .Pp | |
22 | This is potentially an expensive call because it may internally do the same as dlopen/dlclose. Only | |
23 | use dlopen_preflight() if you need to show the user a list of potentially loadable plugins. | |
bac542e6 A |
24 | .Pp |
25 | .Fn dlopen_preflight | |
26 | was first available in Mac OS X 10.5. | |
27 | .Sh SEARCHING | |
28 | .Fn dlopen_preflight | |
29 | uses the same steps as | |
30 | .Fn dlopen | |
31 | to find a compatible mach-o file. | |
32 | .Sh RETURN VALUES | |
33 | .Fn dlopen_preflight | |
34 | returns true on if the mach-o file is compatible. If the file is not compatible, it returns false | |
35 | and sets an error string that can be examined with | |
36 | .Fn dlerror . | |
37 | .Pp | |
38 | .Sh SEE ALSO | |
39 | .Xr dlopen 3 | |
40 | .Xr dlerror 3 |