aboutsummaryrefslogtreecommitdiff
path: root/sys/linux/port/os/constants.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/linux/port/os/constants.h')
-rw-r--r--sys/linux/port/os/constants.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/sys/linux/port/os/constants.h b/sys/linux/port/os/constants.h
new file mode 100644
index 0000000..8abf1fa
--- /dev/null
+++ b/sys/linux/port/os/constants.h
@@ -0,0 +1,98 @@
+#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
+
+/* 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)