1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 /**************************************************************************/
12 /**************************************************************************/
13 /**                                                                       */
14 /**   ThreadX Component                                                   */
15 /**                                                                       */
16 /**   POSIX Compliancy Wrapper (POSIX)                                    */
17 /**                                                                       */
18 /**************************************************************************/
19 /**************************************************************************/
20 
21 /**************************************************************************/
22 /*                                                                        */
23 /*  EKP DEFINITIONS                                        RELEASE        */
24 /*                                                                        */
25 /*    fcntl.h                                             PORTABLE C      */
26 /*                                                           6.1.7        */
27 /*  AUTHOR                                                                */
28 /*                                                                        */
29 /*    William E. Lamie, Microsoft Corporation                             */
30 /*                                                                        */
31 /*  DESCRIPTION                                                           */
32 /*                                                                        */
33 /*    This file defines the constants, structures, etc.needed to          */
34 /*    implement the Evacuation Kit for POSIX Users (POSIX)                */
35 /*                                                                        */
36 /*                                                                        */
37 /*  RELEASE HISTORY                                                       */
38 /*                                                                        */
39 /*    DATE              NAME                      DESCRIPTION             */
40 /*                                                                        */
41 /*  06-02-2021     William E. Lamie         Initial Version 6.1.7         */
42 /*                                                                        */
43 /**************************************************************************/
44 
45 #ifndef _FCNTL_H
46 #define _FCNTL_H
47 
48 #define O_ACCMODE	0x0003
49 #define O_RDONLY	0x0000
50 #define O_WRONLY	0x0001
51 #define O_RDWR		0x0002
52 #define O_APPEND	0x0008
53 #define O_SYNC		0x0010
54 #define O_NONBLOCK	0x0080
55 #define O_CREAT     0x0100
56 #define O_TRUNC		0x0200
57 #define O_EXCL		0x0400
58 #define O_NOCTTY	0x0800
59 #define FASYNC		0x1000
60 #define O_LARGEFILE	0x2000
61 #define O_DIRECT	0x8000
62 #define O_DIRECTORY	0x10000
63 #define O_NOFOLLOW	0x20000
64 
65 #define O_NDELAY	O_NONBLOCK
66 
67 #define F_DUPFD		0
68 #define F_GETFD		1
69 #define F_SETFD		2
70 #define F_GETFL		3
71 #define F_SETFL		4
72 #define F_GETLK		14
73 #define F_SETLK		6
74 #define F_SETLKW	7
75 
76 #define F_SETOWN	24
77 #define F_GETOWN	23
78 #define F_SETSIG	10
79 #define F_GETSIG	11
80 
81 #define FD_CLOEXEC	1
82 
83 # define POSIX_FADV_NORMAL	0
84 # define POSIX_FADV_RANDOM	1
85 # define POSIX_FADV_SEQUENTIAL	2
86 # define POSIX_FADV_WILLNEED	3
87 # define POSIX_FADV_DONTNEED	4
88 # define POSIX_FADV_NOREUSE	5
89 
90 /* no flock structure for Threadx at this time */
91 
92 #endif
93