summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-09-16 12:29:48 -0400
committerAndreas Kling <kling@serenityos.org>2020-09-17 17:23:01 +0200
commitae5ba4074d86de200b08a34f0b5886a910000883 (patch)
tree3e578149e26e51a783e71fcd18f90cabe682e66e
parent416d470d07744592f186b65de7074f94edf39824 (diff)
downloadserenity-ae5ba4074d86de200b08a34f0b5886a910000883.zip
LibC: Convert SO_ constants to enum
I want to add another entry to this list and don't want to have to think of a number for it.
-rw-r--r--Kernel/UnixTypes.h17
-rw-r--r--Libraries/LibC/sys/socket.h26
2 files changed, 28 insertions, 15 deletions
diff --git a/Kernel/UnixTypes.h b/Kernel/UnixTypes.h
index 4df6475caf..f6a7862532 100644
--- a/Kernel/UnixTypes.h
+++ b/Kernel/UnixTypes.h
@@ -462,13 +462,16 @@ struct pollfd {
#define SOL_SOCKET 1
-#define SO_RCVTIMEO 1
-#define SO_SNDTIMEO 2
-#define SO_ERROR 4
-#define SO_PEERCRED 5
-#define SO_REUSEADDR 6
-#define SO_BINDTODEVICE 7
-#define SO_KEEPALIVE 9
+enum {
+ SO_RCVTIMEO,
+ SO_SNDTIMEO,
+ SO_TYPE,
+ SO_ERROR,
+ SO_PEERCRED,
+ SO_REUSEADDR,
+ SO_BINDTODEVICE,
+ SO_KEEPALIVE,
+};
#define IPPROTO_IP 0
#define IPPROTO_ICMP 1
diff --git a/Libraries/LibC/sys/socket.h b/Libraries/LibC/sys/socket.h
index 898269fb8e..e63403c564 100644
--- a/Libraries/LibC/sys/socket.h
+++ b/Libraries/LibC/sys/socket.h
@@ -90,14 +90,24 @@ struct ucred {
#define SOL_SOCKET 1
#define SOMAXCONN 128
-#define SO_RCVTIMEO 1
-#define SO_SNDTIMEO 2
-#define SO_TYPE 3
-#define SO_ERROR 4
-#define SO_PEERCRED 5
-#define SO_REUSEADDR 6
-#define SO_BINDTODEVICE 7
-#define SO_KEEPALIVE 9
+enum {
+ SO_RCVTIMEO,
+ SO_SNDTIMEO,
+ SO_TYPE,
+ SO_ERROR,
+ SO_PEERCRED,
+ SO_REUSEADDR,
+ SO_BINDTODEVICE,
+ SO_KEEPALIVE,
+};
+#define SO_RCVTIMEO SO_RCVTIMEO
+#define SO_SNDTIMEO SO_SNDTIMEO
+#define SO_TYPE SO_TYPE
+#define SO_ERROR SO_ERROR
+#define SO_PEERCRED SO_PEERCRED
+#define SO_REUSEADDR SO_REUSEADDR
+#define SO_BINDTODEVICE SO_BINDTODEVICE
+#define SO_KEEPALIVE SO_KEEPALIVE
struct sockaddr_storage {
union {