Remove kerberosIV from the build.
[dragonfly.git] / share / man / man5 / types.5
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)types.5     8.1 (Berkeley) 6/5/93
33 .\" $FreeBSD: src/share/man/man5/types.5,v 1.10.2.2 2001/12/17 11:30:15 ru Exp $
34 .\" $DragonFly: src/share/man/man5/Attic/types.5,v 1.2 2003/06/17 04:37:00 dillon Exp $
35 .\"
36 .Dd June 5, 1993
37 .Dt TYPES 5
38 .Os
39 .Sh NAME
40 .Nm types
41 .Nd system data types
42 .Sh SYNOPSIS
43 .In sys/types.h
44 .Sh DESCRIPTION
45 The file
46 .Pa sys/types.h
47 contains the defined data types used in the kernel (most are
48 used through out the system).
49 .Bd -literal
50 #ifndef _SYS_TYPES_H_
51 #define _SYS_TYPES_H_
52
53 #include <sys/cdefs.h>
54
55 /* Machine type dependent parameters. */
56 #include <sys/inttypes.h>               /* includes <machine/ansi.h> */
57 #include <machine/types.h>
58
59 #ifndef _POSIX_SOURCE
60 typedef unsigned char   u_char;
61 typedef unsigned short  u_short;
62 typedef unsigned int    u_int;
63 typedef unsigned long   u_long;
64 typedef unsigned short  ushort;         /* Sys V compatibility */
65 typedef unsigned int    uint;           /* Sys V compatibility */
66 #endif
67
68 typedef __uint8_t       u_int8_t;
69 typedef __uint16_t      u_int16_t;
70 typedef __uint32_t      u_int32_t;
71 typedef __uint64_t      u_int64_t;
72
73 typedef u_int64_t       u_quad_t;       /* quads */
74 typedef int64_t         quad_t;
75 typedef quad_t *        qaddr_t;
76
77 typedef char *          caddr_t;        /* core address */
78 typedef __const char *  c_caddr_t;      /* core address, pointer to const */
79 typedef __volatile char *v_caddr_t;     /* core address, pointer to volatile */
80 typedef int32_t         daddr_t;        /* disk address */
81 typedef u_int32_t       u_daddr_t;      /* unsigned disk address */
82 typedef u_int32_t       fixpt_t;        /* fixed point number */
83 typedef u_int32_t       gid_t;          /* group id */
84 typedef u_int32_t       ino_t;          /* inode number */
85 typedef long            key_t;          /* IPC key (for Sys V IPC) */
86 typedef u_int16_t       mode_t;         /* permissions */
87 typedef u_int16_t       nlink_t;        /* link count */
88 typedef _BSD_OFF_T_     off_t;          /* file offset */
89 typedef _BSD_PID_T_     pid_t;          /* process id */
90 typedef quad_t          rlim_t;         /* resource limit */
91 #ifdef __alpha__                /* XXX should be in <machine/types.h> */
92 typedef int64_t         segsz_t;        /* segment size */
93 #else
94 typedef int32_t         segsz_t;        /* segment size */
95 #endif
96 typedef int32_t         swblk_t;        /* swap offset */
97 typedef int32_t         ufs_daddr_t;
98 typedef u_int32_t       uid_t;          /* user id */
99
100 #ifdef _KERNEL
101 typedef int             boolean_t;
102 typedef u_int64_t       uoff_t;
103 typedef struct vm_page  *vm_page_t;
104 #endif
105
106 #ifdef _KERNEL
107
108 struct specinfo;
109
110 typedef u_int32_t       udev_t;         /* device number */
111 typedef struct specinfo *dev_t;
112
113 #else /* !_KERNEL */
114
115 typedef u_int32_t       dev_t;          /* device number */
116 #define udev_t dev_t
117
118 #ifndef _POSIX_SOURCE
119
120 /*
121  * minor() gives a cookie instead of an index since we don't want to
122  * change the meanings of bits 0-15 or waste time and space shifting
123  * bits 16-31 for devices that don't use them.
124  */
125 #define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
126 #define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
127 #define makedev(x,y)    ((dev_t)(((x) << 8) | (y)))     /* create dev_t */
128
129 #endif /* _POSIX_SOURCE */
130
131 #endif /* !_KERNEL */
132
133 #include <machine/endian.h>
134
135 #ifdef  _BSD_CLOCK_T_
136 typedef _BSD_CLOCK_T_   clock_t;
137 #undef  _BSD_CLOCK_T_
138 #endif
139
140 #ifdef  _BSD_CLOCKID_T_
141 typedef _BSD_CLOCKID_T_ clockid_t;
142 #undef  _BSD_CLOCKID_T_
143 #endif
144
145 #ifdef  _BSD_SIZE_T_
146 typedef _BSD_SIZE_T_    size_t;
147 #undef  _BSD_SIZE_T_
148 #endif
149
150 #ifdef  _BSD_SSIZE_T_
151 typedef _BSD_SSIZE_T_   ssize_t;
152 #undef  _BSD_SSIZE_T_
153 #endif
154
155 #ifdef  _BSD_TIME_T_
156 typedef _BSD_TIME_T_    time_t;
157 #undef  _BSD_TIME_T_
158 #endif
159
160 #ifdef  _BSD_TIMER_T_
161 typedef _BSD_TIMER_T_   timer_t;
162 #undef  _BSD_TIMER_T_
163 #endif
164
165 #ifndef _POSIX_SOURCE
166 #define NBBY    8               /* number of bits in a byte */
167
168 /*
169  * Select uses bit masks of file descriptors in longs.  These macros
170  * manipulate such bit fields (the filesystem macros use chars).
171  * FD_SETSIZE may be defined by the user, but the default here should
172  * be enough for most uses.
173  */
174 #ifndef FD_SETSIZE
175 #define FD_SETSIZE      1024
176 #endif
177
178 typedef long    fd_mask;
179 #define NFDBITS (sizeof(fd_mask) * NBBY)        /* bits per mask */
180
181 #ifndef howmany
182 #define howmany(x, y)   (((x) + ((y) - 1)) / (y))
183 #endif
184
185 typedef struct fd_set {
186         fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
187 } fd_set;
188
189 #define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
190 #define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
191 #define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
192 #define FD_COPY(f, t)   bcopy(f, t, sizeof(*(f)))
193 #define FD_ZERO(p)      bzero(p, sizeof(*(p)))
194
195 /*
196  * These declarations belong elsewhere, but are repeated here and in
197  * <stdio.h> to give broken programs a better chance of working with
198  * 64-bit off_t's.
199  */
200 #ifndef _KERNEL
201 __BEGIN_DECLS
202 #ifndef _FTRUNCATE_DECLARED
203 #define _FTRUNCATE_DECLARED
204 int      ftruncate __P((int, off_t));
205 #endif
206 #ifndef _LSEEK_DECLARED
207 #define _LSEEK_DECLARED
208 off_t    lseek __P((int, off_t, int));
209 #endif
210 #ifndef _MMAP_DECLARED
211 #define _MMAP_DECLARED
212 void *   mmap __P((void *, size_t, int, int, int, off_t));
213 #endif
214 #ifndef _TRUNCATE_DECLARED
215 #define _TRUNCATE_DECLARED
216 int      truncate __P((const char *, off_t));
217 #endif
218 __END_DECLS
219 #endif /* !_KERNEL */
220
221 #endif /* !_POSIX_SOURCE */
222
223 #endif /* !_SYS_TYPES_H_ */
224 .Ed
225 .Sh SEE ALSO
226 .Xr gdb 1 ,
227 .Xr lseek 2 ,
228 .Xr time 3 ,
229 .Xr fs 5
230 .Sh HISTORY
231 A
232 .Nm
233 file appeared in
234 .At v7 .