[libc-commits] [libc] [libc] Refactor core Linux syscalls to use syscall_wrappers (PR #185983)
Alexey Samsonov via libc-commits
libc-commits at lists.llvm.org
Thu Mar 12 09:57:53 PDT 2026
================
@@ -0,0 +1,68 @@
+.. _syscall_wrapper_refactor:
+
+==============================
+Syscall Wrapper Refactoring
+==============================
+
+Purpose
+=======
+
+LLVM-libc is transitioning to a centralized system for Linux syscalls. The goal
+is to move all direct ``syscall_impl`` calls into a dedicated directory:
+``src/__support/OSUtil/linux/syscall_wrappers/``.
+
+This refactor provides several benefits:
+
+* **Type Safety**: Using ``ErrorOr<T>`` ensures that error conditions are
+ handled explicitly.
+* **Consistency**: Standardizes the conversion of syscall return values into
+ errno-compatible objects.
+* **Maintainability**: Centralizes platform-specific syscall logic, making it
+ easier to audit and update.
----------------
vonosmas wrote:
Also, Reusability - so that we can use the syscall implementation from implementations of multiple functions, without breaking llvm-libc design principle of not having public APIs depend on other public APIs.
https://github.com/llvm/llvm-project/pull/185983
More information about the libc-commits
mailing list