1 /*	$NetBSD: linux32_types.h,v 1.7 2010/07/07 01:30:35 chs Exp $ */
2 
3 /*-
4  * Copyright (c) 2006 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 #ifndef _AMD64_LINUX32_TYPES_H
34 #define _AMD64_LINUX32_TYPES_H
35 
36 typedef uint16_t linux32_uid_t;
37 typedef uint16_t linux32_gid_t;
38 typedef int32_t linux32_pid_t;
39 typedef int32_t linux32_clock_t;
40 typedef int32_t linux32_time_t;
41 typedef int32_t linux32_off_t;
42 typedef uint32_t linux32_ino_t;
43 typedef uint32_t linux32_size_t;
44 typedef netbsd32_pointer_t linux32_ulongp_t;
45 
46 typedef netbsd32_pointer_t linux32_user_descp_t;
47 
48 #define LINUX32_STAT64_HAS_NSEC   1
49 struct linux32_stat64 {
50 	unsigned long long lst_dev;
51 	unsigned char __pad0[4];
52 #define LINUX32_STAT64_HAS_BROKEN_ST_INO  1
53 	unsigned int __lst_ino;
54 
55 	unsigned int lst_mode;
56 	unsigned int lst_nlink;
57 	unsigned int lst_uid;
58 	unsigned int lst_gid;
59 
60 	unsigned long long lst_rdev;
61 	unsigned char __pad3[4];
62 	long long   lst_size;
63 	unsigned int lst_blksize;
64 	long long lst_blocks;  /* Number 512-byte blocks allocated. */
65 	unsigned lst_atime;
66 	unsigned lst_atime_nsec;
67 	unsigned lst_mtime;
68 	unsigned lst_mtime_nsec;
69 	unsigned lst_ctime;
70 	unsigned lst_ctime_nsec;
71 	unsigned long long lst_ino;
72 } __packed;
73 
74 struct linux32_stat {
75 	u_int16_t	lst_dev;
76 	u_int16_t	__pad1;
77 	u_int32_t	lst_ino;
78 	u_int16_t	lst_mode;
79 	u_int16_t	lst_nlink;
80 	u_int16_t	lst_uid;
81 	u_int16_t	lst_gid;
82 	u_int16_t	lst_rdev;
83 	u_int16_t	__pad2;
84 	u_int32_t	lst_size;
85 	u_int32_t	lst_blksize;
86 	u_int32_t	lst_blocks;
87 	u_int32_t	lst_atime;
88 	u_int32_t	lst_atime_nsec;
89 	u_int32_t	lst_mtime;
90 	u_int32_t	lst_mtime_nsec;
91 	u_int32_t	lst_ctime;
92 	u_int32_t	lst_ctime_nsec;
93 };
94 
95 struct linux32_utimbuf {
96 	linux32_time_t l_actime;
97 	linux32_time_t l_modtime;
98 };
99 
100 #endif /* _AMD64_LINUX32_TYPES_H */
101