[compiler-rt] [libc] [libc][sched] Implement proxy headers for `cpu_set_t`, `struct sched_param` and `sched_macros`. (PR #126303)
Krishna Pandey via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 13 10:50:26 PDT 2025
================
@@ -0,0 +1,27 @@
+//===-- Definition of macros from sched.h ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_HDR_SCHED_MACROS_H
+#define LLVM_LIBC_HDR_SCHED_MACROS_H
+
+#ifdef LIBC_FULL_BUILD
+
+#ifndef _SCHED_H
----------------
krishna2803 wrote:
The source `compiler-rt/lib/scudo/standalone/linux.cpp` that is causing the errors uses `sched.h`:
https://github.com/llvm/llvm-project/blob/3f67c42904757958fe9b30db1e37429ef1c0dfde/compiler-rt/lib/scudo/standalone/linux.cpp#L23
in the function `getNumberOfCPUs`:
https://github.com/llvm/llvm-project/blob/3f67c42904757958fe9b30db1e37429ef1c0dfde/compiler-rt/lib/scudo/standalone/linux.cpp#L164-L171
which is declared in `common.h`
https://github.com/llvm/llvm-project/blob/3f67c42904757958fe9b30db1e37429ef1c0dfde/compiler-rt/lib/scudo/standalone/common.h#L170-L171
we already have definitions for `cpu_set_t` and `sched_getaffinity` but not for `CPU_COUNT`. I planned on first implementing the proxy headers for `sched.h` related definitions and then work on #124642 for the implementation of those macros but it seems there's a cyclic dependency within these issues. Since `sched.h` is not too big of a header, I think we should go with the 1st approach:
> 1. Fulfilling our sched.h related headers to be complete enough so that usr/include/sched.h is not needed anymore in full build mode
@lntue How should I proceed? Should I complete #124642 prior to this, or implement CPU_COUNT within this PR only, which should complete the requirements for Scudo for now?
https://github.com/llvm/llvm-project/pull/126303
More information about the llvm-commits
mailing list