syscalls: chroot, fchmodat, fchownat, faccessat
[lunaix-os.git] / lunaix-os / includes / usr / lunaix / fcntl_defs.h
1 #ifndef __LUNAIX_SYS_FCNTL_DEFS_H
2 #define __LUNAIX_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 struct file_stat
46 {
47     dev_t st_dev;
48     ino_t st_ino;
49     unsigned int mode;
50     dev_t st_rdev;
51     off_t st_size;
52     size_t st_blksize;
53     size_t st_ioblksize;
54     size_t st_blocks;
55 };
56
57 #endif /* __LUNAIX_FNCTL_DEFS_H */