This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #131679] Fix ‘our sub foo::bar’ message
[perl5.git] / unixish.h
1 /*    unixish.h
2  *
3  *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
4  *    2003, 2006, 2007, by Larry Wall and others
5  *
6  *    You may distribute under the terms of either the GNU General Public
7  *    License or the Artistic License, as specified in the README file.
8  *
9  */
10
11 /*
12  * The following symbols are defined if your operating system supports
13  * functions by that name.  All Unixes I know of support them, thus they
14  * are not checked by the configuration script, but are directly defined
15  * here.
16  */
17
18 #ifndef PERL_MICRO
19
20 /* HAS_IOCTL:
21  *      This symbol, if defined, indicates that the ioctl() routine is
22  *      available to set I/O characteristics
23  */
24 #define HAS_IOCTL               /**/
25  
26 /* HAS_UTIME:
27  *      This symbol, if defined, indicates that the routine utime() is
28  *      available to update the access and modification times of files.
29  */
30 #define HAS_UTIME               /**/
31
32 /* HAS_GROUP
33  *      This symbol, if defined, indicates that the getgrnam() and
34  *      getgrgid() routines are available to get group entries.
35  *      The getgrent() has a separate definition, HAS_GETGRENT.
36  */
37 #define HAS_GROUP               /**/
38
39 /* HAS_PASSWD
40  *      This symbol, if defined, indicates that the getpwnam() and
41  *      getpwuid() routines are available to get password entries.
42  *      The getpwent() has a separate definition, HAS_GETPWENT.
43  */
44 #define HAS_PASSWD              /**/
45
46 #define HAS_KILL
47 #define HAS_WAIT
48
49 #endif /* !PERL_MICRO */
50   
51 /* USEMYBINMODE
52  *      This symbol, if defined, indicates that the program should
53  *      use the routine my_binmode(FILE *fp, char iotype) to insure
54  *      that a file is in "binary" mode -- that is, that no translation
55  *      of bytes occurs on read or write operations.
56  */
57 #undef USEMYBINMODE
58
59 /* Stat_t:
60  *      This symbol holds the type used to declare buffers for information
61  *      returned by stat().  It's usually just struct stat.  It may be necessary
62  *      to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
63  *      information.
64  */
65 #define Stat_t struct stat
66
67 /* USE_STAT_RDEV:
68  *      This symbol is defined if this system has a stat structure declaring
69  *      st_rdev
70  */
71 #define USE_STAT_RDEV   /**/
72
73 /* ACME_MESS:
74  *      This symbol, if defined, indicates that error messages should be 
75  *      should be generated in a format that allows the use of the Acme
76  *      GUI/editor's autofind feature.
77  */
78 #undef ACME_MESS        /**/
79
80 /* UNLINK_ALL_VERSIONS:
81  *      This symbol, if defined, indicates that the program should arrange
82  *      to remove all versions of a file if unlink() is called.  This is
83  *      probably only relevant for VMS.
84  */
85 /* #define UNLINK_ALL_VERSIONS          / **/
86
87 /* VMS:
88  *      This symbol, if defined, indicates that the program is running under
89  *      VMS.  It is currently automatically set by cpps running under VMS,
90  *      and is included here for completeness only.
91  */
92 /* #define VMS          / **/
93
94 /* ALTERNATE_SHEBANG:
95  *      This symbol, if defined, contains a "magic" string which may be used
96  *      as the first line of a Perl program designed to be executed directly
97  *      by name, instead of the standard Unix #!.  If ALTERNATE_SHEBANG
98  *      begins with a character other then #, then Perl will only treat
99  *      it as a command line if it finds the string "perl" in the first
100  *      word; otherwise it's treated as the first line of code in the script.
101  *      (IOW, Perl won't hand off to another interpreter via an alternate
102  *      shebang sequence that might be legal Perl code.)
103  */
104 /* #define ALTERNATE_SHEBANG "#!" / **/
105
106 # include <signal.h>
107
108 #ifndef SIGABRT
109 #    define SIGABRT SIGILL
110 #endif
111 #ifndef SIGILL
112 #    define SIGILL 6         /* blech */
113 #endif
114 #define ABORT() kill(PerlProc_getpid(),SIGABRT);
115
116 /*
117  * fwrite1() should be a routine with the same calling sequence as fwrite(),
118  * but which outputs all of the bytes requested as a single stream (unlike
119  * fwrite() itself, which on some systems outputs several distinct records
120  * if the number_of_items parameter is >1).
121  */
122 #define fwrite1 fwrite
123
124 #define Stat(fname,bufptr) stat((fname),(bufptr))
125
126 #ifdef __amigaos4__
127 int afstat(int fd, struct stat *statb);
128 #  define Fstat(fd,bufptr) afstat((fd),(bufptr))
129 #endif
130
131 #ifndef Fstat
132 #  define Fstat(fd,bufptr)   fstat((fd),(bufptr))
133 #endif
134
135 #define Fflush(fp)         fflush(fp)
136 #define Mkdir(path,mode)   mkdir((path),(mode))
137
138 #if defined(__amigaos4__)
139 #  define PERL_SYS_INIT_BODY(c,v)                                       \
140         MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT; amigaos4_init_fork_array(); amigaos4_init_environ_sema();
141 #  define PERL_SYS_TERM_BODY()                              \
142     HINTS_REFCNT_TERM; OP_CHECK_MUTEX_TERM;                 \
143     OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM; LOCALE_TERM;  \
144     amigaos4_dispose_fork_array();
145 #endif
146
147 #ifndef PERL_SYS_INIT_BODY
148 #  define PERL_SYS_INIT_BODY(c,v)                                       \
149         MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT
150 #endif
151
152 #ifndef PERL_SYS_TERM_BODY
153 #  define PERL_SYS_TERM_BODY()                      \
154     HINTS_REFCNT_TERM; OP_CHECK_MUTEX_TERM;         \
155     OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM;       \
156     LOCALE_TERM;
157
158 #endif
159
160 #define BIT_BUCKET "/dev/null"
161
162 #define dXSUB_SYS dNOOP
163
164 #ifndef NO_ENVIRON_ARRAY
165 #define USE_ENVIRON_ARRAY
166 #endif
167
168 /*
169  * ex: set ts=8 sts=4 sw=4 et:
170  */