2 * Copyright (c) 1982, 1986, 1991, 1993
\r
3 * The Regents of the University of California. All rights reserved.
\r
4 * (c) UNIX System Laboratories, Inc.
\r
5 * All or some portions of this file are derived from material licensed
\r
6 * to the University of California by American Telephone and Telegraph
\r
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
\r
8 * the permission of UNIX System Laboratories, Inc.
\r
10 * Redistribution and use in source and binary forms, with or without
\r
11 * modification, are permitted provided that the following conditions
\r
13 * 1. Redistributions of source code must retain the above copyright
\r
14 * notice, this list of conditions and the following disclaimer.
\r
15 * 2. Redistributions in binary form must reproduce the above copyright
\r
16 * notice, this list of conditions and the following disclaimer in the
\r
17 * documentation and/or other materials provided with the distribution.
\r
18 * 3. All advertising materials mentioning features or use of this software
\r
19 * must display the following acknowledgement:
\r
20 * This product includes software developed by the University of
\r
21 * California, Berkeley and its contributors.
\r
22 * 4. Neither the name of the University nor the names of its contributors
\r
23 * may be used to endorse or promote products derived from this software
\r
24 * without specific prior written permission.
\r
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
\r
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
\r
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
\r
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
\r
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
\r
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
\r
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
\r
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
\r
38 * @(#)types.h 8.4 (Berkeley) 1/21/94
\r
39 * $FreeBSD: src/sys/i386/boot/dosboot/types.h,v 1.6 1999/12/29 04:32:52 peter Exp $
\r
40 * $DragonFly: src/sys/i386/boot/dosboot/Attic/types.h,v 1.2 2003/06/17 04:28:34 dillon Exp $
\r
43 #ifndef _SYS_TYPES_H_
\r
44 #define _SYS_TYPES_H_
\r
48 /* Machine type dependent parameters. */
\r
51 #ifndef _POSIX_SOURCE
\r
52 typedef unsigned char u_char;
\r
53 typedef unsigned short u_short;
\r
54 typedef unsigned int u_int;
\r
55 typedef unsigned long u_long;
\r
56 typedef unsigned short ushort; /* Sys V compatibility */
\r
57 typedef unsigned int uint; /* Sys V compatibility */
\r
64 typedef struct __help__ u_quad_t; /* quads */
\r
65 typedef struct __help__ quad_t;
\r
66 typedef quad_t * qaddr_t;
\r
68 typedef char * caddr_t; /* core address */
\r
69 typedef long daddr_t; /* disk address */
\r
70 typedef unsigned short dev_t; /* device number (cg: was u_long) */
\r
71 typedef unsigned long fixpt_t; /* fixed point number */
\r
72 typedef unsigned short gid_t; /* group id */
\r
73 typedef unsigned long ino_t; /* inode number */
\r
74 typedef unsigned short mode_t; /* permissions */
\r
75 typedef unsigned short nlink_t; /* link count */
\r
76 typedef long off_t; /* file offset (cg: was quad) */
\r
77 typedef long pid_t; /* process id */
\r
78 typedef long segsz_t; /* segment size */
\r
79 typedef long swblk_t; /* swap offset */
\r
80 typedef unsigned short uid_t; /* user id */
\r
83 * This belongs in unistd.h, but is placed here to ensure that programs
\r
84 * casting the second parameter of lseek to off_t will get the correct
\r
89 off_t lseek __P((int, off_t, int));
\r
93 #ifndef _POSIX_SOURCE
\r
95 * minor() gives a cookie instead of an index since we don't want to
\r
96 * change the meanings of bits 0-15 or waste time and space shifting
\r
97 * bits 16-31 for devices that don't use them.
\r
99 #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
\r
100 #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
\r
101 #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) /* create dev_t */
\r
105 /*#include <machine/types.h>*/
\r
107 #ifdef _BSD_CLOCK_T_
\r
108 typedef _BSD_CLOCK_T_ clock_t;
\r
109 #undef _BSD_CLOCK_T_
\r
112 #ifdef _BSD_SIZE_T_
\r
113 typedef _BSD_SIZE_T_ size_t;
\r
114 #undef _BSD_SIZE_T_
\r
117 #ifdef _BSD_SSIZE_T_
\r
118 typedef _BSD_SSIZE_T_ ssize_t;
\r
119 #undef _BSD_SSIZE_T_
\r
122 #ifdef _BSD_TIME_T_
\r
123 typedef _BSD_TIME_T_ time_t;
\r
124 #undef _BSD_TIME_T_
\r
127 #ifndef _POSIX_SOURCE
\r
128 #define NBBY 8 /* number of bits in a byte */
\r
131 * Select uses bit masks of file descriptors in longs. These macros
\r
132 * manipulate such bit fields (the filesystem macros use chars).
\r
133 * FD_SETSIZE may be defined by the user, but the default here should
\r
134 * be enough for most uses.
\r
137 #define FD_SETSIZE 256
\r
140 typedef long fd_mask;
\r
141 #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
\r
144 #define howmany(x, y) (((x)+((y)-1))/(y))
\r
147 typedef struct fd_set {
\r
148 fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
\r
151 #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
\r
152 #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
\r
153 #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
\r
154 #define FD_COPY(f, t) bcopy(f, t, sizeof(*(f)))
\r
155 #define FD_ZERO(p) bzero(p, sizeof(*(p)))
\r
157 #if defined(__STDC__) && defined(_KERNEL)
\r
159 * Forward structure declarations for function prototypes. We include the
\r
160 * common structures that cross subsystem boundaries here; others are mostly
\r
161 * used in the same place that the structure is defined.
\r
173 typedef long time_t;
\r
175 #endif /* !_POSIX_SOURCE */
\r
176 #endif /* !_SYS_TYPES_H_ */
\r