Git for Windows Git-1.6.5.1-preview20100112-with-cheetah
[msysgit.git] / mingw / include / fcntl.h
blob9bff9352a0de050ccfe1c7a74516a798d7b3b087
1 /*
2 * fcntl.h
3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is a part of the mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within the package.
7 * Access constants for _open. Note that the permissions constants are
8 * in sys/stat.h (ick).
11 #ifndef _FCNTL_H_
12 #define _FCNTL_H_
14 /* All the headers include this file. */
15 #include <_mingw.h>
18 * It appears that fcntl.h should include io.h for compatibility...
20 #include <io.h>
22 /* Specifiy one of these flags to define the access mode. */
23 #define _O_RDONLY 0
24 #define _O_WRONLY 1
25 #define _O_RDWR 2
27 /* Mask for access mode bits in the _open flags. */
28 #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
30 #define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
32 #define _O_RANDOM 0x0010
33 #define _O_SEQUENTIAL 0x0020
34 #define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
35 * WARNING: Even if not created by _open! */
36 #define _O_NOINHERIT 0x0080
38 #define _O_CREAT 0x0100 /* Create the file if it does not exist. */
39 #define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
40 #define _O_EXCL 0x0400 /* Open only if the file does not exist. */
42 #define _O_SHORT_LIVED 0x1000
44 /* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
45 #define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
46 #define _O_BINARY 0x8000 /* Input and output is not translated. */
47 #define _O_RAW _O_BINARY
49 #if (__MSVCRT_VERSION__ >= 0x0800)
50 #define _O_WTEXT 0x10000
51 #define _O_U16TEXT 0x20000
52 #define _O_U8TEXT 0x40000
53 #endif
55 #ifndef _NO_OLDNAMES
57 /* POSIX/Non-ANSI names for increased portability */
58 #define O_RDONLY _O_RDONLY
59 #define O_WRONLY _O_WRONLY
60 #define O_RDWR _O_RDWR
61 #define O_ACCMODE _O_ACCMODE
62 #define O_APPEND _O_APPEND
63 #define O_CREAT _O_CREAT
64 #define O_TRUNC _O_TRUNC
65 #define O_EXCL _O_EXCL
66 #define O_TEXT _O_TEXT
67 #define O_BINARY _O_BINARY
68 #define O_TEMPORARY _O_TEMPORARY
69 #define O_NOINHERIT _O_NOINHERIT
70 #define O_SEQUENTIAL _O_SEQUENTIAL
71 #define O_RANDOM _O_RANDOM
73 #endif /* Not _NO_OLDNAMES */
75 #endif /* Not _FCNTL_H_ */