[libc] [llvm] [libc] add remaining epoll functions, pipe (PR #84587)
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 13:07:15 PDT 2024
================
@@ -0,0 +1,25 @@
+//===-- Implementation header for epoll_ctl function ------------*- C++ -*-===//
+//
+// 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_SRC_SYS_EPOLL_EPOLL_CTL_H
+#define LLVM_LIBC_SRC_SYS_EPOLL_EPOLL_CTL_H
+
+// TODO: Use this include once the include headers are also using quotes.
----------------
nickdesaulniers wrote:
Copying notes from an in person discussion.
I think it will help us avoid including system headers (which we have a linter check for, which is the largest blocker to getting the linter re-enabled in post- then pre- submit) which may make use of hazards like `#include_next` (which was a repeated issue with `stdint.h`) if we provide definitions which are compatible with the systems we support. Those systems have well defined ABIs that are unlikely to change (without massive heads up to native application developers). And when these definitions differ between platforms, we have control over which mutually exclusive definition we build against.
So, for this PR, I think we can avoid `#include <sys/epoll.h>` by improving our definition of `struct epoll_event` in libc/include/llvm-libc-types/struct_epoll_event.h to denote that it's packed for x86_64, then I think we can use our libc/include/llvm-libc-types/struct_epoll_event.h and avoid <sys/epoll.h> or the curious <linux/eventpoll.h>.
https://github.com/llvm/llvm-project/pull/84587
More information about the llvm-commits
mailing list