[comp.os.minix] MINIX ANSI/POSIX/other headers, part 1 of 2

ast@cs.vu.nl (Andy Tanenbaum) (10/26/89)

: This is a shar archive.  Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'a.out.h'
sed 's/^X//' > 'a.out.h' << '+ END-OF-FILE ''a.out.h'
X/* The <a.out> header file describes the format of executable files. */
X
Xstruct	exec {			/* a.out header */
X	unsigned char	a_magic[2];	/* magic number */
X	unsigned char	a_flags;	/* flags, see below */
X	unsigned char	a_cpu;		/* cpu id */
X	unsigned char	a_hdrlen;	/* length of header */
X	unsigned char	a_unused;	/* reserved for future use */
X	unsigned short	a_version;	/* version stamp */	
X				/* not used */
X	long		a_text;		/* size of text segement in bytes */
X	long		a_data;		/* size of data segment in bytes */
X	long		a_bss;		/* size of bss segment in bytes */
X	long		a_no_entry;	/* in fact: entry point, a_entry */
X	long		a_total;	/* total memory allocated */
X	long		a_syms;		/* size of symbol table */
X				/* SHORT FORM ENDS HERE */
X	long		a_trsize;	/* text relocation size */
X	long		a_drsize;	/* data relocation size */
X	long		a_tbase;	/* text relocation base */
X	long		a_dbase;	/* data relocation base */
X};
X
X#define A_MAGIC0	(unsigned char) 0x01
X#define A_MAGIC1	(unsigned char) 0x03
X#define BADMAG(X)	((X).a_magic[0] != A_MAGIC0 ||\
X			 (X).a_magic[1] != A_MAGIC1)
X
X/* CPU Id of TARGET machine */
X	/* byte order coded in low order two bits */
X#define A_NONE	0x00	/* unknown */
X#define A_I8086	0x04	/* intel i8086/8088 */
X#define A_M68K	0x0B	/* motorola m68000 */
X#define A_NS16K	0x0C	/* national semiconductor 16032 */
X
X#define A_BLR(cputype)	((cputype&0x01)!=0) /* TRUE if bytes left-to-right */
X#define A_WLR(cputype)	((cputype&0x02)!=0) /* TRUE if words left-to-right */
X
X/* flags: */
X#define A_EXEC	0x10	/* executable */
X#define A_SEP	0x20	/* separate I/D */
X#define A_PURE	0x40	/* pure text */		/* not used */
X#define A_TOVLY	0x80	/* text overlay */	/* not used */
X
X/* offsets of various things: */
X#define A_MINHDR	32
X#define	A_TEXTPOS(X)	((long)(X).a_hdrlen)
X#define A_DATAPOS(X)	(A_TEXTPOS(X) + (X).a_text)
X#define	A_HASRELS(X)	((X).a_hdrlen > (unsigned char) A_MINHDR)
X#define A_HASEXT(X)	((X).a_hdrlen > (unsigned char) (A_MINHDR +  8))
X#define A_HASLNS(X)	((X).a_hdrlen > (unsigned char) (A_MINHDR + 16))
X#define A_HASTOFF(X)	((X).a_hdrlen > (unsigned char) (A_MINHDR + 24))
X#define A_TRELPOS(X)	(A_DATAPOS(X) + (X).a_data)
X#define A_DRELPOS(X)	(A_TRELPOS(X) + (X).a_trsize)
X#define A_SYMPOS(X)	(A_TRELPOS(X) + (A_HASRELS(X) ? \
X				((X).a_trsize + (X).a_drsize) : 0))
X
Xstruct reloc {
X	long		r_vaddr;	/* virtual address of reference */
X	unsigned short	r_symndx;	/* internal segnum or extern symbol num */
X	unsigned short	r_type;		/* relocation type */
X};
X
X/* r_tyep values: */
X#define R_ABBS		0
X#define R_RELLBYTE	2
X#define R_PCRBYTE	3
X#define R_RELWORD	4
X#define R_PCRWORD	5
X#define R_RELLONG	6
X#define R_PCRLONG	7
X#define R_REL3BYTE	8
X#define R_KBRANCHE	9
X
X/* r_symndx for internal segments */
X#define S_ABS		((unsigned short)-1)
X#define S_TEXT		((unsigned short)-2)
X#define S_DATA		((unsigned short)-3)
X#define S_BSS		((unsigned short)-4)
X
Xstruct nlist {			/* symbol table entry */
X	char	 	n_name[8];	/* symbol name */
X	long	 	n_value;	/* value */
X	unsigned char	n_sclass;	/* storage class */
X	unsigned char	n_numaux;	/* number of auxiliary entries */
X						/* not used */
X	unsigned short	n_type;		/* language base and derived type */
X						/* not used */
X};
X
X/* low bits of storage class (section) */
X#define	N_SECT		  07	/* section mask */
X#define N_UNDF		  00	/* undefined */
X#define N_ABS		  01	/* absolute */
X#define N_TEXT		  02	/* text */
X#define N_DATA		  03	/* data */
X#define	N_BSS		  04	/* bss */
X#define N_COMM		  05	/* (common) */
X
X/* high bits of storage class */
X#define N_CLASS		0370	/* storage class mask */
X#define C_NULL
X#define C_EXT		0020	/* external symbol */
X#define C_STAT		0030	/* static */
X	/* there are many others, but they are not supported */
+ END-OF-FILE a.out.h
chmod 'u=rw,g=r,o=r' 'a.out.h'
set `wc -c 'a.out.h'`
count=$1
case $count in
3694)	:;;
*)	echo 'Bad character count in ''a.out.h' >&2
		echo 'Count should be 3694' >&2
