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 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * $Date: 2005/04/17 13:14:29 $
28 #ifndef __STRICT_ANSI__
33 /* All the headers include this file. */
37 * It appears that fcntl.h should include io.h for compatibility...
41 /* Specifiy one of these flags to define the access mode. */
46 /* Mask for access mode bits in the _open flags. */
47 #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
49 #define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
51 #define _O_RANDOM 0x0010
52 #define _O_SEQUENTIAL 0x0020
53 #define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
54 * WARNING: Even if not created by _open! */
55 #define _O_NOINHERIT 0x0080
57 #define _O_CREAT 0x0100 /* Create the file if it does not exist. */
58 #define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
59 #define _O_EXCL 0x0400 /* Open only if the file does not exist. */
61 /* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
62 #define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
63 #define _O_BINARY 0x8000 /* Input and output is not translated. */
64 #define _O_RAW _O_BINARY
68 /* POSIX/Non-ANSI names for increased portability */
69 #define O_RDONLY _O_RDONLY
70 #define O_WRONLY _O_WRONLY
71 #define O_RDWR _O_RDWR
72 #define O_ACCMODE _O_ACCMODE
73 #define O_APPEND _O_APPEND
74 #define O_CREAT _O_CREAT
75 #define O_TRUNC _O_TRUNC
76 #define O_EXCL _O_EXCL
77 #define O_TEXT _O_TEXT
78 #define O_BINARY _O_BINARY
79 #define O_TEMPORARY _O_TEMPORARY
80 #define O_NOINHERIT _O_NOINHERIT
81 #define O_SEQENTIAL _O_SEQUENTIAL
82 #define O_RANDOM _O_RANDOM
84 #endif /* Not _NO_OLDNAMES */
90 * This variable determines the default file mode.
91 * TODO: Which flags work?
93 #ifndef __DECLSPEC_SUPPORTED
96 extern unsigned int* __imp__fmode
;
97 #define _fmode (*__imp__fmode)
100 extern unsigned int* __imp__fmode_dll
;
101 #define _fmode (*__imp__fmode_dll)
104 #else /* __DECLSPEC_SUPPORTED */
107 __MINGW_IMPORT
unsigned int _fmode
;
108 #else /* ! __MSVCRT__ */
109 __MINGW_IMPORT
unsigned int _fmode_dll
;
110 #define _fmode _fmode_dll
111 #endif /* ! __MSVCRT__ */
113 #endif /* __DECLSPEC_SUPPORTED */
120 int _setmode (int, int);
123 int setmode (int, int);
124 #endif /* Not _NO_OLDNAMES */
130 #endif /* Not RC_INVOKED */
132 #endif /* Not _FCNTL_H_ */
134 #endif /* Not __STRICT_ANSI__ */