home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl501m.zip / OS2 / os2ish.h < prev    next >
C/C++ Source or Header  |  1995-05-09  |  2KB  |  92 lines

  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. #ifdef __EMX__
  8. #define    HAS_IOCTL        /**/
  9. #endif
  10.  
  11. /* HAS_UTIME:
  12.  *    This symbol, if defined, indicates that the routine utime() is
  13.  *    available to update the access and modification times of files.
  14.  */
  15. #define HAS_UTIME        /**/
  16.  
  17. #ifndef __IBMC__
  18. #define HAS_KILL
  19. #endif
  20. #define HAS_WAIT
  21.  
  22. #ifndef SIGABRT
  23. #    define SIGABRT SIGILL
  24. #endif
  25. #ifndef SIGILL
  26. #    define SIGILL 6         /* blech */
  27. #endif
  28.  
  29. #ifdef __IBMC__
  30. #define ABORT() abort();
  31. #else
  32. #define ABORT() kill(getpid(),SIGABRT);
  33. #endif
  34.  
  35. /*
  36.  * fwrite1() should be a routine with the same calling sequence as fwrite(),
  37.  * but which outputs all of the bytes requested as a single stream (unlike
  38.  * fwrite() itself, which on some systems outputs several distinct records
  39.  * if the number_of_items parameter is >1).
  40.  */
  41. #define fwrite1 fwrite
  42.  
  43. #define my_getenv(var) getenv(var)
  44.  
  45. /*****************************************************************************/
  46.  
  47. #ifdef __EMX__
  48.  
  49. #include <stdlib.h>    /* before the following definitions */
  50. #include <unistd.h>    /* before the following definitions */
  51.  
  52. #define chdir    _chdir2
  53. #define getcwd    _getcwd2
  54.  
  55. #define OS2_STAT_HACK 1
  56.  
  57. #else /* __IBMC__ */
  58.  
  59. #define __EXTENDED__
  60.  
  61. #include <fcntl.h>
  62. #include <io.h>
  63. #include <direct.h>
  64. #include <process.h>
  65.  
  66. #define mkdir(x,y) _mkdir(x)
  67.  
  68. #define OS2_STAT_HACK 0
  69.  
  70. #endif /* __IBMC__ */
  71.  
  72. #define OP_BINARY O_BINARY
  73.  
  74.  
  75. #if OS2_STAT_HACK
  76.  
  77. #define Stat(fname,bufptr) os2_stat((fname),(bufptr))
  78. #define Fstat(fd,bufptr)   fstat((fd),(bufptr))
  79.  
  80. #undef S_IFBLK
  81. #undef S_ISBLK
  82. #define S_IFBLK        0120000
  83. #define S_ISBLK(mode)    (((mode) & S_IFMT) == S_IFBLK)
  84.  
  85. #else
  86.  
  87. #define Stat(fname,bufptr) stat((fname),(bufptr))
  88. #define Fstat(fd,bufptr)   fstat((fd),(bufptr))
  89.  
  90. #endif
  91.  
  92.