esac
echo Extracting 'ansi.h'
sed 's/^X//' > 'ansi.h' << '+ END-OF-FILE ''ansi.h'
X/* MINIX is copyright 1989 Prentice-Hall, Inc. */
X
X/* The <ansi.h> header defines two macros that can be tested to determine
X * whether prototypes should be included in the other header files.  Three
X * cases are relevant:
X *
X *	_USE_ANSI_PROTOTYPES	- Use ANSI C prototypes
X *	_USE_OLD_PROTOTYPES	- Use traditional Kernighan & Ritchie style
X *	(neither)		- No prototypes (when compiling the kernel)
X *
X * Note that K & R prototypes may be omitted for functions returning 'int'.
X */
X
X/* _ANSI_H defined the first time this file is included. */
X#ifndef _ANSI_H
X#define _ANSI_H
X#endif
X
X/* ANSI C requires __STDC__ to be defined as 1 for an ANSI C compiler.
X * Some half-ANSI compilers define it as 0.  Get around this here.
X */
X
X#define _USE_ANSI_PROTOTYPES 0	/* 0 means do not use ANSI C prototypes */
X#define _USE_OLD_PROTOTYPES  0	/* 0 means do not use K & R prototypes */
X
X#ifndef _KERNEL			/* if _KERNEL is defined, leave them 0 */
X
X#ifdef __STDC__			/* __STDC__ defined for (near) ANSI compilers*/
X#if __STDC__ == 1		/* __STDC__ == 1 for conformant compilers */
X#undef _USE_ANSI_PROTOTYPES	/* get rid of old definition (0) */
X#define _USE_ANSI_PROTOTYPES 1	/* install new definition (1) */
X#endif
X#endif
X
X#endif
X
X/* When installing this file on your system, you might consider making a
X * backup of it, and then removing all the comments from the original to speed
X * up compilation, as this file is included a great deal.
X */
+ END-OF-FILE ansi.h
chmod 'u=rw,g=r,o=r' 'ansi.h'
set `wc -c 'ansi.h'`
count=$1
case $count in
1430)	:;;
*)	echo 'Bad character count in ''ansi.h' >&2
		echo 'Count should be 1430' >&2
esac
echo Extracting 'ar.h'
sed 's/^X//' > 'ar.h' << '+ END-OF-FILE ''ar.h'
X/* The <ar.h> header gives the layout of archives. */
X
X#define	ARMAG	0177545
X
Xstruct ar_hdr {
X	char	ar_name[14];
X	long	ar_date;
X	char	ar_uid;
X	char	ar_gid;
X	int	ar_mode;
X	long	ar_size;
X};
+ END-OF-FILE ar.h
chmod 'u=rw,g=r,o=r' 'ar.h'
set `wc -c 'ar.h'`
count=$1
case $count in
188)	:;;
*)	echo 'Bad character count in ''ar.h' >&2
		echo 'Count should be 188' >&2
esac
echo Extracting 'assert.h'
sed 's/^X//' > 'assert.h' << '+ END-OF-FILE ''assert.h'
X/* The <assert.h> header contains a macro called "assert" that allows 
X * programmers to put assertions in the code.  These assertions can be verified
X * at run time.  If an assertion fails, an error message is printed.  
X * Assertion checking can be disabled by adding the statement
X *
X *	#define NDEBUG
X *
X * to the program before the 
X *
X *	#include <assert.h>
X *
X * statement.
X */
X
X#ifdef assert
X#undef assert			/* make this file idempotent */
X#endif
X
X#ifdef NDEBUG
X/* Debugging disabled -- do not evaluate assertions. */
X#define assert(expr)  ((void) 0)
X#else
X/* Debugging enabled -- verify assertions at run time. */
X#define assert(expr)  if(!(expr)) __assert(__FILE__,  __LINE__)
X#endif
+ END-OF-FILE assert.h
chmod 'u=rw,g=r,o=r' 'assert.h'
set `wc -c 'assert.h'`
count=$1
case $count in
694)	:;;
*)	echo 'Bad character count in ''assert.h' >&2
		echo 'Count should be 694' >&2
