[libc-commits] [libc] 29dec35 - [libc] NFC: Fix build on systems that don't have linux/time_types.h
Mikhail R. Gadelha via libc-commits
libc-commits at lists.llvm.org
Thu Aug 3 06:30:31 PDT 2023
Author: Mikhail R. Gadelha
Date: 2023-08-03T10:30:21-03:00
New Revision: 29dec352124a5fc1dcf03a640c2621496651ee90
URL: https://github.com/llvm/llvm-project/commit/29dec352124a5fc1dcf03a640c2621496651ee90
DIFF: https://github.com/llvm/llvm-project/commit/29dec352124a5fc1dcf03a640c2621496651ee90.diff
LOG: [libc] NFC: Fix build on systems that don't have linux/time_types.h
This broke some bots that don't have linux/time_types.h available
(libc-x86_64-debian-*).
The header is needed because of __kernel_timespec, and since this is
only needed when SYS_sched_rr_get_interval_time64 is available, guarding
the include should fix the broken bot.
Added:
Modified:
libc/src/sched/linux/sched_rr_get_interval.cpp
Removed:
################################################################################
diff --git a/libc/src/sched/linux/sched_rr_get_interval.cpp b/libc/src/sched/linux/sched_rr_get_interval.cpp
index b79e96d08a6ecf..9ba1e8d98af415 100644
--- a/libc/src/sched/linux/sched_rr_get_interval.cpp
+++ b/libc/src/sched/linux/sched_rr_get_interval.cpp
@@ -12,9 +12,12 @@
#include "src/__support/common.h"
#include "src/errno/libc_errno.h"
-#include <linux/time_types.h> // For __kernel_timespec.
#include <sys/syscall.h> // For syscall numbers.
+#ifdef SYS_sched_rr_get_interval_time64
+#include <linux/time_types.h> // For __kernel_timespec.
+#endif
+
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, sched_rr_get_interval,
More information about the libc-commits
mailing list