Home | History | Annotate | Line # | Download | only in i386
      1 /*	$NetBSD: linux_types.h,v 1.17 2009/01/11 02:45:48 christos Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Frank van der Linden and Eric Haszlakiewicz.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 #ifndef _I386_LINUX_TYPES_H
     33 #define _I386_LINUX_TYPES_H
     34 
     35 typedef unsigned short linux_uid_t;
     36 typedef unsigned short linux_gid_t;
     37 typedef unsigned short linux_dev_t;
     38 typedef unsigned long linux_ino_t;
     39 typedef unsigned short linux_mode_t;
     40 typedef unsigned short linux_nlink_t;
     41 typedef long linux_time_t;
     42 typedef long linux_suseconds_t;
     43 typedef long linux_clock_t;
     44 typedef long linux_off_t;
     45 typedef int linux_pid_t;
     46 
     47 /* From linux_termios.h */
     48 typedef unsigned char linux_cc_t;
     49 typedef unsigned long linux_speed_t;
     50 typedef unsigned long linux_tcflag_t;
     51 
     52 #define LINUX_STAT_HAS_NSEC	1
     53 struct linux_stat {
     54 	linux_dev_t		lst_dev;
     55 	unsigned short		pad1;
     56 	linux_ino_t		lst_ino;
     57 	linux_mode_t		lst_mode;
     58 	linux_nlink_t		lst_nlink;
     59 	linux_uid_t		lst_uid;
     60 	linux_gid_t		lst_gid;
     61 	linux_dev_t		lst_rdev;
     62 	unsigned short		pad2;
     63 	linux_off_t		lst_size;
     64 	unsigned long		lst_blksize;
     65 	unsigned long		lst_blocks;
     66 	linux_time_t		lst_atime;
     67 	unsigned long		lst_atime_nsec;
     68 	linux_time_t		lst_mtime;
     69 	unsigned long		lst_mtime_nsec;
     70 	linux_time_t		lst_ctime;
     71 	unsigned long		lst_ctime_nsec;
     72 	unsigned long		unused4;
     73 	unsigned long		unused5;
     74 };
     75 
     76 /* This matches struct stat64 in glibc2.1, hence the absolutely
     77  * insane amounts of padding around dev_t's.
     78  */
     79 #define LINUX_STAT64_HAS_NSEC	1
     80 struct linux_stat64 {
     81 	unsigned long long lst_dev;
     82 	unsigned int	__pad1;
     83 
     84 #define LINUX_STAT64_HAS_BROKEN_ST_INO	1
     85 	unsigned int	__lst_ino;
     86 	unsigned int	lst_mode;
     87 	unsigned int	lst_nlink;
     88 
     89 	unsigned int	lst_uid;
     90 	unsigned int	lst_gid;
     91 
     92 	unsigned long long	lst_rdev;
     93 	unsigned int	__pad2;
     94 
     95 	long long	lst_size;
     96 	unsigned int	lst_blksize;
     97 
     98 	unsigned long long lst_blocks;	/* Number 512-byte blocks allocated. */
     99 
    100 	unsigned int	lst_atime;
    101 	unsigned int	lst_atime_nsec;
    102 
    103 	unsigned int	lst_mtime;
    104 	unsigned int	lst_mtime_nsec;
    105 
    106 	unsigned int	lst_ctime;
    107 	unsigned int	lst_ctime_nsec;
    108 
    109 	unsigned long long lst_ino;
    110 };
    111 
    112 #endif /* !_I386_LINUX_TYPES_H */
    113