home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6574.LZX / include / fcntl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-04  |  2.4 KB  |  97 lines

  1. /* Copyright (c) 1992-1993 SAS Institute, Inc., Cary, NC USA */
  2. /* All Rights Reserved */
  3.  
  4.  
  5. #ifndef _FCNTL_H
  6. #define _FCNTL_H 1
  7.  
  8. /***
  9. *
  10. * The following symbols are used for the "open" and "creat" functions.
  11. * They are generally UNIX-compatible, except for O_APPEND under MSDOS,
  12. * which has been moved in order to accomodate the file sharing flags
  13. * defined in MSDOS Version 3.
  14. *
  15. * Also, O_TEMP and O_RAW are SAS extensions.
  16. *
  17. ***/
  18.  
  19. #define O_RDONLY  0    /*  Read-only value (right byte of mode word) */
  20. #define O_WRONLY  1    /*  Write-only value            */
  21. #define O_RDWR    2    /*  Read-write value            */
  22. #define O_NDELAY  0    /*  Non-blocking I/O flag (N/A) */
  23. #define O_APPEND  8    /*  Append mode flag            */
  24.  
  25. #define O_CREAT   0x0100    /* File creation flag */
  26. #define O_TRUNC   0x0200    /* File truncation flag */
  27. #define O_EXCL    0x0400    /* Exclusive access flag */
  28.  
  29. #define O_LOCK    0x1000        /* Open for exclusive write */
  30. #define O_TEMP    0x2000        /* Temporary file (delete on close) */
  31. #define O_XLATE   0x4000        /* Remove/Add CRs */
  32. #define O_RAW     0x8000    /* Raw I/O flag (SAS feature) */
  33. #define O_BINARY  0x8000        /* Same as Raw mode */
  34.  
  35. #ifndef _COMMIFMT_H
  36. #include <sys/commifmt.h>
  37. #endif
  38.  
  39. /***
  40. *
  41. * The following symbols are used for the "fcntl" function.
  42. *
  43. ***/
  44.  
  45. #define F_DUPFD 0    /* Duplicate file descriptor */
  46. #define F_GETFD 1    /* Get file descriptor flags */
  47. #define F_SETFD 2    /* Set file descriptor flags */
  48. #define F_GETFL 3    /* Get file flags */
  49. #define F_SETFL 4    /* Set file flags */
  50.  
  51. /***
  52. *
  53. * External definitions
  54. *
  55. ***/
  56.  
  57. extern int  __creat  (const char *, int);
  58. extern long __lseek  (int, long, int);
  59.  
  60. #ifndef __cplusplus
  61. extern int  __open   (const char *, int, ...);
  62. extern int  __read   (int, void *, unsigned int);
  63. extern int  __write  (int, const void *, unsigned int);
  64. extern int  __close  (int);
  65. #endif
  66.  
  67. extern int  open   (const char *, int, ...);
  68. extern int  creat  (const char *, int);
  69. extern int  read   (int, void *, unsigned int);
  70. extern int  write  (int, const void *, unsigned int);
  71. extern long lseek  (int, long, int);
  72. extern long tell   (int);
  73. extern int  close  (int);
  74. extern int  unlink (const char *);
  75. extern int  iomode (int, int);
  76. extern int  isatty (int);
  77.  
  78. #define creat __creat
  79. #define lseek __lseek
  80.  
  81. #ifndef __cplusplus
  82. #define open __open
  83. #define read __read 
  84. #define write __write
  85. #define close __close
  86. #endif
  87.  
  88. #define tell(x)    lseek(x, 0L, 1)
  89.  
  90. #ifndef _COMMNULL_H
  91. #include <sys/commnull.h>
  92. #endif
  93.  
  94. #endif
  95.  
  96.  
  97.