| 1 |
/* |
| 2 |
* reference: Portable C Software / Mark Horton, ISBN 0-13-868959-7 |
| 3 |
*/ |
| 4 |
|
| 5 |
#if !defined(_Posix_h) && !defined(__CEXTRACT__) |
| 6 |
#define _Posix_h |
| 7 |
|
| 8 |
/* sys/types needs to be included before POSIX_SOURCE is defined on |
| 9 |
* some systems. Next is not one of them. |
| 10 |
*/ |
| 11 |
#if 0 |
| 12 |
#ifndef NeXT |
| 13 |
#include <sys/types.h> |
| 14 |
#endif |
| 15 |
|
| 16 |
/* |
| 17 |
* - have to be before includes |
| 18 |
*/ |
| 19 |
#ifndef _POSIX_SOURCE |
| 20 |
#define _POSIX_SOURCE |
| 21 |
#endif |
| 22 |
#endif |
| 23 |
/* _Ultrix_ may not be the symbol name, but if you are on an Ultrix |
| 24 |
* system, make sure __POSIX is defined. |
| 25 |
*/ |
| 26 |
#if defined(ultrix) |
| 27 |
#define __POSIX |
| 28 |
#endif |
| 29 |
|
| 30 |
/* |
| 31 |
* have to be before <dirent.h> |
| 32 |
*/ |
| 33 |
#include <sys/types.h> |
| 34 |
|
| 35 |
/* |
| 36 |
* have to be before <dirent.h> |
| 37 |
*/ |
| 38 |
#include <sys/stat.h> |
| 39 |
|
| 40 |
/* NeXT apparantly needs NAME_MAX defined before dirent.h is included. */ |
| 41 |
|
| 42 |
#ifndef NAME_MAX |
| 43 |
#define NAME_MAX 255 /* 14 grr max chars in filename, no term. null */ |
| 44 |
#endif |
| 45 |
|
| 46 |
#include <dirent.h> |
| 47 |
|
| 48 |
/* Remove complex logic - if it isn't defined, lets define it. Lets not |
| 49 |
* care what OS we might be on. |
| 50 |
*/ |
| 51 |
#if !defined(MAXNAMELEN) |
| 52 |
#define MAXNAMELEN 255 |
| 53 |
#endif |
| 54 |
|
| 55 |
#if !defined(MAXNAMLEN) |
| 56 |
#define MAXNAMLEN 255 |
| 57 |
#endif |
| 58 |
|
| 59 |
#include <errno.h> |
| 60 |
|
| 61 |
#include <fcntl.h> |
| 62 |
#ifndef O_NONBLOCK |
| 63 |
#define O_NONBLOCK O_NDELAY |
| 64 |
#endif |
| 65 |
|
| 66 |
#include <limits.h> |
| 67 |
#include <locale.h> |
| 68 |
#include <pwd.h> |
| 69 |
#include <setjmp.h> |
| 70 |
#include <signal.h> |
| 71 |
#include <stdio.h> |
| 72 |
#include <sys/times.h> |
| 73 |
#include <sys/utsname.h> |
| 74 |
#include <unistd.h> |
| 75 |
|
| 76 |
/* |
| 77 |
* |
| 78 |
*/ |
| 79 |
#ifndef ARG_MAX |
| 80 |
#define ARG_MAX 20478 /* */ |
| 81 |
#endif |
| 82 |
#ifndef CHILD_MAX |
| 83 |
#define CHILD_MAX 32 /* */ |
| 84 |
#endif |
| 85 |
#ifndef OPEN_MAX |
| 86 |
#define OPEN_MAX 20 /* */ |
| 87 |
#endif |
| 88 |
#ifndef LINK_MAX |
| 89 |
#define LINK_MAX 1000 /* */ |
| 90 |
#endif |
| 91 |
#ifndef MAX_CANON |
| 92 |
#define MAX_CANON 512 /* ;always */ |
| 93 |
#endif |
| 94 |
#ifndef MAX_INPUT |
| 95 |
#define MAX_INPUT 512 /* ;always */ |
| 96 |
#endif |
| 97 |
#ifndef PATH_MAX |
| 98 |
#define PATH_MAX 1023 /* max char in pathname, no term. null ;always */ |
| 99 |
#endif |
| 100 |
#ifndef PIPE_BUF |
| 101 |
#define PIPE_BUF 8192 /* ;always */ |
| 102 |
#endif |
| 103 |
#ifndef STREAM_MAX |
| 104 |
#define STREAM_MAX OPEN_MAX /* */ |
| 105 |
#endif |
| 106 |
#ifndef _POSIX_ARG_MAX |
| 107 |
#define _POSIX_ARG_MAX 4096 |
| 108 |
#endif |
| 109 |
|
| 110 |
#endif /* _Posix_h */ |