1N/A/* dosish.h
1N/A *
1N/A * Copyright (C) 1993, 1994, 1996, 1997, 1998, 1999,
1N/A * 2000, 2001, 2002, by Larry Wall and others
1N/A *
1N/A * You may distribute under the terms of either the GNU General Public
1N/A * License or the Artistic License, as specified in the README file.
1N/A *
1N/A */
1N/A#define ABORT() abort();
1N/A
1N/A#ifndef SH_PATH
1N/A#define SH_PATH "/bin/sh"
1N/A#endif
1N/A
1N/A#ifdef DJGPP
1N/A# define BIT_BUCKET "nul"
1N/A# define OP_BINARY O_BINARY
1N/A# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) Perl_DJGPP_init(c,v)
1N/A# define init_os_extras Perl_init_os_extras
1N/A# include <signal.h>
1N/A# define HAS_UTIME
1N/A# define HAS_KILL
1N/A char *djgpp_pathexp (const char*);
1N/A void Perl_DJGPP_init (int *argcp,char ***argvp);
1N/A# if (DJGPP==2 && DJGPP_MINOR < 2)
1N/A# define NO_LOCALECONV_MON_THOUSANDS_SEP
1N/A# endif
1N/A# ifdef USE_5005THREADS
1N/A# define OLD_PTHREADS_API
1N/A# endif
1N/A# define PERL_FS_VER_FMT "%d_%d_%d"
1N/A#else /* DJGPP */
1N/A# ifdef WIN32
1N/A# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) Perl_win32_init(c,v)
1N/A# define PERL_SYS_TERM() Perl_win32_term()
1N/A# define BIT_BUCKET "nul"
1N/A# else
1N/A# ifdef NETWARE
1N/A# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) Perl_nw5_init(c,v)
1N/A# define BIT_BUCKET "nwnul"
1N/A# else
1N/A# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v)
1N/A# define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or somethin?" */
1N/A# endif /* NETWARE */
1N/A# endif
1N/A#endif /* DJGPP */
1N/A
1N/A#ifndef PERL_SYS_TERM
1N/A# define PERL_SYS_TERM() OP_REFCNT_TERM; MALLOC_TERM
1N/A#endif
1N/A#define dXSUB_SYS
1N/A
1N/A/*
1N/A * 5.003_07 and earlier keyed on #ifdef MSDOS for determining if we were
1N/A * running on DOS, *and* if we had to cope with 16 bit memory addressing
1N/A * constraints, *and* we need to have memory allocated as unsigned long.
1N/A *
1N/A * with the advent of *real* compilers for DOS, they are not locked together.
1N/A * MSDOS means "I am running on MSDOS". HAS_64K_LIMIT means "I have
1N/A * 16 bit memory addressing constraints".
1N/A *
1N/A * if you need the last, try #DEFINE MEM_SIZE unsigned long.
1N/A */
1N/A#ifdef MSDOS
1N/A# ifndef DJGPP
1N/A# define HAS_64K_LIMIT
1N/A# endif
1N/A#endif
1N/A
1N/A/* USEMYBINMODE
1N/A * This symbol, if defined, indicates that the program should
1N/A * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
1N/A * that a file is in "binary" mode -- that is, that no translation
1N/A * of bytes occurs on read or write operations.
1N/A */
1N/A#undef USEMYBINMODE
1N/A
1N/A/* Stat_t:
1N/A * This symbol holds the type used to declare buffers for information
1N/A * returned by stat(). It's usually just struct stat. It may be necessary
1N/A * to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
1N/A * information.
1N/A */
1N/A#if defined(WIN64) || defined(USE_LARGE_FILES)
1N/A# if defined(__BORLANDC__) /* buk */
1N/A# include <sys\stat.h>
1N/A# define Stat_t struct stati64
1N/A# else
1N/A#define Stat_t struct _stati64
1N/A# endif
1N/A#else
1N/A#if defined(UNDER_CE)
1N/A#define Stat_t struct xcestat
1N/A#else
1N/A#define Stat_t struct stat
1N/A#endif
1N/A#endif
1N/A
1N/A/* USE_STAT_RDEV:
1N/A * This symbol is defined if this system has a stat structure declaring
1N/A * st_rdev
1N/A */
1N/A#define USE_STAT_RDEV /**/
1N/A
1N/A/* ACME_MESS:
1N/A * This symbol, if defined, indicates that error messages should be
1N/A * should be generated in a format that allows the use of the Acme
1N/A * GUI/editor's autofind feature.
1N/A */
1N/A#undef ACME_MESS /**/
1N/A
1N/A/* ALTERNATE_SHEBANG:
1N/A * This symbol, if defined, contains a "magic" string which may be used
1N/A * as the first line of a Perl program designed to be executed directly
1N/A * by name, instead of the standard Unix #!. If ALTERNATE_SHEBANG
1N/A * begins with a character other then #, then Perl will only treat
1N/A * it as a command line if it finds the string "perl" in the first
1N/A * word; otherwise it's treated as the first line of code in the script.
1N/A * (IOW, Perl won't hand off to another interpreter via an alternate
1N/A * shebang sequence that might be legal Perl code.)
1N/A */
1N/A/* #define ALTERNATE_SHEBANG "#!" / **/
1N/A
1N/A/*
1N/A * fwrite1() should be a routine with the same calling sequence as fwrite(),
1N/A * but which outputs all of the bytes requested as a single stream (unlike
1N/A * fwrite() itself, which on some systems outputs several distinct records
1N/A * if the number_of_items parameter is >1).
1N/A */
1N/A#define fwrite1 fwrite
1N/A
1N/A#define Fstat(fd,bufptr) fstat((fd),(bufptr))
1N/A#ifdef DJGPP
1N/A# define Fflush(fp) djgpp_fflush(fp)
1N/A#else
1N/A# define Fflush(fp) fflush(fp)
1N/A#endif
1N/A#define Mkdir(path,mode) mkdir((path),(mode))
1N/A
1N/A#ifndef WIN32
1N/A# define Stat(fname,bufptr) stat((fname),(bufptr))
1N/A#else
1N/A# define HAS_IOCTL
1N/A# define HAS_UTIME
1N/A# define HAS_KILL
1N/A# define HAS_WAIT
1N/A# define HAS_CHOWN
1N/A#endif /* WIN32 */
1N/A
1N/A/*
1N/A * <rich@phekda.freeserve.co.uk>: The DJGPP port has code that converts
1N/A * the return code of system() into the form that Unixy wait usually
1N/A * returns:
1N/A *
1N/A * - signal number in bits 0-6;
1N/A * - core dump flag in bit 7;
1N/A * - exit code in bits 8-15.
1N/A *
1N/A * Bits 0-7 are always zero for DJGPP, because it uses system().
1N/A * See djgpp.c.
1N/A *
1N/A * POSIX::W* use the W* macros from <sys/wait.h> to decode
1N/A * the return code. Unfortunately the W* macros for DJGPP use
1N/A * a different format than Unixy wait does. So there's a mismatch
1N/A * and, say, WEXITSTATUS($?) will return bogus values.
1N/A *
1N/A * So here we add hack to redefine the W* macros from DJGPP's <sys/wait.h>
1N/A * to work with our return-code conversion.
1N/A */
1N/A
1N/A#ifdef DJGPP
1N/A
1N/A#include <sys/wait.h>
1N/A
1N/A#undef WEXITSTATUS
1N/A#undef WIFEXITED
1N/A#undef WIFSIGNALED
1N/A#undef WIFSTOPPED
1N/A#undef WNOHANG
1N/A#undef WSTOPSIG
1N/A#undef WTERMSIG
1N/A#undef WUNTRACED
1N/A
1N/A#define WEXITSTATUS(stat_val) ((stat_val) >> 8)
1N/A#define WIFEXITED(stat_val) 0
1N/A#define WIFSIGNALED(stat_val) 0
1N/A#define WIFSTOPPED(stat_val) 0
1N/A#define WNOHANG 0
1N/A#define WSTOPSIG(stat_val) 0
1N/A#define WTERMSIG(stat_val) 0
1N/A#define WUNTRACED 0
1N/A
1N/A#endif