xref: /illumos-gate/usr/src/uts/common/sys/bootstat.h (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_BOOTSTAT_H
27 #define	_SYS_BOOTSTAT_H
28 
29 #include <sys/stat.h>
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * 32/64-bit neutral stat and time structure to allow booters to be shared
37  *	among ILP32 and LP64 kernels.
38  */
39 typedef struct boottime {
40 	int64_t	tv_sec;
41 	int64_t	tv_nsec;
42 } boottime_t;
43 
44 /*
45  * Current booters only support mode and size, with the exception of
46  *	nfs booter also uses ino.
47  */
48 struct bootstat {
49 	uint64_t	st_dev;
50 	uint64_t	st_ino;
51 	uint32_t	st_mode;
52 	uint32_t	st_nlink;
53 	int32_t		st_uid;
54 	int32_t		st_gid;
55 	uint64_t	st_rdev;
56 	uint64_t	st_size;
57 	boottime_t	st_atim;
58 	boottime_t	st_mtim;
59 	boottime_t	st_ctim;
60 	int32_t		st_blksize;
61 	int64_t		st_blocks;
62 	char		st_fstype[_ST_FSTYPSZ];
63 };
64 
65 /*
66  * Special struct for compressed files.
67  * Only used by kobj to decompress files before
68  * root is mounted. Afterwards, dcfs will take
69  * over decompression.
70  */
71 struct compinfo {
72 	int	iscmp;
73 	size_t	fsize;
74 	size_t	blksize;
75 };
76 
77 #ifdef	__cplusplus
78 }
79 #endif
80 
81 #endif	/* _SYS_BOOTSTAT_H */
82