9075 Improve ZFS pool import/load process and corrupted pool recovery
[unleashed.git] / usr / src / man / man3fstyp / fstyp_init.3fstyp
blob21579a57d65164aee21d8bf869d24c5418d8f194
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH FSTYP_INIT 3FSTYP "Jun 20, 2006"
7 .SH NAME
8 fstyp_init, fstyp_fini \- initialize and finalize libfstyp handle
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lfstyp\fR \fB -lnvpair \fR [ \fIlibrary\fR\&.\|.\|. ]
13 #include <libnvpair.h>
14 #include <libfstyp.h>
16 \fBint\fR \fBfstyp_init\fR(\fBint\fR \fIfd\fR, \fBoff64_t **\fR\fIoffset\fR, \fBchar *\fR\fImodule_dir\fR,
17      \fBfstyp_handle_t *\fR\fIhandle\fR);
18 .fi
20 .LP
21 .nf
22 \fBvoid\fR \fBfstyp_fini\fR(\fBvoid *\fR\fIhandle\fR);
23 .fi
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIfd\fR\fR
30 .ad
31 .RS 14n
32 Open file descriptor of a block or a raw device that contains the file system
33 to be identified.
34 .RE
36 .sp
37 .ne 2
38 .na
39 \fB\fIoffset\fR\fR
40 .ad
41 .RS 14n
42 Offset from the beginning of the device where the file system is located.
43 .RE
45 .sp
46 .ne 2
47 .na
48 \fB\fImodule_dir\fR\fR
49 .ad
50 .RS 14n
51 Optional location of the \fBlibfstyp\fR modules.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fIhandle\fR\fR
58 .ad
59 .RS 14n
60 Opaque handle to be used with \fBlibfstyp\fR functions.
61 .RE
63 .SH DESCRIPTION
64 .sp
65 .LP
66 The \fBfstyp_init()\fR function returns a \fIhandle\fR associated with the
67 specified parameters. This \fIhandle\fR should be used with all other
68 \fBlibfstyp\fR functions.
69 .sp
70 .LP
71 If \fImodule_dir\fR is \fINULL\fR, \fBfstyp_init()\fR looks for modules in the
72 default location: \fB/usr/lib/fs\fR subdirectories. The \fBfstyp_init()\fR
73 function locates \fBlibfstyp\fR modules, but might defer loading the modules
74 until the subsequent \fBfstyp_ident()\fR call.
75 .sp
76 .LP
77 If \fImodule_dir\fR is other than \fINULL\fR, the \fBfstyp_init()\fR function
78 locates a module in the directory that is specified. If no module is found,
79 \fBfstyp_init\fR fails with \fBFSTYP_ERR_MOD_NOT_FOUND\fR.
80 .sp
81 .LP
82 Modules that do not support non-zero offset can fail \fBfstyp_init()\fR with
83 \fBFSTYP_ERR_OFFSET\fR.
84 .sp
85 .LP
86 The \fBfstyp_fini()\fR function releases all resources associated with a handle
87 and invalidates the handle.
88 .SH RETURN VALUES
89 .sp
90 .LP
91 The \fBfstyp_init()\fR function returns \fB0\fR on success and an error value
92 on failure. See \fBfstyp_strerror\fR(3FSTYP).
93 .SH ATTRIBUTES
94 .sp
95 .LP
96 See \fBattributes\fR(5) for descriptions of the following attributes:
97 .sp
99 .sp
101 box;
102 c | c
103 l | l .
104 ATTRIBUTE TYPE  ATTRIBUTE VALUE
106 Interface Stability     Evolving
108 MT-Level        MT-Safe
111 .SH SEE ALSO
114 \fBfstyp_ident\fR(3FSTYP), \fBfstyp_mod_init\fR(3FSTYP),
115 \fBfstyp_strerror\fR(3FSTYP), \fBlibfstyp\fR(3LIB), \fBattributes\fR(5)