TYPES(5) BSD 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 Domain/OS BSD
system code; some data of these types are accessible to user code.
The following data types are defined if including <sys/types.h> and
compiling with the -A ansi cc(1) option:
typedef long dev_t; /* <old device number> type */
typedef unsigned long ino_t; /* <inode> type */
typedef unsigned long mode_t; /* file attributes */
typedef short nlink_t; /* link count */
typedef int __gid_t;
typedef long __off_t;
typedef int __pid_t;
typedef long ssize_t;
typedef unsigned long size_t;
typedef int __uid_t;
typedef __gid_t gid_t; /* group ID */
typedef __off_t off_t; /* <offset> type */
typedef __pid_t pid_t; /* process id/process group id*/
typedef __uid_t uid_t; /* user ID */
typedef long daddr_t; /* <disk address> type */
typedef char * caddr_t; /* ?<core address> type */
typedef long swblk_t;
The following are defined in addition to the above, if the -A nansi or -A
xansi compiler option is used:
typedef long key_t; /* IPC key type */
typedef long clock_t;
typedef long time_t;
/* major part of a device */
#define major(x) ((int)(((unsigned)(x)>>9)&0x7FFFFF))
/* minor part of a device */
#define minor(x) ((int)((x)&0x1FF))
/* make a device number */
#define makedev(x,y) ((dev_t)(((x)<<9) | (y)))
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned short ushort; /* sys III compat */
typedef struct _quad { long val[2]; } quad;
#define NBBY 8 /* number of bits in a byte */
/*
* 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).
*/
#define FD_SETSIZE 256
typedef long fd_mask;
/* bits per mask */
#define NFDBITS (sizeof(fd_mask) * NBBY)
#define howmany(x, y) (((x)+((y)-1))/(y))
typedef struct fd_set {
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
typedef int oid_t; /* organization ID */
The form daddr_t is used for disk addresses except in an inode on disk.
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.
SEE ALSO
time(3), lseek(2)