esac
echo Extracting 'ctype.h'
sed 's/^X//' > 'ctype.h' << '+ END-OF-FILE ''ctype.h'
X/* The <ctype.h> header file defines some macros used to identify characters.
X * It works by using a table stored in ctype.c.  When a character is presented
X * to one of these macros, the character is used as an index into the table
X * (_ctype_) to retrieve a byte.  The relevant bit is then extracted.
X */
X
X#ifndef _CTYPE_H
X#define _CTYPE_H
X
Xextern	char	__ctype[];	/* located in ctype.c */
X
X#define _U		0001	/* this bit is for upper-case letters [A-Z] */
X#define _L		0002	/* this bit is for lower-case letters [a-z] */
X#define _N		0004	/* this bit is for numbers [0-9] */
X#define _S		0010	/* this bit is for white space \t \n \f etc */
X#define _P		0020	/* this bit is for punctuation characters */
X#define _C		0040	/* this bit is for control characters */
X#define _X		0100	/* this bit is for hex digits [a-f] and [A-F]*/
X#define _SP		0200	/* this bit is for the space character only */
X
X/* Declare ANSI prototypes (except when compiling kernel).*/
X#ifndef _ANSI_H
X#include <ansi.h>
X#endif
X
X#if _USE_ANSI_PROTOTYPES	/* function prototypes required by ANSI C */
Xint isalpha(int  __c);		/* alphanumeric */
Xint isdigit(int  __c);		/* digit [0-9] */
Xint islower(int  __c);		/* lower-case letter [a-z] */
Xint isspace(int  __c);		/* white space sp, \f, \n, \r, \t, \v */
Xint isupper(int  __c);		/* upper-case letter [A-Z] */
Xint isxdigit(int __c);		/* hex digit [0-9], [a-f], [A-F] */
Xint isalnum(int  __c);		/* alphanumeric [a-z], [A-Z], [0-9] */
Xint iscntrl(int  __c);		/* control characters */
Xint isgraph(int  __c);		/* graphic character */
Xint isprint(int  __c);		/* printable character */
Xint ispunct(int  __c);		/* punctuation mark */
Xint tolower(int  __c);		/* convert upper case to lower case */
Xint toupper(int  __c);		/* convert lower case to upper case */
X#endif
X
X/* K&R prototypes are not needed for functions returning an 'int'. */
X
X/* Macros for idenitifying character classes. */
X#define isalpha(c)	((__ctype+1)[c]&(_U|_L))
X#define isdigit(c)	((__ctype+1)[c]&_N)
X#define islower(c)	((__ctype+1)[c]&_L)
X#define isspace(c)	((__ctype+1)[c]&_S)
X#define isupper(c)	((__ctype+1)[c]&_U)
X#define isxdigit(c)	((__ctype+1)[c]&(_N|_X))
X#define isalnum(c)	((__ctype+1)[c]&(_U|_L|_N))
X#define iscntrl(c)	((__ctype+1)[c]&_C)
X#define isgraph(c)	((__ctype+1)[c]&(_P|_U|_L|_N))
X#define isprint(c)	((__ctype+1)[c]&(_SP|_P|_U|_L|_N))
X#define ispunct(c)	((__ctype+1)[c]&_P)
X#define toupper(c)	(islower(c) ? (c & 0xDF) : c)
X#define tolower(c)	(isupper(c) ? (c | 0x20) : c)
X
X#endif /* _CTYPE_H */
+ END-OF-FILE ctype.h
chmod 'u=rw,g=r,o=r' 'ctype.h'
set `wc -c 'ctype.h'`
count=$1
case $count in
2485)	:;;
*)	echo 'Bad character count in ''ctype.h' >&2
		echo 'Count should be 2485' >&2
esac
echo Extracting 'dirent.h'
sed 's/^X//' > 'dirent.h' << '+ END-OF-FILE ''dirent.h'
X/* The <dirent.h> header file is for POSIX.  It is used by the opendir(), 
X * readdir(), writedir(), and related procedure calls.  This header requires
X * <sys/types.h>.
X */
X
X/* DIRBUF must in general be larger than the filesystem buffer size. */
X#define	_DIRBUF		2048	/* buffer size for fs-indep. dirs */
X#define _DIR_MAGIC     19997	/* arbitrary number for marking DIRs */
X
X/* The DIR structure is used for all the directory operations. */
Xtypedef struct {
X int dd_fd;			/* file descriptor */
X int dd_loc;			/* offset in block */
X int dd_size;			/* amount of valid data */
X int dd_magic;			/* magic number to recognize DIRs */
X char *dd_buf;			/* -> directory block */
X} DIR;				/* stream data from opendir() */
X
X
Xstruct dirent {			/* data from getdents()/readdir() */
X  long d_ino;			/* inode number of entry */
X  off_t d_off;			/* offset of disk directory entry */
X  unsigned short d_reclen;	/* length of this record */
X  char d_name[1];		/* name of file */ /* non-POSIX */
X};
X
X/* Declare ANSI or K&R prototypes (except when compiling kernel).*/
X#ifndef _ANSI_H
X#include <ansi.h>
X#endif
X
X#if _USE_ANSI_PROTOTYPES	/* function prototypes required by ANSI C */
XDIR *opendir(char *__dirname);
Xstruct dirent *readdir(DIR *__dirp);
Xvoid rewinddir(DIR *__dirp);
Xint closedir(DIR *__dirp);
X#endif
X
X#if _USE_OLD_PROTOTYPES		/* Kernighan and Ritchie C declarations. */
XDIR *opendir();
Xstruct dirent *readdir();
Xvoid rewinddir();
X#endif
+ END-OF-FILE dirent.h
chmod 'u=rw,g=r,o=r' 'dirent.h'
set `wc -c 'dirent.h'`
count=$1
case $count in
1430)	:;;
*)	echo 'Bad character count in ''dirent.h' >&2
		echo 'Count should be 1430' >&2
