types(5)
NAME
types − primitive system data types
SYNOPSIS
#include <sys/types.h>
DESCRIPTION
The data types defined in the include file are used in UNIX system code; some data of these types are accessible to user code:
#ifndef_TYPES_
#define_TYPES_
typedefunionlabel_t {
doublealign;
intval[19];
} label_t;
typedeflongdaddr_t;
typedefchar ∗caddr_t;
typedefunsigned longino_t;
typedeflongswblk_t;
typedef long off_t;
#ifndef _TIME_T_DEFINED
typedeflongtime_t;
#define _TIME_T_DEFINED
#endif /∗ _TIME_T_DEFINED ∗/
#ifndef _SIZE_T_DEFINED
typedefunsigned intsize_t;
#define _SIZE_T_DEFINED 1
#endif /∗ _SIZE_T_DEFINED ∗/
#ifndef _CLOCK_T_DEFINED
typedef longclock_t ;
#define _CLOCK_T_DEFINED 1
#endif /∗ _CLOCK_T_DEFINED ∗/
typedef shortcnt_t;/∗ count type ∗/
typedef unsigned charuse_t; /∗ use count for swap area ∗/
typedeflongpaddr_t; /∗ <physical address> type ∗/
typedef longkey_t;
typedef unsigned longdev_t;
typedef unsigned long gid_t;
typedef long pid_t;
typedef unsigned long mode_t;
typedef unsigned long uid_t;
typedef unsigned long nlink_t;
#ifndef _POSIX_SOURCE
/∗ major part of a device ∗/
#definemajor(x)((int)(((unsigned)(x)>>8)&0377))
/∗ minor part of a device ∗/
#defineminor(x)((int)((x)&0377))
/∗ make a device number ∗/
#definemakedev(x,y)((dev_t)(((x)<<8) | (y)))
typedefunsigned charu_char;
typedefunsigned shortu_short;
typedefunsigned intu_int;
typedefunsigned longu_long;
typedefunsigned shortushort; /∗ sys III compat ∗/
typedefunsigned intuint; /∗ sys III compat ∗/
typedefunsigned longulong; /∗ sys III compat ∗/
typedef inttid_t;
typedefstruct_physadr { int r[1]; } ∗physadr;
typedefstruct_quad { long val[2]; } quad;
#defineNBBY8/∗ number of bits in a byte ∗/
#undef TRUE
#define TRUE1
#undef FALSE
#define FALSE0
/∗
∗ Select uses bit masks of file descriptors in longs.
∗ These macros manipulate such bit fields (the filesystem macros use chars).
∗ FD_SETSIZE may be defined by the user, but the default here
∗ should be >= NOFILE (param.h).
∗/
#ifndefFD_SETSIZE
#defineFD_SETSIZE256
#endif /∗ !FD_SETSIZE ∗/
typedef longfd_mask;
#define NFDBITS(sizeof(fd_mask) ∗ NBBY) /∗ bits per mask ∗/
#ifndef howmany
#definehowmany(x, y)(((x)+((y)-1))/(y))
#endif /∗ !howmany ∗/
typedefstruct fd_set {
fd_maskfds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
#defineFD_SET(n, p)((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#defineFD_CLR(n, p)((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#defineFD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p)bzero((char ∗)(p), sizeof(∗(p)))
#endif /∗ !_POSIX_SOURCE ∗/
#endif /∗ !_TYPES_ ∗/
The form daddr_t is used for disk addresses except in an i-node on disk, see fs(4). Times are encoded in seconds since 00:00:00 GMT, January 1, 1970. The major and minor parts of a device code specify kind and unit number of a device and are installation-dependent. Offsets are measured in bytes from the beginning of a file. The label_t variables are used to save the processor state while another process is running.
SEE ALSO
fs(4), time(2), lseek(2), adb(1)
CX/UX Programmer’s Reference Manual