Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / include / fcntl.h
blobe62d15950fca307888a409cc372aa62f1098635f
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 #ifndef _NO_OLDNAMES
51 /* POSIX/Non-ANSI names for increased portability */
52 #define O_RDONLY _O_RDONLY
53 #define O_WRONLY _O_WRONLY
54 #define O_RDWR _O_RDWR
55 #define O_ACCMODE _O_ACCMODE
56 #define O_APPEND _O_APPEND
57 #define O_CREAT _O_CREAT
58 #define O_TRUNC _O_TRUNC
59 #define O_EXCL _O_EXCL
60 #define O_TEXT _O_TEXT
61 #define O_BINARY _O_BINARY
62 #define O_TEMPORARY _O_TEMPORARY
63 #define O_NOINHERIT _O_NOINHERIT
64 #define O_SEQUENTIAL _O_SEQUENTIAL
65 #define O_RANDOM _O_RANDOM
67 #endif /* Not _NO_OLDNAMES */
69 #endif /* Not _FCNTL_H_ */