blob: 03bab2a8f74bc129c2aabae5cb71b065f948a110 (
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
101
102
103
104
105
106
107
108
109
110
111
112
|
#pragma once
/* file access */
#define sys·FileExists 0
#define sys·FileCanExec 1
#define sys·FileCanWrite 2
#define sys·FileCanRead 4
/* 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
// mode masks
#define sys·InfoWantType 0x00000001u /* want/got stx_mode & s_ifmt */
#define sys·InfoWantMode 0x00000002u /* want/got stx_mode & ~s_ifmt */
#define sys·InfoWantNLink 0x00000004u /* want/got stx_nlink */
#define sys·InfoWantUid 0x00000008u /* want/got stx_uid */
#define sys·InfoWantGid 0x00000010u /* want/got stx_gid */
#define sys·InfoWantAccessTime 0x00000020u /* want/got stx_atime */
#define sys·InfoWantModifyTime 0x00000040u /* want/got stx_mtime */
#define sys·InfoWantChangeTime 0x00000080u /* want/got stx_ctime */
#define sys·InfoWantInode 0x00000100u /* want/got stx_ino */
#define sys·InfoWantSize 0x00000200u /* want/got stx_size */
#define sys·InfoWantBlocks 0x00000400u /* want/got stx_blocks */
#define sys·InfoWantBasic 0x000007ffu /* the stuff in the normal stat struct*/
#define sys·InfoWantCreateTime 0x00000800u /* want/got stx_btime */
#define sys·InfoWantMntId 0x00001000u /* got stx_mnt_id */
#define sys·InfoWantAll (sys·InfoWantBasic|sys·InfoWantCreateTime)
// helpers
#define sys·InfoMaskType 0170000
#define sys·InfoDirType 0040000
#define sys·InfoCharType 0020000
#define sys·InfoBlockType 0060000
#define sys·InfoFileType 0100000
#define sys·InfoFifoType 0010000
#define sys·InfoLinkType 0120000
#define sys·InfoSocketType 0140000
#define sys·InfoIsDir(mode) (((mode) & sys·InfoMaskType) == sys·InfoDirType)
#define sys·InfoIsChar(mode) (((mode) & sys·InfoMaskType) == sys·InfoCharType)
#define sys·InfoIsBlock(mode) (((mode) & sys·InfoMaskType) == sys·InfoBlockType)
#define sys·InfoIsFile(mode) (((mode) & sys·InfoMaskType) == sys·InfoFileType)
#define sys·InfoIsFifo(mode) (((mode) & sys·InfoMaskType) == sys·InfoFifoType)
#define sys·InfoIsLink(mode) (((mode) & sys·InfoMaskType) == sys·InfoLinkType)
#define sys·InfoIsSocket(mode) (((mode) & sys·InfoMaskType) == sys·InfoSocketType)
|