perl 5.002
[p5sagit/p5-mst-13.2.git] / os2 / os2ish.h
CommitLineData
4633a7c4 1#include <signal.h>
2
3/* HAS_IOCTL:
4 * This symbol, if defined, indicates that the ioctl() routine is
5 * available to set I/O characteristics
6 */
7#define HAS_IOCTL /**/
8
9/* HAS_UTIME:
10 * This symbol, if defined, indicates that the routine utime() is
11 * available to update the access and modification times of files.
12 */
13#define HAS_UTIME /**/
14
15#define HAS_KILL
16#define HAS_WAIT
17
18#ifndef SIGABRT
19# define SIGABRT SIGILL
20#endif
21#ifndef SIGILL
22# define SIGILL 6 /* blech */
23#endif
24#define ABORT() kill(getpid(),SIGABRT);
25
c07a80fd 26#define BIT_BUCKET "/dev/null" /* Will this work? */
27
eacfb5f1 28#define PERL_SYS_INIT(argcp, argvp) do { \
29 _response(argcp, argvp); \
c0c09dfd 30 _wildcard(argcp, argvp); \
31 settmppath(); } while (0)
eacfb5f1 32
c0c09dfd 33#define TMPPATH tmppath
34#define TMPPATH1 "plXXXXXX"
35extern char *tmppath;
36void settmppath();
eacfb5f1 37
4633a7c4 38/*
39 * fwrite1() should be a routine with the same calling sequence as fwrite(),
40 * but which outputs all of the bytes requested as a single stream (unlike
41 * fwrite() itself, which on some systems outputs several distinct records
42 * if the number_of_items parameter is >1).
43 */
44#define fwrite1 fwrite
45
46#define my_getenv(var) getenv(var)
47
48/*****************************************************************************/
49
50#include <stdlib.h> /* before the following definitions */
51#include <unistd.h> /* before the following definitions */
52
53#define chdir _chdir2
54#define getcwd _getcwd2
55
56/* This guy is needed for quick stdstd */
57
58#if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE)
59# define _filbuf _fill
60 /* Perl uses ungetc only with successful return */
61# define ungetc(c,fp) \
62 (FILE_ptr(fp) > FILE_base(fp) && c == (int)*(FILE_ptr(fp) - 1) \
63 ? (--FILE_ptr(fp), ++FILE_cnt(fp), (int)c) : ungetc(c,fp))
64#endif
65
66#define OP_BINARY O_BINARY
67
68#define OS2_STAT_HACK 1
69#if OS2_STAT_HACK
70
71#define Stat(fname,bufptr) os2_stat((fname),(bufptr))
72#define Fstat(fd,bufptr) fstat((fd),(bufptr))
a5f75d66 73#define FFlush(fp) fflush(fp)
4633a7c4 74
75#undef S_IFBLK
76#undef S_ISBLK
77#define S_IFBLK 0120000
78#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
79
80#else
81
82#define Stat(fname,bufptr) stat((fname),(bufptr))
83#define Fstat(fd,bufptr) fstat((fd),(bufptr))
a5f75d66 84#define FFlush(fp) fflush(fp)
4633a7c4 85
86#endif