fix dependency check logic cause config always disabled
[lunaix-os.git] / lunaix-os / includes / usr / lunaix / fcntl.h
1 #ifndef _LUNAIX_UHDR_SYS_FCNTL_DEFS_H
2 #define _LUNAIX_UHDR_SYS_FCNTL_DEFS_H
3
4 #include "fstypes.h"
5 #include "types.h"
6
7 #define FO_CREATE               0x1
8 #define FO_APPEND               0x2
9 #define FO_DIRECT               0x4
10 #define FO_WRONLY               0x8
11 #define FO_RDONLY               0x10
12 #define FO_RDWR                 0x20
13 #define FO_TRUNC                0x40
14
15 #define FO_NOFOLLOW             0x10000
16
17 #define FSEEK_SET               0x1
18 #define FSEEK_CUR               0x2
19 #define FSEEK_END               0x3
20
21 #define O_CREAT                 FO_CREATE
22 #define O_APPEND                FO_APPEND
23 #define O_DIRECT                FO_DIRECT
24 #define O_WRONLY                FO_WRONLY
25 #define O_RDONLY                FO_RDONLY
26 #define O_RDWR                  FO_RDWR
27 #define O_TRUNC                 FO_TRUNC
28
29 #define AT_SYMLINK_FOLLOW       0b0000
30 #define AT_SYMLINK_NOFOLLOW     0b0001
31 #define AT_FDCWD                0b0010
32 #define AT_EACCESS              0b0100
33
34 #define R_OK                    0b100100100
35 #define W_OK                    0b010010010
36 #define X_OK                    0b001001001
37 #define F_OK                    0b111111111
38
39 /* Mount with read-only flag */
40 #define MNT_RO                  (1 << 0)
41
42 /* Mount with block-cache-disabled flag */
43 #define MNT_NC                  (1 << 1)
44
45 typedef unsigned int mode_t;
46 typedef unsigned int nlink_t;
47
48 struct file_stat
49 {
50     __lunaix_dev_t   st_dev;
51     __lunaix_ino_t   st_ino;
52     mode_t           st_mode;
53     nlink_t          st_nlink;
54     __lunaix_uid_t   st_uid;
55     __lunaix_gid_t   st_gid;
56     __lunaix_dev_t   st_rdev;
57     __lunaix_size_t  st_size;
58     __lunaix_size_t  st_blksize;
59     __lunaix_size_t  st_blocks;
60
61     unsigned long    st_atim;
62     unsigned long    st_ctim;
63     unsigned long    st_mtim;
64
65     __lunaix_size_t  st_ioblksize;
66 };
67
68 #endif /* _LUNAIX_UHDR_FNCTL_DEFS_H */