1/* @(#)port.h.in 8.13 (Berkeley) 6/12/96 */ 2 3/* $FreeBSD$ */ 4 5/* 6 * Declare the basic types, if they aren't already declared. Named and 7 * some system's db.h files protect them with __BIT_TYPES_DEFINED__. 8 */ 9#ifndef __BIT_TYPES_DEFINED__ 10#define __BIT_TYPES_DEFINED__ 11 12 13 14 15 16#endif 17 18/* 19 * XXX 20 * Some versions of System V changed the number of arguments to gettimeofday 21 * without changing the name. 22 */ 23#ifdef HAVE_BROKEN_GETTIMEOFDAY 24#define gettimeofday(tv, tz) gettimeofday(tv) 25#endif 26 27/* 28 * XXX 29 * If we don't have mmap, we fake it with read and write, but we'll 30 * still need the header information. 31 */ 32#ifndef HAVE_SYS_MMAN_H 33#define MAP_SHARED 1 /* share changes */ 34#define MAP_PRIVATE 2 /* changes are private */ 35#define PROT_READ 0x1 /* pages can be read */ 36#define PROT_WRITE 0x2 /* pages can be written */ 37#define PROT_EXEC 0x4 /* pages can be executed */ 38#endif 39 40/* 41 * XXX 42 * POSIX 1003.1 names for file descriptors. 43 */ 44#ifndef STDERR_FILENO 45#define STDIN_FILENO 0 /* ANSI C #defines */ 46#define STDOUT_FILENO 1 47#define STDERR_FILENO 2 48#endif 49 50/* 51 * XXX 52 * POSIX 1003.1 names for seek settings. 53 */ 54#ifndef SEEK_END 55#define SEEK_SET 0 /* POSIX 1003.1 seek values */ 56#define SEEK_CUR 1 57#define SEEK_END 2 58#endif 59 60/* 61 * Hack _POSIX_VDISABLE to \377 since Ultrix doesn't honor _POSIX_VDISABLE 62 * (treats it as ^@). The symptom is that the ^@ keystroke immediately 63 * drops core. 64 */ 65#ifdef HAVE_BROKEN_VDISABLE 66#undef _POSIX_VDISABLE 67#define _POSIX_VDISABLE ((unsigned char)'\377') 68#endif 69 70/* 71 * XXX 72 * POSIX 1003.1 tty disabling character. 73 */ 74#ifndef _POSIX_VDISABLE 75#define _POSIX_VDISABLE 0 /* Some systems used 0. */ 76#endif 77 78/* 79 * XXX 80 * 4.4BSD extension to only set the software termios bits. 81 */ 82#ifndef TCSASOFT /* 4.4BSD extension. */ 83#define TCSASOFT 0 84#endif 85 86/* 87 * XXX 88 * POSIX 1003.1 maximum path length. 89 */ 90#ifndef MAXPATHLEN 91#ifdef PATH_MAX 92#define MAXPATHLEN PATH_MAX 93#else 94#define MAXPATHLEN 1024 95#endif 96#endif 97 98/* 99 * XXX 100 * MIN, MAX, historically in <sys/param.h> 101 */ 102#ifndef MAX 103#define MAX(_a,_b) ((_a)<(_b)?(_b):(_a)) 104#endif 105#ifndef MIN 106#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) 107#endif 108 109/* 110 * XXX 111 * "DB" isn't always portable, and we want the private information. 112 */ 113#define DB L__DB 114#undef pgno_t /* IRIX has its own version. */ 115#define pgno_t L__db_pgno_t 116 117/* 118 * XXX 119 * 4.4BSD extension to provide lock values in the open(2) call. 120 */ 121#ifndef O_EXLOCK 122#define O_EXLOCK 0 123#endif 124 125#ifndef O_SHLOCK 126#define O_SHLOCK 0 127#endif 128 129/* 130 * XXX 131 * POSIX 1003.1 bad file format errno. 132 */ 133#ifndef EFTYPE 134#define EFTYPE EINVAL 135#endif 136 137/* 138 * XXX 139 * POSIX 1003.2 RE length limit. 140 */ 141#ifndef _POSIX2_RE_DUP_MAX 142#define _POSIX2_RE_DUP_MAX 255 143#endif 144 145/* 146 * XXX 147 * 4.4BSD extension to determine if a program dropped core from the exit 148 * status. 149 */ 150#ifndef WCOREDUMP 151#define WCOREDUMP(a) 0 152#endif 153 154/* 155 * XXX 156 * Endian-ness of the machine. 157 */ 158#if !defined(LITTLE_ENDIAN) 159#define LITTLE_ENDIAN 1234 160#endif 161#if !defined(BIG_ENDIAN) 162#define BIG_ENDIAN 4321 163#endif 164#if !defined(BYTE_ORDER) 165#if WORDS_BIGENDIAN == 1 166#define BYTE_ORDER BIG_ENDIAN 167#else 168#define BYTE_ORDER LITTLE_ENDIAN 169#endif 170#endif 171