]> git.saurik.com Git - apple/dyld.git/blame - doc/man/man3/dlopen_preflight.3
dyld-851.27.tar.gz
[apple/dyld.git] / doc / man / man3 / dlopen_preflight.3
CommitLineData
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
13examines the mach-o file specified by
14.Fa path .
15It checks if the file and libraries it depends on are all compatible with the current process.
bc3b7c8c
A
16That is, they contain the correct architecture and are not otherwise ABI incompatible.
17.Pp
18.Fn dlopen_preflight
19was created for the PowerPC to Intel transition for use by apps with plugins that the user chooses to load.
20The app could use dlopen_preflight() to show only loadable plugins to the user (such as in a menu).
21.Pp
22This is potentially an expensive call because it may internally do the same as dlopen/dlclose. Only
23use dlopen_preflight() if you need to show the user a list of potentially loadable plugins.
bac542e6
A
24.Pp
25.Fn dlopen_preflight
26was first available in Mac OS X 10.5.
27.Sh SEARCHING
28.Fn dlopen_preflight
29uses the same steps as
30.Fn dlopen
31to find a compatible mach-o file.
32.Sh RETURN VALUES
33.Fn dlopen_preflight
34returns true on if the mach-o file is compatible. If the file is not compatible, it returns false
35and 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