esac
echo Extracting 'errno.h'
sed 's/^X//' > 'errno.h' << '+ END-OF-FILE ''errno.h'
X/* The <errno.h> header defines the numbers of the various errors that can 
X * occur during program execution.  They are visible to user programs and 
X * should be small positive integers.  However, they are also used within 
X * MINIX, where they must be negative.  For example, the READ system call is 
X * executed internally by calling do_read().  This function returns either a 
X * (negative) error number or a (positive) number of bytes actually read.
X *
X * To solve the problem of having the error numbers be negative inside the
X * the system and positive outside, the following mechanism is used.  All the
X * definitions are are the form:
X *
X *	#define EPERM		(_SIGN 1)
X *
X * If the macro _KERNEL is defined, then  _SIGNis set to "-", otherwise it is
X * set to "".  Thus when compiling the operating system, the  macro _KERNEL
X * will be defined, setting EPERM to (- 1), whereas when when this
X * file is included in an ordinary user program, EPERM has the value ( 1).
X */
X
X#ifndef _ERROR_H		/* check if <errno.h> is already included */
X#define _ERROR_H		/* it is not included; note that fact */
X
X#define errno _errno		/* error numbers are stored here */
X
X/* Now define _SIGN as "" or "-" depending on _KERNEL. */
X#ifdef _KERNEL
X#   define _SIGN         -
X#   define OK                  0  /* OK means no error */
X#else
X#   define _SIGN         
X#endif
X
X/* Here are the numerical values of the error numbers. */
X#define _NERROR                39  /* number of errors */  
X
X#define ERROR         (_SIGN  1)  /* generic error */
X#define EPERM         (_SIGN  1)  /* operation not permitted */
X#define ENOENT        (_SIGN  2)  /* no such file or directory */
X#define ESRCH         (_SIGN  3)  /* no such process */
X#define EINTR         (_SIGN  4)  /* interrupted function call */
X#define EIO           (_SIGN  5)  /* input/output error */
X#define ENXIO         (_SIGN  6)  /* no such device or address */
X#define E2BIG         (_SIGN  7)  /* arg list too long */
X#define ENOEXEC       (_SIGN  8)  /* exec format error */
X#define EBADF         (_SIGN  9)  /* bad file descriptor */
X#define ECHILD        (_SIGN 10)  /* no child process */
X#define EAGAIN        (_SIGN 11)  /* resource temporarily unavailable */
X#define ENOMEM        (_SIGN 12)  /* not enough space */
X#define EACCES        (_SIGN 13)  /* permission denied */
X#define EFAULT        (_SIGN 14)  /* bad address */
X#define ENOTBLK       (_SIGN 15)  /* Extension: not a block special file */
X#define EBUSY         (_SIGN 16)  /* resource busy */
X#define EEXIST        (_SIGN 17)  /* file exists */
X#define EXDEV         (_SIGN 18)  /* improper link */
X#define ENODEV        (_SIGN 19)  /* no such device */
X#define ENOTDIR       (_SIGN 20)  /* not a directory */
X#define EISDIR        (_SIGN 21)  /* is a directory */
X#define EINVAL        (_SIGN 22)  /* invalid argument */
X#define ENFILE        (_SIGN 23)  /* too many open files in system */
X#define EMFILE        (_SIGN 24)  /* too many open files */
X#define ENOTTY        (_SIGN 25)  /* inappropriate I/O control operation */
X				  /* ETXTBSY was 26, is no longer used */
X#define EFBIG         (_SIGN 27)  /* file too large */
X#define ENOSPC        (_SIGN 28)  /* no space left on device */
X#define ESPIPE        (_SIGN 29)  /* invalid seek */
X#define EROFS         (_SIGN 30)  /* read-only file system */
X#define EMLINK        (_SIGN 31)  /* too many links */
X#define EPIPE         (_SIGN 32)  /* broken pipe */
X#define EDOM          (_SIGN 33)  /* domain error     (from ANSI C standard) */
X#define ERANGE        (_SIGN 34)  /* result too large (from ANSI C standard) */
X#define EDEADLK       (_SIGN 35)  /* resource deadlock avoided */
X#define ENAMETOOLONG  (_SIGN 36)  /* file name too long */
X#define ENOLCK        (_SIGN 37)  /* no locks available */
X#define ENOSYS        (_SIGN 38)  /* function not implemented */
X#define ENOTEMPTY     (_SIGN 39)  /* directory not empty */
X
X/* The following are not POSIX errors, but they can still happen. */
X#define ELOCKED      (_SIGN 101)  /* can't send message */
X#define EBADCALL     (_SIGN 102)  /* error on send/receive */
X#define ELONGSTRING  (_SIGN 103)  /* string too long */
X#define EOF          (_SIGN 104)  /* End Of File - used by drivers */
X
X/* The following error codes are generated by the kernel itself. */
X#ifdef _KERNEL
X#define E_BAD_DEST        -1	/* destination address illegal */
X#define E_BAD_SRC         -2	/* source address illegal */
X#define E_TRY_AGAIN       -3	/* can't send-- tables full */
X#define E_OVERRUN         -4	/* interrupt for task that is not waiting */
X#define E_BAD_BUF         -5	/* message buf outside caller's addr space */
X#define E_TASK            -6	/* can't send to task */
X#define E_NO_MESSAGE      -7	/* RECEIVE failed: no message present */
X#define E_NO_PERM         -8	/* ordinary users can't send to tasks */
X#define E_BAD_FCN         -9	/* only valid fcns are SEND, RECEIVE, BOTH */
X#define E_BAD_ADDR       -10	/* bad address given to utility routine */
X#define E_BAD_PROC       -11	/* bad proc number given to utility */
X#endif /* _KERNEL */
X
X#endif /* _ERROR_H */
+ END-OF-FILE errno.h
chmod 'u=rw,g=r,o=r' 'errno.h'
set `wc -c 'errno.h'`
count=$1
case $count in
5088)	:;;
*)	echo 'Bad character count in ''errno.h' >&2
		echo 'Count should be 5088' >&2
