acd91674b4d45731c540cce855b0eb62707712bc
4 * Access constants for _open. Note that the permissions constants are
7 * This code is part of the Mingw32 package.
10 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
12 * THIS SOFTWARE IS NOT COPYRIGHTED
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * $Date: 2001/06/15 18:32:25 $
27 /* Appropriated for Reactos Crtdll by Ariadne */
28 /* added _O_RANDOM_O_SEQUENTIAL _O_SHORT_LIVED*/
29 /* changed fmode_dll */
35 * It appears that fcntl.h should include io.h for compatibility...
37 #include <crtdll/io.h>
40 * This variable determines the default file mode.
41 * TODO: Which flags work?
45 extern unsigned int* __imp__fmode
;
46 #define _fmode (*__imp__fmode)
49 extern unsigned int* _fmode_dll
;
50 #define _fmode (*_fmode_dll)
55 * NOTE: This is the correct definition to build crtdll.
56 * It is NOT valid outside of crtdll.
58 extern unsigned int* _fmode_dll
;
59 extern unsigned int _fmode
;
62 /* Specifiy one of these flags to define the access mode. */
67 /* Mask for access mode bits in the _open flags. */
68 #define _O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
70 #define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
71 #define _O_CREAT 0x0100 /* Create the file if it does not exist. */
72 #define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
73 #define _O_EXCL 0x0400 /* Open only if the file does not exist. */
75 /* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
76 #define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
77 #define _O_BINARY 0x8000 /* Input and output is not translated. */
78 #define _O_RAW _O_BINARY
80 #define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
81 * WARNING: Even if not created by _open! */
84 #define _O_RANDOM 0x0010
85 #define _O_SEQUENTIAL _O_RANDOM
86 #define _O_SHORT_LIVED 0x1000
88 #ifndef __STRICT_ANSI__
91 /* POSIX/Non-ANSI names for increased portability */
92 #define O_RDONLY _O_RDONLY
93 #define O_WRONLY _O_WRONLY
94 #define O_RDWR _O_RDWR
95 #define O_ACCMODE _O_ACCMODE
96 #define O_APPEND _O_APPEND
97 #define O_CREAT _O_CREAT
98 #define O_TRUNC _O_TRUNC
99 #define O_EXCL _O_EXCL
100 #define O_TEXT _O_TEXT
101 #define O_BINARY _O_BINARY
102 #define O_TEMPORARY _O_TEMPORARY
104 #define O_RANDOM _O_RANDOM
105 #define O_SEQUENTIAL _O_RANDOM
106 #define O_SHORT_LIVED _O_SHORT_LIVED
108 #endif /* Not _NO_OLDNAMES */
114 int _setmode (int nHandle
, int nAccessMode
);
117 int setmode (int nHandle
, int nAccessMode
);
118 #endif /* Not _NO_OLDNAMES */
124 #endif /* Not __STRICT_ANSI__ */
125 #endif /* Not _FCNTL_H_ */