1 /* $NetBSD: svr4_types.h,v 1.13 2002/05/03 01:34:49 eeh Exp $ */
2
3 /*-
4 * Copyright (c) 1994 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas.
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 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _SVR4_TYPES_H_
40 #define _SVR4_TYPES_H_
41
42 typedef u_quad_t svr4_ino64_t;
43 typedef quad_t svr4_off64_t;
44 typedef quad_t svr4_blkcnt64_t;
45 typedef u_quad_t svr4_fsblkcnt64_t;
46
47 typedef long svr4_off_t;
48 typedef int svr4_off32_t;
49 typedef u_long svr4_dev_t;
50 typedef u_long svr4_ino_t;
51 typedef u_int svr4_mode_t;
52 typedef u_int svr4_nlink_t;
53 typedef int svr4_uid_t;
54 typedef int svr4_gid_t;
55 typedef long svr4_daddr_t;
56 typedef int svr4_pid_t;
57 typedef long svr4_time_t;
58 typedef int svr4_time32_t;
59 typedef long svr4_blkcnt_t;
60 typedef u_long svr4_fsblkcnt_t;
61 typedef char *svr4_caddr_t;
62 typedef u_long svr4_size_t;
63
64 typedef short svr4_o_dev_t;
65 typedef short svr4_o_pid_t;
66 typedef u_short svr4_o_ino_t;
67 typedef u_short svr4_o_mode_t;
68 typedef short svr4_o_nlink_t;
69 typedef u_short svr4_o_uid_t;
70 typedef u_short svr4_o_gid_t;
71 typedef long svr4_clock_t;
72 typedef int svr4_key_t;
73
74 #ifdef _LP64
75 /*
76 * Solaris uses a `long' time_t.
77 */
78 typedef struct {
79 svr4_time_t tv_sec; /* seconds */
80 long tv_nsec; /* and nanoseconds */
81 } svr4_timestruc_t;
82 #else
83 typedef struct timespec svr4_timestruc_t;
84 #endif
85
86 #define svr4_omajor(x) ((int32_t)((((x) & 0x7f00) >> 8)))
87 #define svr4_ominor(x) ((int32_t)((((x) & 0x00ff) >> 0)))
88 #define svr4_omakedev(x,y) ((svr4_o_dev_t)((((x) << 8) & 0x7f00) | \
89 (((y) << 0) & 0x00ff)))
90 #define svr4_to_bsd_odev_t(d) makedev(svr4_omajor(d), svr4_ominor(d))
91 #define bsd_to_svr4_odev_t(d) svr4_omakedev(major(d), minor(d))
92
93 #define svr4_major(x) ((int32_t)((((x) & 0xfffc0000) >> 18)))
94 #define svr4_minor(x) ((int32_t)((((x) & 0x0003ffff) >> 0)))
95 #define svr4_makedev(x,y) ((svr4_dev_t)((((x) << 18) & 0xfffc0000) | \
96 (((y) << 0) & 0x0003ffff)))
97 #define svr4_to_bsd_dev_t(d) makedev(svr4_major(d), svr4_minor(d))
98 #define bsd_to_svr4_dev_t(d) svr4_makedev(major(d), minor(d))
99
100 #endif /* !_SVR4_TYPES_H_ */
Cache object: 75d642d7b53d812a4ced6351c006b0e8
|