1 /***
2 *fcntl.h - file control options used by open()
3 *
4 *Purpose:
5 *       This file defines constants for the file control options used
6 *       by the _open() function.
7 *       [System V]
8 *
9 *       [Public]
10 *
11 ****/
12 
13 #ifndef _INC_FCNTL
14 #define _INC_FCNTL
15 
16 #define _O_RDONLY 0x0000 /* open for reading only */
17 #define _O_WRONLY 0x0001 /* open for writing only */
18 #define _O_RDWR 0x0002   /* open for reading and writing */
19 #define _O_APPEND 0x0008 /* writes done at eof */
20 
21 #define _O_CREAT 0x0100 /* create and open file */
22 #define _O_TRUNC 0x0200 /* open and truncate */
23 #define _O_EXCL 0x0400  /* open only if file doesn't already exist */
24 
25 /* O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s,
26 ** and <lf> sequences translated to <cr><lf> on write()'s
27 */
28 
29 #define _O_TEXT 0x4000   /* file mode is text (translated) */
30 #define _O_BINARY 0x8000 /* file mode is binary (untranslated) */
31 
32 /* macro to translate the C 2.0 name used to force binary mode for files */
33 
34 #define _O_RAW _O_BINARY
35 
36 /* Open handle inherit bit */
37 
38 #define _O_NOINHERIT 0x0080 /* child process doesn't inherit file */
39 
40 /* Temporary file bit - file is deleted when last handle is closed */
41 
42 #define _O_TEMPORARY 0x0040 /* temporary file bit */
43 
44 /* sequential/random access hints */
45 
46 #define _O_SEQUENTIAL 0x0020 /* file access is primarily sequential */
47 #define _O_RANDOM 0x0010     /* file access is primarily random */
48 
49 #if !__STDC__ || defined(_POSIX_)
50 /* Non-ANSI names for compatibility */
51 #define O_RDONLY _O_RDONLY
52 #define O_WRONLY _O_WRONLY
53 #define O_RDWR _O_RDWR
54 #define O_APPEND _O_APPEND
55 #define O_CREAT _O_CREAT
56 #define O_TRUNC _O_TRUNC
57 #define O_EXCL _O_EXCL
58 #define O_TEXT _O_TEXT
59 #define O_BINARY _O_BINARY
60 #define O_RAW _O_BINARY
61 #define O_TEMPORARY _O_TEMPORARY
62 #define O_NOINHERIT _O_NOINHERIT
63 #define O_SEQUENTIAL _O_SEQUENTIAL
64 #define O_RANDOM _O_RANDOM
65 #endif /* __STDC__ */
66 
67 #endif /* _INC_FCNTL */
68