1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibC+Kernel: Use an enum for clockid_t values

This commit is contained in:
Andreas Kling 2021-08-10 12:56:09 +02:00
parent 595ed59eb7
commit f02d73db4d
2 changed files with 28 additions and 10 deletions

View file

@ -602,11 +602,20 @@ typedef enum {
typedef int clockid_t; typedef int clockid_t;
#define CLOCK_REALTIME 0 enum {
#define CLOCK_MONOTONIC 1 CLOCK_REALTIME,
#define CLOCK_MONOTONIC_RAW 4 #define CLOCK_REALTIME CLOCK_REALTIME
#define CLOCK_REALTIME_COARSE 5 CLOCK_MONOTONIC,
#define CLOCK_MONOTONIC_COARSE 6 #define CLOCK_MONOTONIC CLOCK_MONOTONIC
CLOCK_MONOTONIC_RAW,
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_RAW
CLOCK_REALTIME_COARSE,
#define CLOCK_REALTIME_COARSE CLOCK_REALTIME_COARSE
CLOCK_MONOTONIC_COARSE,
#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_COARSE
CLOCK_ID_COUNT,
};
#define TIMER_ABSTIME 99 #define TIMER_ABSTIME 99
#define UTSNAME_ENTRY_LEN 65 #define UTSNAME_ENTRY_LEN 65

View file

@ -52,11 +52,20 @@ struct timespec {
typedef int clockid_t; typedef int clockid_t;
#define CLOCK_REALTIME 0 enum {
#define CLOCK_MONOTONIC 1 CLOCK_REALTIME,
#define CLOCK_MONOTONIC_RAW 4 #define CLOCK_REALTIME CLOCK_REALTIME
#define CLOCK_REALTIME_COARSE 5 CLOCK_MONOTONIC,
#define CLOCK_MONOTONIC_COARSE 6 #define CLOCK_MONOTONIC CLOCK_MONOTONIC
CLOCK_MONOTONIC_RAW,
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_RAW
CLOCK_REALTIME_COARSE,
#define CLOCK_REALTIME_COARSE CLOCK_REALTIME_COARSE
CLOCK_MONOTONIC_COARSE,
#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_COARSE
CLOCK_ID_COUNT,
};
#define TIMER_ABSTIME 99 #define TIMER_ABSTIME 99
int clock_gettime(clockid_t, struct timespec*); int clock_gettime(clockid_t, struct timespec*);