Pristine Ack-5.5
[Ack-5.5.git] / lib / minix / include / sys / types.h
1 /* The <sys/types.h> header contains important data type definitions.
2  * It is considered good programming practice to use these definitions, 
3  * instead of the underlying base type.  By convention, all type names end 
4  * with _t.
5  */
6
7 #ifndef _TYPES_H
8 #define _TYPES_H
9
10 /* The type size_t holds the result of the size_of operator.  This type is
11  * 'unsigned int', in order to be compatible with the old library (f.i. the
12  * argument of malloc was an unsigned int, and is now a size_t).  This means
13  * that a 70K array can not be allocated.
14  */
15 #ifndef _SIZE_T
16 #define _SIZE_T
17 typedef unsigned int size_t;    /* type returned by sizeof */
18 #endif
19
20 #ifndef _TIME_T
21 #define _TIME_T
22 typedef long time_t;            /* time in sec since 1 Jan 1970 0000 GMT */
23 #endif
24
25 typedef unsigned char   u_char;
26 typedef unsigned short  u_short;
27 typedef unsigned int    u_int;
28 typedef unsigned long   u_long;
29
30 /* system V compatibility: */
31 typedef unsigned int    uint;
32 typedef unsigned short  ushort;
33 typedef unsigned char   uchar_t;
34 typedef short           cnt_t;
35 typedef long            paddr_t;
36 typedef long            key_t;
37
38 /* Types used in disk, inode, etc. data structures. */
39 typedef short          dev_t;   /* holds (major|minor) device pair */
40 typedef char           gid_t;   /* group id */
41 typedef unsigned short ino_t;   /* i-node number */
42 typedef short         mode_t;   /* mode number within an i-node */
43 typedef char         nlink_t;   /* number-of-links field within an i-node */
44 typedef long           off_t;   /* offsets within a file */
45 typedef int            pid_t;   /* type for pids (must be signed) */
46 typedef short          uid_t;   /* user id */
47 typedef long          zone_t;   /* holds a zone number */
48 typedef long         block_t;   /* block number */
49 typedef long           bit_t;   /* used for bit number in a bit map */
50
51 /* The following types are needed because MINIX uses K&R style function
52  * definitions (for maximum portability).  When a short, such as dev_t, is
53  * passed to a function with a K&R definition, the compiler automatically
54  * promotes it to an int.  The prototype must contain an int as the parameter,
55  * not a short, because an int is what an old-style function definition
56  * expects.  Thus using dev_t in a prototype would be incorrect.  It would be
57  * sufficient to just use int instead of dev_t in the prototypes, but Dev_t
58  * is clearer.
59  */
60 typedef int     Dev_t;
61 typedef int     Mode_t;
62
63 #endif /* _TYPES_H */