source: Daodan/MinGW/include/fcntl.h@ 1054

Last change on this file since 1054 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 2.1 KB
Line 
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.
6 *
7 * Access constants for _open. Note that the permissions constants are
8 * in sys/stat.h (ick).
9 *
10 */
11#ifndef _FCNTL_H_
12#define _FCNTL_H_
13
14/* All the headers include this file. */
15#include <_mingw.h>
16
17/*
18 * It appears that fcntl.h should include io.h for compatibility...
19 */
20#include <io.h>
21
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
26
27/* Mask for access mode bits in the _open flags. */
28#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
29
30#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
31
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
37
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. */
41
42#define _O_SHORT_LIVED 0x1000
43
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
48
49#if (__MSVCRT_VERSION__ >= 0x0800)
50#define _O_WTEXT 0x10000
51#define _O_U16TEXT 0x20000
52#define _O_U8TEXT 0x40000
53#endif
54
55#ifndef _NO_OLDNAMES
56
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
72
73#endif /* Not _NO_OLDNAMES */
74
75#endif /* Not _FCNTL_H_ */
Note: See TracBrowser for help on using the repository browser.