Misc. Reference Manual Pages fstyp_init(3FSTYP) NAME fstyp_init, fstyp_fini - initialize and finalize libfsyp handle SYNOPSIS cc [ flag... ] file... -lfstyp -lnvpair [ library... ] #include #include int fstyp_init(int fd, off64_t offset, char *module_dir, fstyp_handle_t *handle); void fstyp_fini(void *handle); fd Open file descriptor of a block or raw device that contains the filesystem to be identified. offset Offset from the beginning of the device where the filesystem is located. module_dir Optional location of the libfstyp modules. handle Opaque handle to be used with libfstyp functions. The fstyp_init() function returns a handle associated with the specified parameters. This handle should be used with all other libfstyp functions. If module_dir is NULL, fstyp_init() will look for modules in the default location: the subdirectories of the /usr/lib/fs directory. fstyp_init() will locate libfstyp modules, but might defer loading them until the subsequent fstyp_ident() call. If module_dir is not NULL, fstyp_init() will locate a module in the specified directory. If no module is found, fstyp_init() fails with FSTYP_ERR_MOD_NOT_FOUND. Modules that do not support non-zero offset can fail fstyp_init() with FSTYP_ERR_OFFSET. The fstyp_fini() function releases all resources associated with the handle and invalidates the handle. ERRORS fstyp_init() returns 0 on success and an error value on failure. See fstyp_strerror(3FSTYP). ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |____________________________|______________________________| | Interface Stability | Evolving | |____________________________|______________________________| | MT-Level | MT-Safe | |____________________________|______________________________| SEE ALSO libfstyp(3LIB), fstyp_ident(3FSTYP), fstyp_strerror(3FSTYP), fstyp_mod_init(3FSTYP), attributes(5)