5 .Nm _dyld_get_image_header,
6 .Nm _dyld_get_image_vmaddr_slide,
7 .Nm _dyld_get_image_name,
8 .Nm _dyld_register_func_for_add_image,
9 .Nm _dyld_register_func_for_remove_image,
10 .Nm NSVersionOfRunTimeLibrary,
11 .Nm NSVersionOfLinkTimeLibrary
12 .Nm _NSGetExecutablePath
19 .Ft const struct mach_header*
20 .Fo _dyld_get_image_header
21 .Fa "uint32_t image_index"
24 .Fo _dyld_get_image_vmaddr_slide
25 .Fa "uint32_t image_index"
28 .Fo _dyld_get_image_name
29 .Fa "uint32_t image_index"
32 .Fo _dyld_register_func_for_add_image
33 .Fa "void \*[lp]*func\*[rp]\*[lp]const struct mach_header* mh, intptr_t vmaddr_slide\*[rp]"
36 .Fo _dyld_register_func_for_remove_image
37 .Fa "void \*[lp]*func\*[rp]\*[lp]const struct mach_header* mh, intptr_t vmaddr_slide\*[rp]"
40 .Fo NSVersionOfRunTimeLibrary
41 .Fa "const char* libraryName"
44 .Fo NSVersionOfLinkTimeLibrary
45 .Fa "const char* libraryName"
48 .Fo _NSGetExecutablePath
50 .Fa "uint32_t* bufsize"
53 These routines provide additional introspection of dyld beyond that provided by
60 returns the current number of images mapped in by dyld. Note that using this
61 count to iterate all images is not thread safe, because another thread
62 may be adding or removing images during the iteration.
64 .Fn _dyld_get_image_header
65 returns a pointer to the mach header of the image indexed by image_index. If
67 is out of range, NULL is returned.
69 .Fn _dyld_get_image_vmaddr_slide
70 returns the virtural memory address slide amount of the image indexed by
74 is out of range zero is returned.
76 .Fn _dyld_get_image_name
77 returns the name of the image indexed by
79 The C-string continues to be owned by dyld and should not deleted.
82 is out of range NULL is returned.
84 .Fn _dyld_register_func_for_add_image
85 registers the specified function to be called when a new image is added
86 (a bundle or a dynamic shared library) to the program. When this function is
87 first registered it is called for once for each image that is currently part of
90 .Fn _dyld_register_func_for_remove_image
91 registers the specified function to be called when an image is removed
92 (a bundle or a dynamic shared library) from the process.
94 .Fn NSVersionOfRunTimeLibrary
95 returns the current_version number of the currently loaded dylib
96 specifed by the libraryName. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
97 "Foo" for /path/Foo.framework/Versions/A/Foo. This function returns -1 if no such library is loaded.
99 .Fn NSVersionOfLinkTimeLibrary
100 returns the current_version number that the main executable was linked
101 against at build time. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
102 "Foo" for /path/Foo.framework/Versions/A/Foo. This function returns -1 if the main executable did not link
103 against the specified library.
105 .Fn _NSGetExecutablePath
106 copies the path of the main executable into the buffer
110 parameter should initially be the size of the buffer. This function returns 0 if the path was successfully copied.
111 It returns -1 if the buffer is not large enough, and *
113 is set to the size required.
115 .Fn _NSGetExecutablePath
116 will return "a path" to the executable not a "real path" to the executable.
117 That is, the path may be a symbolic link and not the real file. With deep directories the total bufsize
118 needed could be more than MAXPATHLEN.
123 http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/index.html