diff --git a/kal/libc/newlib/porting/include/sys/fcntl.h b/kal/libc/newlib/porting/include/sys/fcntl.h index 8ecae833..3a823619 100644 --- a/kal/libc/newlib/porting/include/sys/fcntl.h +++ b/kal/libc/newlib/porting/include/sys/fcntl.h @@ -35,4 +35,10 @@ #define O_NDELAY _FNDELAY +#ifdef __riscv +#ifndef O_CLOEXEC +#define O_CLOEXEC 02000000 +#endif +#endif /* __riscv */ + #endif /* !_ADAPT_SYS_FCNTL_H */ diff --git a/kal/libc/newlib/porting/include/time.h b/kal/libc/newlib/porting/include/time.h index b1659482..9632d6c8 100644 --- a/kal/libc/newlib/porting/include/time.h +++ b/kal/libc/newlib/porting/include/time.h @@ -37,4 +37,38 @@ #include_next +#ifdef __riscv +#ifndef CLOCK_MONOTONIC_RAW +#define CLOCK_MONOTONIC_RAW 12 +#endif + +#ifndef CLOCK_REALTIME_COARSE +#define CLOCK_REALTIME_COARSE 5 +#endif + +#ifndef CLOCK_MONOTONIC_COARSE +#define CLOCK_MONOTONIC_COARSE 6 +#endif + +#ifndef CLOCK_BOOTTIME +#define CLOCK_BOOTTIME 7 +#endif + +#ifndef CLOCK_REALTIME_ALARM +#define CLOCK_REALTIME_ALARM 8 +#endif + +#ifndef CLOCK_BOOTTIME_ALARM +#define CLOCK_BOOTTIME_ALARM 9 +#endif + +#ifndef CLOCK_SGI_CYCLE +#define CLOCK_SGI_CYCLE 10 +#endif + +#ifndef CLOCK_TAI +#define CLOCK_TAI 11 +#endif +#endif /* __riscv */ + #endif /* !_ADAPT_TIME_H */