Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.6 KiB

  1. /***
  2. *fcntl.h - file control options used by open()
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file defines constants for the file control options used
  8. * by the _open() function.
  9. * [System V]
  10. *
  11. * [Public]
  12. *
  13. *Revision History:
  14. * 06-19-87 JCR Added O_NOINHERIT
  15. * 08-18-88 GJF Modified (slightly) to also work for the 386.
  16. * 08-01-89 GJF Fixed copyright
  17. * 10-30-89 GJF Fixed copyright
  18. * 02-28-90 GJF Added #ifndef _INC_FCNTL stuff. Made the definition
  19. * of O_BINARY a 32-bit constant unconditionally.
  20. * 01-17-91 GJF ANSI naming.
  21. * 03-30-92 DJM POSIX support.
  22. * 05-02-92 SRW Add support for _O_TEMPORARY flag
  23. * 04-07-93 SKS Fix copyright
  24. * 05-24-93 PML Add support for _O_SHORT_LIVED, _O_SEQUENTIAL,
  25. * _O_RANDOM
  26. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  27. * 02-14-95 CFW Clean up Mac merge.
  28. * 12-14-95 JWM Add "#pragma once".
  29. * 02-24-97 GJF Detab-ed.
  30. * 05-17-99 PML Remove all Macintosh support.
  31. *
  32. ****/
  33. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  34. #pragma once
  35. #endif
  36. #ifndef _INC_FCNTL
  37. #define _INC_FCNTL
  38. #if !defined(_WIN32)
  39. #error ERROR: Only Win32 target supported!
  40. #endif
  41. #ifndef _CRTBLD
  42. /* This version of the header files is NOT for user programs.
  43. * It is intended for use when building the C runtimes ONLY.
  44. * The version intended for public use will not have this message.
  45. */
  46. #error ERROR: Use of C runtime library internal header file.
  47. #endif /* _CRTBLD */
  48. #define _O_RDONLY 0x0000 /* open for reading only */
  49. #define _O_WRONLY 0x0001 /* open for writing only */
  50. #define _O_RDWR 0x0002 /* open for reading and writing */
  51. #define _O_APPEND 0x0008 /* writes done at eof */
  52. #define _O_CREAT 0x0100 /* create and open file */
  53. #define _O_TRUNC 0x0200 /* open and truncate */
  54. #define _O_EXCL 0x0400 /* open only if file doesn't already exist */
  55. /* O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s,
  56. ** and <lf> sequences translated to <cr><lf> on write()'s
  57. */
  58. #define _O_TEXT 0x4000 /* file mode is text (translated) */
  59. #define _O_BINARY 0x8000 /* file mode is binary (untranslated) */
  60. /* macro to translate the C 2.0 name used to force binary mode for files */
  61. #define _O_RAW _O_BINARY
  62. /* Open handle inherit bit */
  63. #define _O_NOINHERIT 0x0080 /* child process doesn't inherit file */
  64. /* Temporary file bit - file is deleted when last handle is closed */
  65. #define _O_TEMPORARY 0x0040 /* temporary file bit */
  66. /* temporary access hint */
  67. #define _O_SHORT_LIVED 0x1000 /* temporary storage file, try not to flush */
  68. /* sequential/random access hints */
  69. #define _O_SEQUENTIAL 0x0020 /* file access is primarily sequential */
  70. #define _O_RANDOM 0x0010 /* file access is primarily random */
  71. #if !__STDC__ || defined(_POSIX_)
  72. /* Non-ANSI names for compatibility */
  73. #define O_RDONLY _O_RDONLY
  74. #define O_WRONLY _O_WRONLY
  75. #define O_RDWR _O_RDWR
  76. #define O_APPEND _O_APPEND
  77. #define O_CREAT _O_CREAT
  78. #define O_TRUNC _O_TRUNC
  79. #define O_EXCL _O_EXCL
  80. #define O_TEXT _O_TEXT
  81. #define O_BINARY _O_BINARY
  82. #define O_RAW _O_BINARY
  83. #define O_TEMPORARY _O_TEMPORARY
  84. #define O_NOINHERIT _O_NOINHERIT
  85. #define O_SEQUENTIAL _O_SEQUENTIAL
  86. #define O_RANDOM _O_RANDOM
  87. #endif /* __STDC__ */
  88. #endif /* _INC_FCNTL */