summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-21 13:34:39 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-21 13:34:39 +0100
commit07075cd0014b04660ac0d9d44267bdce72eefb5e (patch)
treecc067621e417cbef6178a6db4c619f4b582a9728 /Libraries
parent6081c7651582065c36d5316ae526140b2a4adc46 (diff)
downloadserenity-07075cd0014b04660ac0d9d44267bdce72eefb5e.zip
Kernel+LibC: Clean up open() flag (O_*) definitions
These were using a mix of decimal, octal and hexadecimal for no reason.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibC/fcntl.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/Libraries/LibC/fcntl.h b/Libraries/LibC/fcntl.h
index 1fa8f54519..8f447a3bb8 100644
--- a/Libraries/LibC/fcntl.h
+++ b/Libraries/LibC/fcntl.h
@@ -39,21 +39,21 @@ __BEGIN_DECLS
#define FD_CLOEXEC 1
-#define O_RDONLY 1
-#define O_WRONLY 2
-#define O_RDWR 3
-#define O_ACCMODE 3
-#define O_EXEC 4
-#define O_CREAT 0100
-#define O_EXCL 0200
-#define O_NOCTTY 0400
-#define O_TRUNC 01000
-#define O_APPEND 02000
-#define O_NONBLOCK 04000
-#define O_DIRECTORY 00200000
-#define O_NOFOLLOW 00400000
-#define O_CLOEXEC 02000000
-#define O_DIRECT 04000000
+#define O_RDONLY (1 << 0)
+#define O_WRONLY (1 << 1)
+#define O_RDWR (O_RDONLY | O_WRONLY)
+#define O_ACCMODE (O_RDONLY | O_WRONLY)
+#define O_EXEC (1 << 2)
+#define O_CREAT (1 << 3)
+#define O_EXCL (1 << 4)
+#define O_NOCTTY (1 << 5)
+#define O_TRUNC (1 << 6)
+#define O_APPEND (1 << 7)
+#define O_NONBLOCK (1 << 8)
+#define O_DIRECTORY (1 << 9)
+#define O_NOFOLLOW (1 << 10)
+#define O_CLOEXEC (1 << 11)
+#define O_DIRECT (1 << 12)
#define S_IFMT 0170000
#define S_IFDIR 0040000