GETMACHHEADERS(3) — UNIX Programmer’s Manual
NAME
getmachheaders − get the Mach headers for the executable
SYNOPSIS
#include <ldsyms.h>
#include <sys/loader.h>
struct mach_header ∗∗getmachheaders()
DESCRIPTION
This routine returns an array of pointers to Mach headers (the executable and the shared libraries) in the Mach executable it is linked into. It returns NULL if the malloc(3) it uses for the array fails. The last entry in the array is zero. It uses the link editor defined symbol _mh_execute_header and just looks through the load commands.
SEE ALSO
end(3), getsectbyname(3), getsegbyname(3)
NeXT Computer, Inc. — March 1, 1989