| 1 | /* | 
|---|
| 2 |  *upashared_fcntl.h - Shared structures used by file related syscalls. | 
|---|
| 3 |  * | 
|---|
| 4 |  * Author  Alain Greiner (2016,2017,2018) | 
|---|
| 5 |  * | 
|---|
| 6 |  * Copyright (c) UPMC Sorbonne Universites | 
|---|
| 7 |  *  | 
|---|
| 8 |  * This file is part of ALMOS-MKH. | 
|---|
| 9 |  * | 
|---|
| 10 |  * ALMOS-MKH is free software; you can redistribute it and/or modify it | 
|---|
| 11 |  * under the terms of the GNU General Public License as published by | 
|---|
| 12 |  * the Free Software Foundation; version 2.0 of the License. | 
|---|
| 13 |  * | 
|---|
| 14 |  * ALMOS-MKH is distributed in the hope that it will be useful, but | 
|---|
| 15 |  * WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 16 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|---|
| 17 |  * General Public License for more details. | 
|---|
| 18 |  * | 
|---|
| 19 |  * You should have received a copy of the GNU General Public License | 
|---|
| 20 |  * along with ALMOS-MKH; if not, write to the Free Software Foundation, | 
|---|
| 21 |  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 
|---|
| 22 |  */ | 
|---|
| 23 |  | 
|---|
| 24 | #ifndef _SHARED_FCNTL_H_ | 
|---|
| 25 | #define _SHARED_FCNTL_H_ | 
|---|
| 26 |  | 
|---|
| 27 | /*******************************************************************************************  | 
|---|
| 28 |  * This enum defines the attributes bit-vector for the open() syscall. | 
|---|
| 29 |  ******************************************************************************************/ | 
|---|
| 30 |  | 
|---|
| 31 | typedef enum | 
|---|
| 32 | { | 
|---|
| 33 |     O_RDONLY   = 0x0010000,    /*! open file in read-only mode                            */ | 
|---|
| 34 |     O_WRONLY   = 0x0020000,    /*! open file in write-only mode                           */ | 
|---|
| 35 |     O_RDWR     = 0x0030000,    /*! open file in read/write mode                           */ | 
|---|
| 36 |     O_NONBLOCK = 0x0040000,    /*! do not block if data non available                     */ | 
|---|
| 37 |     O_APPEND   = 0x0080000,    /*! append on each write                                   */ | 
|---|
| 38 |     O_CREAT    = 0x0100000,    /*! create file if it does not exist                       */ | 
|---|
| 39 |     O_TRUNC    = 0x0200000,    /*! file length is forced to 0                             */ | 
|---|
| 40 |     O_EXCL     = 0x0400000,    /*! error if VFS_O_CREAT and file exist                    */ | 
|---|
| 41 |     O_SYNC         = 0x0800000,    /*! synchronize File System on each write                  */ | 
|---|
| 42 |     O_CLOEXEC  = 0x1000000,    /*! set the close-on-exec flag in file descriptor          */ | 
|---|
| 43 |     O_DIR      = 0x2000000,    /*! new file descriptor is for a directory                 */ | 
|---|
| 44 | } | 
|---|
| 45 | open_attr_t; | 
|---|
| 46 |  | 
|---|
| 47 | #endif | 
|---|