-static
-load_return_t
-load_fvmlib(
- struct fvmlib_command *lcp,
- vm_map_t map,
- int depth
-)
-{
- char *name;
- char *p;
- struct vnode *vp;
- struct mach_header header;
- unsigned long file_offset;
- unsigned long macho_size;
- unsigned long lib_version;
- load_result_t myresult;
- kern_return_t ret;
-
- name = (char *)lcp + lcp->fvmlib.name.offset;
- /*
- * Check for a proper null terminated string.
- */
- p = name;
- do {
- if (p >= (char *)lcp + lcp->cmdsize)
- return(LOAD_BADMACHO);
- } while (*p++);
-
- ret = get_macho_vnode(name, &header, &file_offset, &macho_size, &vp);
- if (ret)
- return (ret);
-
- myresult = (load_result_t) { 0 };
-
- /*
- * Load the Mach-O.
- */
- ret = parse_machfile(vp, map, &header,
- file_offset, macho_size,
- depth, &lib_version, &myresult);
-
- if ((ret == LOAD_SUCCESS) &&
- (lib_version < lcp->fvmlib.minor_version))
- ret = LOAD_SHLIB;
-
- vrele(vp);
- return(ret);
-}
-
-static
-load_return_t
-load_idfvmlib(
- struct fvmlib_command *lcp,
- unsigned long *version
-)
-{
- *version = lcp->fvmlib.minor_version;
- return(LOAD_SUCCESS);
-}