1 // SPDX-License-Identifier: BSD-2-Clause 2 /* 3 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * $FreeBSD$ 28 */ 29 30 #ifndef _SPL_SYS_TYPES_H_ 31 #define _SPL_SYS_TYPES_H_ 32 33 #pragma once 34 /* 35 * This is a bag of dirty hacks to keep things compiling. 36 */ 37 #include_next <sys/types.h> 38 39 #ifdef __ILP32__ 40 typedef __uint64_t u_longlong_t; 41 typedef __int64_t longlong_t; 42 #else 43 typedef unsigned long long u_longlong_t; 44 typedef long long longlong_t; 45 #endif 46 #include <sys/stdint.h> 47 48 #define _CLOCK_T_DECLARED 49 50 #include <sys/types32.h> 51 #include <sys/_stdarg.h> 52 #include <linux/types.h> 53 54 #define MAXNAMELEN 256 55 56 57 58 typedef void zfs_kernel_param_t; 59 60 typedef struct timespec timestruc_t; 61 typedef struct timespec timespec_t; 62 typedef struct timespec inode_timespec_t; 63 /* BEGIN CSTYLED */ 64 typedef u_int uint_t; 65 typedef u_char uchar_t; 66 typedef u_short ushort_t; 67 typedef u_long ulong_t; 68 /* END CSTYLED */ 69 typedef int minor_t; 70 #ifndef _OFF64_T_DECLARED 71 #define _OFF64_T_DECLARED 72 typedef off_t off64_t; 73 #endif 74 typedef id_t taskid_t; 75 typedef id_t projid_t; 76 typedef id_t poolid_t; 77 typedef uint_t zoneid_t; 78 typedef id_t ctid_t; 79 typedef mode_t o_mode_t; 80 typedef uint64_t pgcnt_t; 81 82 typedef short index_t; 83 typedef off_t offset_t; 84 #ifndef _PTRDIFF_T_DECLARED 85 typedef __ptrdiff_t ptrdiff_t; /* pointer difference */ 86 #define _PTRDIFF_T_DECLARED 87 #endif 88 typedef int64_t rlim64_t; 89 typedef int major_t; 90 91 #ifdef NEED_SOLARIS_BOOLEAN 92 #if defined(__XOPEN_OR_POSIX) 93 typedef enum { _B_FALSE, _B_TRUE } boolean_t; 94 #else 95 typedef enum { B_FALSE, B_TRUE } boolean_t; 96 #endif /* defined(__XOPEN_OR_POSIX) */ 97 #else 98 99 #define B_FALSE 0 100 #define B_TRUE 1 101 102 #endif 103 104 typedef u_longlong_t u_offset_t; 105 typedef u_longlong_t len_t; 106 107 typedef longlong_t diskaddr_t; 108 109 typedef void zidmap_t; 110 111 #include <sys/debug.h> 112 #endif /* !_OPENSOLARIS_SYS_TYPES_H_ */ 113