TYPES(5) — Unix Programmer’s Manual
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:
/∗
∗ 5799-WZQ (C) COPYRIGHT = NONE
∗ LICENSED MATERIALS - PROPERTY OF IBM
∗/
/∗ $Header:types.h 12.0$ ∗/
/∗ $ACIS:types.h 12.0$ ∗/
/∗ $Source: /ibm/acis/usr/sys/h/RCS/types.h,v $ ∗/
#ifndef _TYPES_
#define_TYPES_
#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
static char ∗rcsidtypes = "$Header:types.h 12.0$";
#endif
/∗
∗ Copyright (c) 1982, 1986 Regents of the University of California.
∗ All rights reserved. The Berkeley software License Agreement
∗ specifies the terms and conditions for redistribution.
∗
∗@(#)types.h7.1 (Berkeley) 6/4/86
∗/
/∗
∗ Basic system types and major/minor device constructing/busting macros.
∗/
/∗ 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 ∗/
#ifdef vax
typedefstruct_physadr { int r[1]; } ∗physadr;
typedefstructlabel_t {
intval[14];
} label_t;
#endif vax
#ifdefined(ibm032) || defined(ibm370)
typedefstruct_physadr { int r[1]; } ∗physadr;
typedefstructlabel_t {
intval[11];
} label_t;
#endif /∗ defined(ibm032) || defined(ibm370) ∗/
typedefstruct_quad { long val[2]; } quad;
typedeflongdaddr_t;
typedefchar ∗caddr_t;
typedefu_longino_t;
typedeflongswblk_t;
typedeflongsize_t;
typedeflongtime_t;
typedefshortdev_t;
typedeflongoff_t;
typedefu_shortuid_t;
typedefu_shortgid_t;
#ifdef __STDC__
typedef signed char prio_t; /∗ priorities must be signed ∗/
#else
typedef char prio_t;
#endif
#defineNBBY8/∗ 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).
∗/
#ifndefFD_SETSIZE
#defineFD_SETSIZE256
#endif
typedef longfd_mask;
#define NFDBITS(sizeof(fd_mask) ∗ NBBY) /∗ bits per mask ∗/
#ifndef howmany
#definehowmany(x, y)(((x)+((y)-1))/(y))
#endif
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)))
#ifdef ibm032
/∗
∗ build a queue type appropriate to the particular machine
∗ for historical reasons we use "caddr_t" on non-ibm032 machines.
∗/
typedef struct qhdr {
struct qhdr ∗link, ∗rlink;
} ∗queue_t;
#else ibm032
typedef caddr_t queue_t;
#endif ibm032
#endif
The form daddr_t is used for disk addresses except in an i-node on disk, see fs(5). 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(5), time(3), lseek(2), adb(1)
4th Berkeley Distribution — May 15, 1985