Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ types(5) — SunOS 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

adb(1)

lseek(2)

time(3C)

fs(5)

TYPES(5)  —  FILE FORMATS

NAME

types − primitive system data types

SYNOPSIS

#include <sys/types.h>

DESCRIPTION

The data types defined in the include file are used in the system code; some data of these types are accessible to user code:

 /∗
 ∗ 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.
 ∗/
 #ifndef_TYPES_
#define_TYPES_
 /∗
 ∗ Basic system types.
 ∗/
 #include <sys/sysmacros.h>
 typedefunsigned char u_char;
typedefunsigned shortu_short;
typedefunsigned intu_int;
typedefunsigned longu_long;
typedefunsigned shortushort; /∗ System V compatibility ∗/
typedefunsigned intuint; /∗ System V compatibility ∗/
 #ifdef vax
typedefstruct_physadr { int r[1]; } ∗physadr;
typedefstructlabel_t {
intval[14];
} label_t;
#endif
#ifdef mc68000
typedefstruct_physadr { short r[1]; } ∗physadr;
typedefstructlabel_t {
intval[13];
} label_t;
#endif
#ifdef sparc
typedef struct  _physadr { int r[1]; } ∗physadr;
typedef struct label_t {
int     val[2];
} label_t;
#endif
#ifdef i386
typedef struct_physadr { short r[1]; } ∗physadr;
typedef structlabel_t {
intval[8];
} label_t;
#endif
typedefstruct_quad { long val[2]; } quad;
typedeflongdaddr_t;
typedefchar ∗caddr_t;
typedefu_longino_t;
typedeflongswblk_t;
typedefintsize_t;
typedeflongtime_t;
typedefshortdev_t;
typedeflongoff_t;
typedefu_shortuid_t;
typedefu_shortgid_t;
typedeflongkey_t;
 #defineNBBY 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).
 ∗/
#ifndefFD_SETSIZE
#defineFD_SETSIZE256
#endif
 typedeflongfd_mask;
#defineNFDBITS(sizeof(fd_mask) ∗ NBBY) /∗ bits per mask ∗/
#ifndefhowmany
#ifdef sun386
#define howmany(x, y)   ((((u_int)(x))+(((u_int)(y))-1))/((u_int)(y)))
#else
#definehowmany(x, y)(((x)+((y)-1))/(y))
#endif
#endif
 typedefstruct fd_set {
fd_maskfds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
 typedefchar ∗ addr_t;
 #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)))
#defineFD_ZERO(p)bzero((char ∗)(p), sizeof(∗(p)))
 #ifdef sparc
/∗
 ∗ routines that call setjmp have strange control flow graphs,
 ∗ since a call to a routine that calls resume/longjmp will eventually
 ∗ return at the setjmp site, not the original call site.  This
 ∗ utterly wrecks control flow analysis.
 ∗/
extern int setjmp();
#pragma unknown_control_flow(setjmp)
#endif sparc
 #endif_TYPES_

The form daddr_t is used for disk addresses, 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

adb(1), lseek(2), time(3C), fs(5)

Sun Release 4.0  —  Last change: 19 October 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026