esac
echo Extracting 'fcntl.h'
sed 's/^X//' > 'fcntl.h' << '+ END-OF-FILE ''fcntl.h'
X/* The <fcntl.h> header is needed by the open() and fcntl() system calls,
X * which  have a variety of parameters and flags.  They are described here.  
X * The formats of the calls to each of these are:
X *
X *	open(path, oflag [mode])	open a file
X *	fcntl(fd, cmd,[ arg])		get or set file attributes
X * 
X */
X
X/* These values are used for cmd in fcntl().  POSIX Table 6-1.  */
X#define F_DUPFD            0	/* duplicate file descriptor */
X#define F_GETFD	           1	/* get file descriptor flags */
X#define F_SETFD            2	/* set file descriptor flags */
X#define F_GETFL            3	/* get file status flags */
X#define F_SETFL            4	/* set file status flags */
X#define F_GETLK            5	/* get record locking information */
X#define F_SETLK            6	/* set record locking information */
X#define F_SETLKW           7	/* set record locking info; wait if blocked */
X
X/* File descriptor flags used for fcntl().  POSIX Table 6-2. */
X#define FD_CLOEXEC         1	/* close on exec flag for third arg of fcntl */
X
X/* L_type values for record locking with fcntl().  POSIX Table 6-3. */
X#define F_RDLCK            0	/* shared or read lock */
X#define F_WRLCK            1	/* exclusive or write lock */
X#define F_UNLCK            2	/* unlock */
X
X/* Oflag values for open().  POSIX Table 6-4. */
X#define O_CREAT        00100	/* creat file if it doesn't exist */
X#define O_EXCL         00200	/* exclusive use flag */
X#define O_NOCTTY       00400	/* do not assign a controlling terminal */
X#define O_TRUNC        01000	/* truncate flag */
X
X/* File status flags for open() and fcntl().  POSIX Table 6-5. */
X#define O_APPEND       02000	/* set append mode */
X#define O_NONBLOCK     04000	/* no delay */
X
X/* File access modes for open() and fcntl().  POSIX Table 6-6. */
X#define O_RDONLY           0	/* open(name, O_RDONLY) opens read only */
X#define O_WRONLY           1	/* open(name, O_WRONLY) opens write only */
X#define O_RDWR             2	/* open(name, O_RDWR) opens read/write */
X
X/* Mask for use with file access modes.  POSIX Table 6-7. */
X#define O_ACCMODE         03	/* mask for file access modes */
X
X
X/* Declare ANSI prototypes (except when compiling kernel).*/
X#ifndef _ANSI_H
X#include <ansi.h>
X#endif
X
X#if _USE_ANSI_PROTOTYPES	/* function prototypes required by ANSI C */
Xint open(char *__path, int __oflag, int __mode);
Xint creat(char *__path, int __mode);
Xint fcntl(int __filedes, int __cmd, int __arg);
X#endif
X
X/* K&R prototypes are not needed for functions returning an 'int'. */
+ END-OF-FILE fcntl.h
chmod 'u=rw,g=r,o=r' 'fcntl.h'
set `wc -c 'fcntl.h'`
count=$1
case $count in
2496)	:;;
*)	echo 'Bad character count in ''fcntl.h' >&2
		echo 'Count should be 2496' >&2
