]> git.proxmox.com Git - mirror_zfs.git/blob - lib/libspl/include/sys/types.h
Illumos Crypto Port module added to enable native encryption in zfs
[mirror_zfs.git] / lib / libspl / include / sys / types.h
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, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef _LIBSPL_SYS_TYPES_H
28 #define _LIBSPL_SYS_TYPES_H
29
30 #include <sys/isa_defs.h>
31 #include <sys/feature_tests.h>
32 #include_next <sys/types.h>
33 #include <sys/types32.h>
34 #include <sys/va_list.h>
35
36 #ifndef HAVE_INTTYPES
37 #include <inttypes.h>
38
39 typedef enum boolean { B_FALSE, B_TRUE } boolean_t;
40
41 typedef unsigned char uchar_t;
42 typedef unsigned short ushort_t;
43 typedef unsigned int uint_t;
44 typedef unsigned long ulong_t;
45
46 typedef long long longlong_t;
47 typedef unsigned long long u_longlong_t;
48 #endif /* HAVE_INTTYPES */
49
50 typedef longlong_t offset_t;
51 typedef u_longlong_t u_offset_t;
52 typedef u_longlong_t len_t;
53 typedef longlong_t diskaddr_t;
54
55 typedef ulong_t pgcnt_t; /* number of pages */
56 typedef long spgcnt_t; /* signed number of pages */
57
58 typedef short pri_t;
59
60 typedef int zoneid_t;
61 typedef int projid_t;
62
63 typedef int major_t;
64 typedef int minor_t;
65
66 typedef ushort_t o_mode_t; /* old file attribute type */
67 typedef short index_t;
68
69 /*
70 * Definitions remaining from previous partial support for 64-bit file
71 * offsets. This partial support for devices greater than 2gb requires
72 * compiler support for long long.
73 */
74 #ifdef _LONG_LONG_LTOH
75 typedef union {
76 offset_t _f; /* Full 64 bit offset value */
77 struct {
78 int32_t _l; /* lower 32 bits of offset value */
79 int32_t _u; /* upper 32 bits of offset value */
80 } _p;
81 } lloff_t;
82 #endif
83
84 #ifdef _LONG_LONG_HTOL
85 typedef union {
86 offset_t _f; /* Full 64 bit offset value */
87 struct {
88 int32_t _u; /* upper 32 bits of offset value */
89 int32_t _l; /* lower 32 bits of offset value */
90 } _p;
91 } lloff_t;
92 #endif
93
94 #include <sys/param.h> /* for NBBY */
95
96 #endif