aboutsummaryrefslogtreecommitdiff
path: root/sys/linux/port/os/constants.h
blob: 8fb913fccf5ba9a117f59fb0f84a85338c530428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#pragma once

/* open */
#define sys·OCreate     0x40u
#define sys·ONoTTY      0x100u
#define sys·OTrunc      0x200u
#define sys·OAppend     0x400u
#define sys·ONoBlock    0x800u
#define sys·OSync       0x1000u
#define sys·OAsync      0x2000u
#define sys·OLargeFile  0x8000u
#define sys·ODirectory  0x10000u
#define sys·ONoFollow   0x20000u
#define sys·OTmpFile    0x410000u

/* device modes */
#define sys·ModeFile   0170000
#define sys·ModeDir    0040000
#define sys·ModeChar   0020000
#define sys·ModeBlock  0060000
#define sys·ModeBasic  0100000
#define sys·ModeFifo   0010000
#define sys·ModeLink   0120000
#define sys·ModeSocket 0140000

/* ioctl values */

/* mmap */
#define sys·ProtNone      0
#define sys·ProtRead      1
#define sys·ProtWrite     2
#define sys·ProtExec      4
#define sys·ProtGrowsDown 0x01000000
#define sys·ProtGrowsUp   0x02000000

#define sys·MapFile           0
#define sys·MapShared         0x01
#define sys·MapPrivate        0x02
#define sys·MapSharedValidate 0x03
#define sys·MapType           0x0f
#define sys·MapFixed          0x10
#define sys·MapAnon           0x20
#define sys·MapNoReserve      0x4000
#define sys·MapGrowsDown      0x0100
#define sys·MapDenyWrite      0x0800
#define sys·MapExecutable     0x1000
#define sys·MapLocked         0x2000
#define sys·MapPopulate       0x8000
#define sys·MapNonBlock       0x10000
#define sys·MapStack          0x20000
#define sys·MapHugetlb        0x40000
#define sys·MapSync           0x80000
#define sys·MapFixedNoReplace 0x100000

#define sys·RemapCanMove    1
#define sys·RemapFixed      2
#define sys·RemapNoUnmap    4

/* types of DirEntry (last byte) */
#define sys·EntryUnknown 0
#define sys·EntryFifo    1
#define sys·EntryChar    2
#define sys·EntryDir     4
#define sys·EntryBlock   6
#define sys·EntryFile    8
#define sys·EntryLink    10
#define sys·EntrySocket  12

/* at flags */
#define sys·FdCwd           (-100)

#define sys·AtNoFollowLink  0x100
#define sys·AtRemoveDir     0x200
#define sys·AtFollowLink    0x400
#define sys·AtEmptyPath     0x1000

/* stat(x) */

// flags
#define sys·InfoSyncLegacy 0x0000
#define sys·InfoSyncType   0x6000
#define sys·InfoForceSync  0x2000
#define sys·InfoNoSync     0x4000

// masks
#define  sys·InfoType        0x00000001u  /*  want/got stx_mode & s_ifmt */
#define  sys·InfoMode        0x00000002u  /*  want/got stx_mode & ~s_ifmt */
#define  sys·InfoNLink       0x00000004u  /*  want/got stx_nlink */
#define  sys·InfoUid         0x00000008u  /*  want/got stx_uid */
#define  sys·InfoGid         0x00000010u  /*  want/got stx_gid */
#define  sys·InfoAccessTime  0x00000020u  /*  want/got stx_atime */
#define  sys·InfoModifyTime  0x00000040u  /*  want/got stx_mtime */
#define  sys·InfoChangeTime  0x00000080u  /*  want/got stx_ctime */
#define  sys·InfoInode       0x00000100u  /*  want/got stx_ino */
#define  sys·InfoSize        0x00000200u  /*  want/got stx_size */
#define  sys·InfoBlocks      0x00000400u  /*  want/got stx_blocks */
#define  sys·InfoBasic       0x000007ffu  /*  the stuff in the normal stat struct*/
#define  sys·InfoCreateTime  0x00000800u  /*  want/got stx_btime   */
#define  sys·InfoMntId       0x00001000u  /*  got stx_mnt_id  */
#define  sys·InfoAll        (sys·InfoBasic|sys·InfoCreateTime)