This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
[perl5.git] / dosish.h
CommitLineData
d6376244
JH
1/* dosish.h
2 *
59feff53 3 * Copyright (c) 1997-2002, Larry Wall
d6376244
JH
4 *
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
7 *
8 */
79072805 9#define ABORT() abort();
a0d0e21e 10
137443ea 11#ifndef SH_PATH
55497cff 12#define SH_PATH "/bin/sh"
137443ea 13#endif
55497cff 14
15#ifdef DJGPP
3fe9a6f1 16# define BIT_BUCKET "nul"
17# define OP_BINARY O_BINARY
39e571d4 18# define PERL_SYS_INIT(c,v) Perl_DJGPP_init(c,v)
933fea7f 19# define init_os_extras Perl_init_os_extras
39e571d4
LM
20# include <signal.h>
21# define HAS_UTIME
22# define HAS_KILL
23 char *djgpp_pathexp (const char*);
b8f06700 24 void Perl_DJGPP_init (int *argcp,char ***argvp);
39e571d4
LM
25# if (DJGPP==2 && DJGPP_MINOR < 2)
26# define NO_LOCALECONV_MON_THOUSANDS_SEP
27# endif
4d1ff10f 28# ifdef USE_5005THREADS
39e571d4 29# define OLD_PTHREADS_API
39e571d4 30# endif
273cf8d1 31# define PERL_FS_VER_FMT "%d_%d_%d"
3fe9a6f1 32#else /* DJGPP */
3fe9a6f1 33# ifdef WIN32
ad2e33dc 34# define PERL_SYS_INIT(c,v) Perl_win32_init(c,v)
3fe9a6f1 35# define BIT_BUCKET "nul"
36# else
2986a63f
JH
37# ifdef NETWARE
38# define PERL_SYS_INIT(c,v) Perl_nw5_init(c,v)
728c2768 39# define BIT_BUCKET "nwnul"
2986a63f
JH
40# else
41# define PERL_SYS_INIT(c,v)
42# define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or somethin?" */
43# endif /* NETWARE */
3fe9a6f1 44# endif
45#endif /* DJGPP */
55497cff 46
534825c4 47#define PERL_SYS_TERM() OP_REFCNT_TERM; MALLOC_TERM
8cc95fdb 48#define dXSUB_SYS
c07a80fd 49
55497cff 50/*
51 * 5.003_07 and earlier keyed on #ifdef MSDOS for determining if we were
52 * running on DOS, *and* if we had to cope with 16 bit memory addressing
53 * constraints, *and* we need to have memory allocated as unsigned long.
54 *
55 * with the advent of *real* compilers for DOS, they are not locked together.
56 * MSDOS means "I am running on MSDOS". HAS_64K_LIMIT means "I have
57 * 16 bit memory addressing constraints".
58 *
59 * if you need the last, try #DEFINE MEM_SIZE unsigned long.
60 */
61#ifdef MSDOS
62 #ifndef DJGPP
63 #define HAS_64K_LIMIT
64 #endif
65#endif
66
e6aa3164 67/* USEMYBINMODE
68 * This symbol, if defined, indicates that the program should
16fe6d59 69 * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
e6aa3164 70 * that a file is in "binary" mode -- that is, that no translation
71 * of bytes occurs on read or write operations.
72 */
73#undef USEMYBINMODE
74
61bb5906
CB
75/* Stat_t:
76 * This symbol holds the type used to declare buffers for information
77 * returned by stat(). It's usually just struct stat. It may be necessary
78 * to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
79 * information.
80 */
c623ac67
GS
81#if defined(WIN64) || defined(USE_LARGE_FILES)
82#define Stat_t struct _stati64
83#else
dab75801
JH
84#if defined(UNDER_CE)
85#define Stat_t struct xcestat
86#else
61bb5906 87#define Stat_t struct stat
c623ac67 88#endif
dab75801 89#endif
61bb5906 90
e6aa3164 91/* USE_STAT_RDEV:
92 * This symbol is defined if this system has a stat structure declaring
93 * st_rdev
94 */
95#define USE_STAT_RDEV /**/
96
97/* ACME_MESS:
98 * This symbol, if defined, indicates that error messages should be
99 * should be generated in a format that allows the use of the Acme
100 * GUI/editor's autofind feature.
101 */
102#undef ACME_MESS /**/
103
44a8e56a 104/* ALTERNATE_SHEBANG:
105 * This symbol, if defined, contains a "magic" string which may be used
106 * as the first line of a Perl program designed to be executed directly
107 * by name, instead of the standard Unix #!. If ALTERNATE_SHEBANG
108 * begins with a character other then #, then Perl will only treat
d1be9408 109 * it as a command line if it finds the string "perl" in the first
44a8e56a 110 * word; otherwise it's treated as the first line of code in the script.
111 * (IOW, Perl won't hand off to another interpreter via an alternate
112 * shebang sequence that might be legal Perl code.)
113 */
114/* #define ALTERNATE_SHEBANG "#!" / **/
115
a0d0e21e
LW
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
a0d0e21e 124#define Fstat(fd,bufptr) fstat((fd),(bufptr))
05af4e39
PFI
125#ifdef DJGPP
126# define Fflush(fp) djgpp_fflush(fp)
127#else
128# define Fflush(fp) fflush(fp)
129#endif
8cc95fdb 130#define Mkdir(path,mode) mkdir((path),(mode))
3fe9a6f1 131
132#ifndef WIN32
133# define Stat(fname,bufptr) stat((fname),(bufptr))
134#else
2d7a9237
GS
135# define HAS_IOCTL
136# define HAS_UTIME
137# define HAS_KILL
138# define HAS_WAIT
b990f8c8 139# define HAS_CHOWN
3fe9a6f1 140#endif /* WIN32 */