home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / famapi.zip / INCLUDE.ZIP / FCNTL.H < prev    next >
C/C++ Source or Header  |  1992-12-19  |  2KB  |  90 lines

  1. //
  2. //      **************************************************************
  3. //       JdeBP C++ Library Routines      General Public Licence v1.00
  4. //          Copyright (c) 1991,1992  Jonathan de Boyne Pollard
  5. //      **************************************************************
  6. //
  7. //  FILE CONTROL (POSIX)
  8. //
  9.  
  10. #if !defined(___STDDEF_H_INCLUDED)
  11. #include <_stddef.h>
  12. #endif
  13. #if !defined(___OMODE_H_INCLUDED)
  14. #include <_omode.h>
  15. #endif
  16.  
  17. #if !defined(__FCNTL_H_INCLUDED)
  18.  
  19. // Locking commands
  20.  
  21. #define F_RDLCK 0
  22. #define F_WRLCK 1
  23. #define F_UNLCK 2
  24.  
  25. // Commands for fcntl()
  26.  
  27. #define F_DUPFD     0
  28. #define F_GETFL     1
  29. #define F_SETFL     2
  30. #define F_GETFD     3
  31. #define F_SETFD     4
  32. #define F_GETLK     5
  33. #define F_SETLK     6
  34. #define F_SETLKW    7
  35.  
  36. //
  37. // Open flags for opening files.  See <_omode.h> for details.
  38. //
  39.  
  40. #define O_RDONLY    _O_RDONLY
  41. #define O_WRONLY    _O_WRONLY
  42. #define O_RDWR      _O_RDWR
  43. #define O_ACCMODE   _O_ACCMODE
  44. #define O_CREAT     _O_CREAT
  45. #define O_TRUNC     _O_TRUNC
  46. #define O_EXCL      _O_EXCL
  47. #define O_APPEND    _O_APPEND
  48. #define O_NOCTTY    _O_NOCTTY
  49. #define O_NONBLOCK  _O_NONBLOCK
  50. #define O_COMPAT    _O_COMPAT
  51. #define O_DENYALL   _O_DENYALL
  52. #define O_DENYWRITE _O_DENYWRITE
  53. #define O_DENYREAD  _O_DENYREAD
  54. #define O_DENYNONE  _O_DENYNONE
  55. #define O_NOINHERIT _O_NOINHERIT
  56. #define O_FAILONERR _O_FAILONERR
  57. #define O_WRITETHRU _O_WRITETHRU
  58. #define O_DASD      _O_DASD
  59. #define O_TEXT      _O_TEXT
  60. #define O_BINARY    _O_BINARY
  61. #define O_RAW       _O_BINARY
  62. #define O_NDELAY    O_NONBLOCK      /* Not strictly correct for System V */
  63.  
  64. #ifndef _FLOCK_DEFINED
  65. struct flock {
  66.     short   l_type;         // Type is one of the F_ macros
  67.     short   l_whence;       // One of the SEEK_ macros from <stdio.h>
  68.     _Off_t  l_start;        // Start of lock, in bytes
  69.     _Off_t  l_len;          // Length of lock, in bytes
  70.     _Pid_t  l_pid;          // Return value: pid of locking process
  71. };
  72. #define _FLOCK_DEFINED
  73. #endif
  74.  
  75. extern "C" {
  76.  
  77. int     _CDECL  creat       (const char *, int);
  78. int     _CDECL  open        (const char *, int, ...);
  79. int     _CDECL  fcntl       (int, int, ...);
  80.  
  81. #if _MSDOS_SOURCE > 0
  82. int     _CDECL  sopen       (const char *, int, int, ...);
  83. #endif
  84.  
  85. }
  86.  
  87. #define __FCNTL_H_INCLUDED
  88. #endif
  89.  
  90.