esac
echo Extracting 'float.h'
sed 's/^X//' > 'float.h' << '+ END-OF-FILE ''float.h'
X/* The <float.h> header defines some implementation limits for (IEEE) floating
X * point. Application programs can use it to find out how big and small 
X * floating-point numbers can be, what epsilon to use for iteration, etc.
X */
X
X#ifndef _FLOAT_H
X#define _FLOAT_H
X
X#define FLT_DIG			6
X#define FLT_EPSILON		1.19209290e-07
X#define FLT_MANT_DIG		24
X#define FLT_MAX			3.40282347e+38F
X#define FLT_MAX_10_EXP		38
X#define FLT_MAX_EXP		128
X#define FLT_MIN			1.17549435e-38F
X#define FLT_MIN_10_EXP		-37
X#define FLT_MIN_EXP		-125
X
X#define DBL_DIG			15
X#define DBL_EPSILON		2.2204460492503131e-16
X#define DBL_MANT_DIG		53
X#define DBL_MAX			1.7976931348623157e+308
X#define DBL_MAX_10_EXP		308
X#define DBL_MAX_EXP		1024
X#define DBL_MIN			2.2250738585072014e-308
X#define DBL_MIN_10_EXP		-307
X#define DBL_MIN_EXP		-1021
X
X#define LDBL_DIG		15
X#define LDBL_EPSILON		2.2204460492503131e-16L
X#define LDBL_MANT_DIG		53
X#define LDBL_MAX		1.7976931348623157e+308L
X#define LDBL_MAX_10_EXP		308
X#define LDBL_MAX_EXP		1024
X#define LDBL_MIN		2.2250738585072014e-308L
X#define LDBL_MIN_10_EXP		-307
X#define LDBL_MIN_EXP		-1021
X
X#define FLT_ROUNDS		1
X#define FLT_RADIX		2
X
X#endif /* _FLOAT_H */
+ END-OF-FILE float.h
chmod 'u=rw,g=r,o=r' 'float.h'
set `wc -c 'float.h'`
count=$1
case $count in
1167)	:;;
*)	echo 'Bad character count in ''float.h' >&2
		echo 'Count should be 1167' >&2
esac
echo Extracting 'grp.h'
sed 's/^X//' > 'grp.h' << '+ END-OF-FILE ''grp.h'
X/* The <grp.h> header is used for the getgrid() and getgrname() calls. */
X
Xstruct	group { 
X  char *gr_name;		/* the name of the group */
X  gid_t gr_gid;			/* the numerical group ID */
X  char **gr_mem;		/* a vector of pointers to the members */
X};
X
X
X/* Declare ANSI or K&R prototypes (except when compiling kernel).*/
X#ifndef _ANSI_H
X#include <ansi.h>
X#endif
X
X#if _USE_ANSI_PROTOTYPES	/* function prototypes required by ANSI C */
Xstruct group *getgrgid(gid_t __gid);
Xstruct group *getgrname(char *__name);
X#endif
X
X#if _USE_OLD_PROTOTYPES		/* Kernighan and Ritchie C prototypes */
Xstruct group *getgrgid();
Xstruct group *getgrname();
X#endif
+ END-OF-FILE grp.h
chmod 'u=rw,g=r,o=r' 'grp.h'
set `wc -c 'grp.h'`
count=$1
case $count in
639)	:;;
*)	echo 'Bad character count in ''grp.h' >&2
		echo 'Count should be 639' >&2
