Commit | Line | Data |
---|---|---|
396e9e6f | 1 | #ifndef __PLAN9ISH_H__ |
2 | #define __PLAN9ISH_H__ | |
3 | ||
4 | /* | |
5 | * The following symbols are defined if your operating system supports | |
6 | * functions by that name. All Unixes I know of support them, thus they | |
7 | * are not checked by the configuration script, but are directly defined | |
8 | * here. | |
9 | */ | |
10 | ||
11 | /* HAS_IOCTL: | |
12 | * This symbol, if defined, indicates that the ioctl() routine is | |
13 | * available to set I/O characteristics | |
14 | */ | |
15 | #define HAS_IOCTL /**/ | |
16 | ||
17 | /* HAS_UTIME: | |
18 | * This symbol, if defined, indicates that the routine utime() is | |
19 | * available to update the access and modification times of files. | |
20 | */ | |
21 | #define HAS_UTIME /**/ | |
22 | ||
23 | /* HAS_GROUP | |
28e8609d JH |
24 | * This symbol, if defined, indicates that the getgrnam() and |
25 | * getgrgid() routines are available to get group entries. | |
26 | * The getgrent() has a separate definition, HAS_GETGRENT. | |
396e9e6f | 27 | */ |
28 | /*#define HAS_GROUP /**/ | |
29 | ||
30 | /* HAS_PASSWD | |
28e8609d JH |
31 | * This symbol, if defined, indicates that the getpwnam() and |
32 | * getpwuid() routines are available to get password entries. | |
33 | * The getpwent() has a separate definition, HAS_GETPWENT. | |
396e9e6f | 34 | */ |
35 | /*#define HAS_PASSWD /**/ | |
36 | ||
37 | #define HAS_KILL | |
38 | #define HAS_WAIT | |
39 | ||
40 | /* UNLINK_ALL_VERSIONS: | |
41 | * This symbol, if defined, indicates that the program should arrange | |
42 | * to remove all versions of a file if unlink() is called. This is | |
43 | * probably only relevant for VMS. | |
44 | */ | |
45 | /* #define UNLINK_ALL_VERSIONS /**/ | |
46 | ||
47 | /* PLAN9: | |
48 | * This symbol, if defined, indicates that the program is running under | |
49 | * Plan 9. | |
50 | */ | |
51 | #ifndef PLAN9 | |
52 | #define PLAN9 /**/ | |
53 | #endif | |
54 | ||
55 | /* USEMYBINMODE | |
56 | * This symbol, if defined, indicates that the program should | |
16fe6d59 | 57 | * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure |
396e9e6f | 58 | * that a file is in "binary" mode -- that is, that no translation |
59 | * of bytes occurs on read or write operations. | |
60 | */ | |
61 | #undef USEMYBINMODE | |
62 | ||
61bb5906 CB |
63 | /* Stat_t: |
64 | * This symbol holds the type used to declare buffers for information | |
65 | * returned by stat(). It's usually just struct stat. It may be necessary | |
66 | * to include <sys/stat.h> and <sys/types.h> to get any typedef'ed | |
67 | * information. | |
68 | */ | |
69 | #define Stat_t struct stat | |
70 | ||
396e9e6f | 71 | /* USE_STAT_RDEV: |
72 | * This symbol is defined if this system has a stat structure declaring | |
73 | * st_rdev | |
74 | */ | |
75 | #undef USE_STAT_RDEV /**/ | |
76 | ||
77 | /* ACME_MESS: | |
78 | * This symbol, if defined, indicates that error messages should be | |
79 | * should be generated in a format that allows the use of the Acme | |
80 | * GUI/editor's autofind feature. | |
81 | */ | |
82 | #define ACME_MESS /**/ | |
83 | ||
44a8e56a | 84 | /* ALTERNATE_SHEBANG: |
85 | * This symbol, if defined, contains a "magic" string which may be used | |
86 | * as the first line of a Perl program designed to be executed directly | |
87 | * by name, instead of the standard Unix #!. If ALTERNATE_SHEBANG | |
88 | * begins with a character other then #, then Perl will only treat | |
89 | * it as a command line if if finds the string "perl" in the first | |
90 | * word; otherwise it's treated as the first line of code in the script. | |
91 | * (IOW, Perl won't hand off to another interpreter via an alternate | |
92 | * shebang sequence that might be legal Perl code.) | |
93 | */ | |
94 | /* #define ALTERNATE_SHEBANG "#!" / **/ | |
95 | ||
731e2594 | 96 | #include <signal.h> |
396e9e6f | 97 | |
98 | #ifndef SIGABRT | |
99 | # define SIGABRT SIGILL | |
100 | #endif | |
101 | #ifndef SIGILL | |
102 | # define SIGILL 6 /* blech */ | |
103 | #endif | |
7766f137 | 104 | #define ABORT() kill(PerlProc_getpid(),SIGABRT); |
396e9e6f | 105 | |
106 | #define BIT_BUCKET "/dev/null" | |
cbec8ebe | 107 | #define PERL_SYS_INIT_BODY(c,v) \ |
ac5a684e | 108 | MALLOC_CHECK_TAINT2(*c,*v) PERLIO_INIT; MALLOC_INIT |
8cc95fdb | 109 | #define dXSUB_SYS |
cbec8ebe | 110 | #define PERL_SYS_TERM_BODY() PERLIO_TERM; MALLOC_TERM |
396e9e6f | 111 | |
112 | /* | |
113 | * fwrite1() should be a routine with the same calling sequence as fwrite(), | |
114 | * but which outputs all of the bytes requested as a single stream (unlike | |
115 | * fwrite() itself, which on some systems outputs several distinct records | |
116 | * if the number_of_items parameter is >1). | |
117 | */ | |
118 | #define fwrite1 fwrite | |
119 | ||
120 | #define Stat(fname,bufptr) stat((fname),(bufptr)) | |
121 | #define Fstat(fd,bufptr) fstat((fd),(bufptr)) | |
122 | #define Fflush(fp) fflush(fp) | |
8cc95fdb | 123 | #define Mkdir(path,mode) mkdir((path),(mode)) |
396e9e6f | 124 | |
125 | /* getenv related stuff */ | |
126 | #define my_getenv(var) getenv(var) | |
127 | /* Plan 9 prefers getenv("home") to getenv("HOME") | |
128 | #define HOME home | |
129 | ||
130 | /* For use by POSIX.xs */ | |
131 | extern int tcsendbreak(int, int); | |
132 | ||
b6290011 JH |
133 | #define CONDOP_SIZE 4 /* The Plan 9 compiler cannot return quads from ?: */ |
134 | ||
1d8eec93 JH |
135 | #undef HAS_SYMLINK /* Plan 9 doesn't really have these. */ |
136 | #undef HAS_LSTAT | |
137 | #undef HAS_READLINK | |
138 | ||
396e9e6f | 139 | #endif /* __PLAN9ISH_H__ */ |