1 /* $Id: port.h.in,v 8.13 1996/06/12 14:41:07 bostic Exp $ (Berkeley) $Date: 1996/06/12 14:41:07 $ */
4 * Declare the basic types, if they aren't already declared. Named and
5 * some system's db.h files protect them with __BIT_TYPES_DEFINED__.
7 #ifndef __BIT_TYPES_DEFINED__
8 #define __BIT_TYPES_DEFINED__
23 * Handle function prototypes. This steps on name space that vi doesn't
24 * control, but all of the other solutions are worse.
27 #if defined(__STDC__) || defined(__cplusplus)
28 #define __P(protos) protos /* ANSI C prototypes */
30 #define __P(protos) () /* K&R C preprocessor */
35 * Some versions of System V changed the number of arguments to gettimeofday
36 * without changing the name.
38 #ifdef HAVE_BROKEN_GETTIMEOFDAY
39 #define gettimeofday(tv, tz) gettimeofday(tv)
44 * If we don't have mmap, we fake it with read and write, but we'll
45 * still need the header information.
47 #ifndef HAVE_SYS_MMAN_H
48 #define MAP_SHARED 1 /* share changes */
49 #define MAP_PRIVATE 2 /* changes are private */
50 #define PROT_READ 0x1 /* pages can be read */
51 #define PROT_WRITE 0x2 /* pages can be written */
52 #define PROT_EXEC 0x4 /* pages can be executed */
57 * POSIX 1003.1 names for file descriptors.
60 #define STDIN_FILENO 0 /* ANSI C #defines */
61 #define STDOUT_FILENO 1
62 #define STDERR_FILENO 2
67 * POSIX 1003.1 names for seek settings.
70 #define SEEK_SET 0 /* POSIX 1003.1 seek values */
76 * Hack _POSIX_VDISABLE to \377 since Ultrix doesn't honor _POSIX_VDISABLE
77 * (treats it as ^@). The symptom is that the ^@ keystroke immediately
80 #ifdef HAVE_BROKEN_VDISABLE
81 #undef _POSIX_VDISABLE
82 #define _POSIX_VDISABLE ((unsigned char)'\377')
87 * POSIX 1003.1 tty disabling character.
89 #ifndef _POSIX_VDISABLE
90 #define _POSIX_VDISABLE 0 /* Some systems used 0. */
95 * 4.4BSD extension to only set the software termios bits.
97 #ifndef TCSASOFT /* 4.4BSD extension. */
103 * POSIX 1003.1 maximum path length.
107 #define MAXPATHLEN PATH_MAX
109 #define MAXPATHLEN 1024
115 * MIN, MAX, historically in <sys/param.h>
118 #define MAX(_a,_b) ((_a)<(_b)?(_b):(_a))
121 #define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
126 * "DB" isn't always portable, and we want the private information.
129 #undef pgno_t /* IRIX has its own version. */
130 #define pgno_t L__db_pgno_t
134 * 4.4BSD extension to provide lock values in the open(2) call.
146 * POSIX 1003.1 bad file format errno.
149 #define EFTYPE EINVAL
154 * POSIX 1003.2 RE length limit.
156 #ifndef _POSIX2_RE_DUP_MAX
157 #define _POSIX2_RE_DUP_MAX 255
162 * 4.4BSD extension to determine if a program dropped core from the exit
166 #define WCOREDUMP(a) 0
171 * Endian-ness of the machine.
173 #if !defined(LITTLE_ENDIAN)
174 #define LITTLE_ENDIAN 1234
176 #if !defined(BIG_ENDIAN)
177 #define BIG_ENDIAN 4321
179 #if !defined(BYTE_ORDER)
180 #if WORDS_BIGENDIAN == 1
181 #define BYTE_ORDER BIG_ENDIAN
183 #define BYTE_ORDER LITTLE_ENDIAN