esac
echo Extracting 'limits.h'
sed 's/^X//' > 'limits.h' << '+ END-OF-FILE ''limits.h'
X/* The <limits.h> header defines some basic sizes, both of the language types 
X * (e.g., the number of bits in an integer), and of the operating system (e.g.
X * the number of characters in a file name.
X */
X
X#ifndef _LIMITS_H
X#define _LIMITS_H
X
X/* Definitions about chars (8 bits in MINIX, and signed).		*/
X#define CHAR_BIT           8	/* number of bits in a char		*/
X#define CHAR_MIN        -128	/* minimum value of a char		*/
X#define CHAR_MAX         127	/* maximum value of a char		*/
X#define SCHAR_MIN       -128	/* minimum value of a signed char	*/
X#define SCHAR_MAX        127	/* maximum value of a signed char	*/
X#define UCHAR_MAX        255	/* maximum value of an unsigned char	*/
X#define MB_LEN_MAX         1	/* maximum length of a multibyte char	*/
X
X/* Definitions about shorts (16 bits in MINIX).				*/
X#define SHRT_MIN      -32768	/* minimum value of a short		*/
X#define SHRT_MAX       32767	/* maximum value of a short		*/
X#define USHRT_MAX      65535	/* maximum value of unsigned short	*/
X
X/* Definitions about ints (16 bits in MINIX for 8088, 80286, Atari etc) */
X#if _INT_SIZE == 16
X#define INT_MIN	      -32768	/* minimum value of an int		*/
X#define INT_MAX	       32767	/* maximum value of an int		*/
X#define UINT_MAX       65535	/* maximum value of an unsigned int	*/
X#endif
X
X/* Definitions about ints (may be 32 bits some day).			*/
X#if _INT_SIZE == 32
X#define INT_MIN  -2147483648	/* minimum value of a long		*/
X#define INT_MAX   2147483647	/* maximum value of a long		*/
X#define UINT_MAX  4294967295	/* maximum value of an unsigned long	*/
X#endif
X
X/*Definitions about longs (32 bits in MINIX).				*/
X#define LONG_MIN -2147483648	/* minimum value of a long		*/
X#define LONG_MAX  2147483647	/* maximum value of a long		*/
X#define ULONG_MAX 4294967295	/* maximum value of an unsigned long	*/
X
X/* Minimum sizes required by the POSIX P1003.1 standard (Table 2-2).	*/
X#ifdef _POSIX_SOURCE		/* these are only visible for POSIX     */
X#define _POSIX_ARG_MAX  4096	/* exec() may have 4K worth of args	*/
X#define _POSIX_CHILD_MAX   6	/* a process may have 6 children	*/
X#define _POSIX_LINK_MAX    8	/* a file may have 8 links		*/
X#define _POSIX_MAX_CANON 255	/* size of the canonical input queue	*/
X#define _POSIX_MAX_INPUT 255	/* you can type 255 chars ahead		*/
X#define _POSIX_NAME_MAX   14	/* a file name may have 14 chars	*/
X#define _POSIX_NGROUPS_MAX 0	/* supplementary group IDs are optional	*/
X#define _POSIX_OPEN_MAX   16	/* a process may have 16 files open	*/
X#define _POSIX_PATH_MAX  255	/* a pathname may contain 255 chars	*/
X#define _POSIX_PIPE_BUF  512	/* pipes writes of 512 bytes are atomic	*/
X
X/* Values actually implemented by MINIX (Tables 2-3, 2-4, and 2-5).	*/
X#define _NO_LIMIT        100	/* arbitrary number; limit not enforced */
X
X#define NGROUPS_MAX        0	/* supplemental group IDs not available	*/
X#define ARG_MAX         4096	/* # bytes of args + environ for exec()	*/
X#define CHILD_MAX  _NO_LIMIT    /* MINIX does not limit children	*/
X#define OPEN_MAX          20	/* # open files a process may have	*/
X#define LINK_MAX         127	/* # links a file may have		*/
X#define MAX_CANON	 255	/* size of the canonical input queue	*/
X#define MAX_INPUT        255	/* size of the type-ahead buffer	*/
X#define NAME_MAX          14	/* # chars in a file name		*/
X#define PATH_MAX         255	/* # chars in a path name		*/
X#define PIPE_BUF         512	/* # bytes in atomic write to a pipe	*/
X
X#endif /* _POSIX_SOURCE */
X
X#endif /* _LIMITS_H */
+ END-OF-FILE limits.h
chmod 'u=rw,g=r,o=r' 'limits.h'
set `wc -c 'limits.h'`
count=$1
case $count in
3471)	:;;
*)	echo 'Bad character count in ''limits.h' >&2
		echo 'Count should be 3471' >&2
