1 /* $NetBSD: linux_types.h,v 1.7 2024/10/01 16:35:42 riastradh Exp $ */ 2 3 /*- 4 * Copyright (c) 2005 Emmanuel Dreyfus, 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 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by Emmanuel Dreyfus 17 * 4. The name of the author may not be used to endorse or promote 18 * products derived from this software without specific prior written 19 * permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS'' 22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 #ifndef _AMD64_LINUX_TYPES_H 35 #define _AMD64_LINUX_TYPES_H 36 37 typedef long linux_off_t; 38 typedef long linux_clock_t; 39 typedef long linux_time_t; 40 typedef long linux_suseconds_t; 41 typedef unsigned int linux_uid_t; 42 typedef unsigned int linux_gid_t; 43 typedef int linux_pid_t; 44 typedef unsigned int linux_mode_t; 45 typedef unsigned long linux_nlink_t; 46 typedef unsigned long linux_dev_t; 47 typedef unsigned long linux_ino_t; 48 typedef int linux_timer_t; 49 50 /* From linux_termios.h */ 51 typedef unsigned char linux_cc_t; 52 typedef unsigned int linux_speed_t; 53 typedef unsigned int linux_tcflag_t; 54 55 #define LINUX_STAT64_HAS_NSEC 1 56 struct linux_stat64 { 57 linux_dev_t lst_dev; 58 linux_ino_t lst_ino; 59 linux_nlink_t lst_nlink; 60 linux_mode_t lst_mode; 61 linux_uid_t lst_uid; 62 linux_gid_t lst_gid; 63 unsigned int l__pad0; 64 linux_dev_t lst_rdev; 65 long lst_size; 66 long lst_blksize; 67 long lst_blocks; 68 unsigned long lst_atime; 69 unsigned long lst_atime_nsec; 70 unsigned long lst_mtime; 71 unsigned long lst_mtime_nsec; 72 unsigned long lst_ctime; 73 unsigned long lst_ctime_nsec; 74 long l__unused[3]; 75 }; 76 77 struct linux_stat { 78 linux_dev_t lst_dev; 79 unsigned char l__pad0[4]; 80 unsigned int l__st_ino; 81 unsigned int lst_nlink; 82 linux_mode_t lst_mode; 83 linux_uid_t lst_uid; 84 linux_gid_t lst_gid; 85 linux_dev_t lst_rdev; 86 unsigned char l__pad3[4]; 87 long long lst_size; 88 unsigned int lst_blksize; 89 long long lst_blocks; 90 unsigned lst_atime; 91 unsigned lst_atime_nsec; 92 unsigned lst_mtime; 93 unsigned lst_mtime_nsec; 94 unsigned lst_ctime; 95 unsigned lst_ctime_nsec; 96 unsigned long long lst_ino; 97 } __packed; 98 99 #endif /* !_AMD64_LINUX_TYPES_H */ 100