|
32 | 32 | */
|
33 | 33 |
|
34 | 34 | #include <sys/types.h>
|
| 35 | +#ifndef WINSTORE |
35 | 36 | #include <sys/file.h>
|
| 37 | +#endif |
36 | 38 | #include <stdio.h>
|
37 | 39 | #include <errno.h>
|
38 | 40 | #include "local.h"
|
39 | 41 |
|
| 42 | +#ifdef WINSTORE |
| 43 | +/* Specifiy one of these flags to define the access mode. */ |
| 44 | +#define _O_RDONLY 0 |
| 45 | +#define _O_WRONLY 1 |
| 46 | +#define _O_RDWR 2 |
| 47 | + |
| 48 | +/* Mask for access mode bits in the _open flags. */ |
| 49 | +#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) |
| 50 | + |
| 51 | +#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */ |
| 52 | + |
| 53 | +#define _O_RANDOM 0x0010 |
| 54 | +#define _O_SEQUENTIAL 0x0020 |
| 55 | +#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing. |
| 56 | +* WARNING: Even if not created by _open! */ |
| 57 | +#define _O_NOINHERIT 0x0080 |
| 58 | + |
| 59 | +#define _O_CREAT 0x0100 /* Create the file if it does not exist. */ |
| 60 | +#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */ |
| 61 | +#define _O_EXCL 0x0400 /* Open only if the file does not exist. */ |
| 62 | + |
| 63 | +#define _O_SHORT_LIVED 0x1000 |
| 64 | + |
| 65 | +/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */ |
| 66 | +#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */ |
| 67 | +#define _O_BINARY 0x8000 /* Input and output is not translated. */ |
| 68 | +#define _O_RAW _O_BINARY |
| 69 | + |
| 70 | +#if (__MSVCRT_VERSION__ >= 0x0800) |
| 71 | +#define _O_WTEXT 0x10000 |
| 72 | +#define _O_U16TEXT 0x20000 |
| 73 | +#define _O_U8TEXT 0x40000 |
| 74 | +#endif |
| 75 | + |
| 76 | +#ifndef _NO_OLDNAMES |
| 77 | + |
| 78 | +/* POSIX/Non-ANSI names for increased portability */ |
| 79 | +#define O_RDONLY _O_RDONLY |
| 80 | +#define O_WRONLY _O_WRONLY |
| 81 | +#define O_RDWR _O_RDWR |
| 82 | +#define O_ACCMODE _O_ACCMODE |
| 83 | +#define O_APPEND _O_APPEND |
| 84 | +#define O_CREAT _O_CREAT |
| 85 | +#define O_TRUNC _O_TRUNC |
| 86 | +#define O_EXCL _O_EXCL |
| 87 | +#define O_TEXT _O_TEXT |
| 88 | +#define O_BINARY _O_BINARY |
| 89 | +#define O_TEMPORARY _O_TEMPORARY |
| 90 | +#define O_NOINHERIT _O_NOINHERIT |
| 91 | +#define O_SEQUENTIAL _O_SEQUENTIAL |
| 92 | +#define O_RANDOM _O_RANDOM |
| 93 | +#endif |
| 94 | +#endif |
| 95 | + |
| 96 | + |
40 | 97 | /*
|
41 | 98 | * Return the (stdio) flags for a given mode. Store the flags
|
42 | 99 | * to be passed to an open() syscall through *optr.
|
|
0 commit comments