esac
echo Extracting 'locale.h'
sed 's/^X//' > 'locale.h' << '+ END-OF-FILE ''locale.h'
X/* The <locale.h> header is used to custom tailor currency symbols, decimal 
X * points, and other items to the local style.  It is ANSI's attempt at 
X * avoiding cultural imperialism.  The locale given below is for C.
X */
X
X#ifndef _LOCALE_H
X#define _LOCALE_H
X
Xstruct lconv {
X  char *decimal_point;		/* "." */
X  char *thousands_sep;		/* ""  */
X  char *grouping;		/* ""  */
X  char *int_curr_symbol;	/* ""  */
X  char *currency_symbol;	/* ""  */
X  char *mon_decimal_point;	/* ""  */
X  char *mon_thousands_sep;	/* ""  */
X  char *mon_grouping;		/* ""  */
X  char *positive_sign;		/* ""  */
X  char *negative_sign;		/* ""  */
X  char int_frac_digits;		/* CHAR_MAX */
X  char frac_digits;		/* CHAR_MAX */
X  char p_cs_precedes;		/* CHAR_MAX */
X  char p_sep_by_space;		/* CHAR_MAX */
X  char n_cs_precedes;		/* CHAR_MAX */
X  char n_sep_by_space;		/* CHAR_MAX */
X  char p_sign_posn;		/* CHAR_MAX */
X  char n_sign_posn;		/* CHAR_MAX */
X};
X
X#ifndef NULL
X#define NULL      (void *) 0
X#endif
X
X#define LC_ALL             1
X#define LC_COLLATE         2
X#define LC_CTYPE           3
X#define LC_MONETARY        4
X#define LC_NUMERIC         5
X#define LC_TIME            6
X
X/* Declare ANSI or K&R prototypes (except when compiling kernel).*/
X#ifndef _ANSI_H
X#include <ansi.h>
X#endif
X
X#if _USE_ANSI_PROTOTYPES	/* function prototypes required by ANSI C */
Xchar *setlocale(int __category, const char *__locale);
Xstruct lconv *localeconv(void);
X#endif
X
X#if _USE_OLD_PROTOTYPES		/* Kernighan and Ritchie C prototypes */
Xchar *setlocale();
Xstruct lconv *localeconv();
X#endif
X
X#endif /* _LOCALE_H */
+ END-OF-FILE locale.h
chmod 'u=rw,g=r,o=r' 'locale.h'
set `wc -c 'locale.h'`
count=$1
case $count in
1567)	:;;
*)	echo 'Bad character count in ''locale.h' >&2
		echo 'Count should be 1567' >&2
esac
echo Extracting 'math.h'
sed 's/^X//' > 'math.h' << '+ END-OF-FILE ''math.h'
X/* The <math.h> header contains prototypes for mathematical functions. */
X
X#ifndef _MATH_H
X#define _MATH_H
X
X#define HUGE_VAL	9.9e+999	/* though it will generate a warning */
X
X/* Declare ANSI or K&R prototypes (except when compiling kernel).*/
X#ifndef _ANSI_H
X#include <ansi.h>
X#endif
X
X#if _USE_ANSI_PROTOTYPES	/* function prototypes required by ANSI C */
Xdouble	acos(double __x);
Xdouble	asin(double __x);
Xdouble	atan(double __x);
Xdouble	atan2(double __y, double __x);
Xdouble	cos(double __x);
Xdouble	sin(double __x);
Xdouble	tan(double __x);
Xdouble	cosh(double __x);
Xdouble	sinh(double __x);
Xdouble	tanh(double __x);
Xdouble	exp(double __x);
Xdouble	log(double __x);
Xdouble	log10(double __x);
Xdouble	sqrt(double __x);
Xdouble	ceil(double __x);
Xdouble	fabs(double __x);
Xdouble	floor(double __x);
Xdouble	pow(double __x, double __y);
Xdouble	frexp(double __x, int *__exp);
Xdouble	ldexp(double __x, int __exp);
Xdouble	modf(double __x, double *__iptr);
Xdouble	fmod(double __x, double __y);
X#endif
X
X#if _USE_OLD_PROTOTYPES		/* Kernighan and Ritchie C prototypes */
Xdouble	acos();
Xdouble	asin();
Xdouble	atan();
Xdouble	atan2();
Xdouble	cos();
Xdouble	sin();
Xdouble	tan();
Xdouble	cosh();
Xdouble	sinh();
Xdouble	tanh();
Xdouble	exp();
Xdouble	log();
Xdouble	log10();
Xdouble	sqrt();
Xdouble	ceil();
Xdouble	fabs();
Xdouble	floor();
Xdouble	pow();
Xdouble	frexp();
Xdouble	ldexp();
Xdouble	modf();
Xdouble	fmod();
X#endif
X
X#endif /* _MATH_H */
+ END-OF-FILE math.h
chmod 'u=rw,g=r,o=r' 'math.h'
set `wc -c 'math.h'`
count=$1
case $count in
1411)	:;;
*)	echo 'Bad character count in ''math.h' >&2
		echo 'Count should be 1411' >&2
esac
exit 0

n62@nikhefh.nikhef.nl (Klamer Schutte) (10/27/89)

In article <3820@ast.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes:
>: This is a shar archive.  Extract with sh, not csh.
>: This archive ends with exit, so do not worry about trailing junk.
>: --------------------------- cut here --------------------------
>PATH=/bin:/usr/bin:/usr/ucb
                    ^^^^^^^^
Never knew i had to place any programs in /usr/ucb in minix!
Please, anybody, tell which programs! :-)

Klamer.
-- 
_____________________Yes, mail address changed again :-(________________________
Klamer Schutte        mcvax!nikhefh!{n62,Schutte}        {Schutte,n62}@nikhef.nl