8 changes: 3 additions & 5 deletions libc/src/sys/epoll/epoll_wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
#ifndef LLVM_LIBC_SRC_SYS_EPOLL_EPOLL_WAIT_H
#define LLVM_LIBC_SRC_SYS_EPOLL_EPOLL_WAIT_H

// TODO: Use this include once the include headers are also using quotes.
// #include "include/llvm-libc-types/struct_epoll_event.h"

#include <sys/epoll.h>
#include "hdr/types/struct_epoll_event.h"

namespace LIBC_NAMESPACE {

int epoll_wait(int epfd, epoll_event *events, int maxevents, int timeout);
int epoll_wait(int epfd, struct epoll_event *events, int maxevents,
int timeout);

} // namespace LIBC_NAMESPACE

Expand Down
14 changes: 10 additions & 4 deletions libc/src/sys/epoll/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ add_entrypoint_object(
HDRS
../epoll_wait.h
DEPENDS
libc.include.sys_epoll
libc.hdr.types.sigset_t
libc.hdr.types.struct_epoll_event
libc.hdr.types.struct_timespec
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
Expand All @@ -18,7 +20,9 @@ add_entrypoint_object(
HDRS
../epoll_pwait.h
DEPENDS
libc.include.sys_epoll
libc.hdr.types.sigset_t
libc.hdr.types.struct_epoll_event
libc.hdr.types.struct_timespec
libc.include.signal
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand All @@ -32,10 +36,12 @@ add_entrypoint_object(
HDRS
../epoll_pwait2.h
DEPENDS
libc.include.sys_epoll
libc.hdr.types.sigset_t
libc.hdr.types.struct_epoll_event
libc.hdr.types.struct_timespec
libc.include.signal
libc.include.time
libc.include.sys_syscall
libc.include.time
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
10 changes: 3 additions & 7 deletions libc/src/sys/epoll/linux/epoll_pwait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@

#include "src/sys/epoll/epoll_pwait.h"

#include "hdr/types/sigset_t.h"
#include "hdr/types/struct_epoll_event.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

// TODO: Use this include once the include headers are also using quotes.
// #include "include/llvm-libc-types/sigset_t.h"
// #include "include/llvm-libc-types/struct_epoll_event.h"

#include <sys/epoll.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE {

Expand Down
12 changes: 4 additions & 8 deletions libc/src/sys/epoll/linux/epoll_pwait2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@

#include "src/sys/epoll/epoll_pwait2.h"

#include "hdr/types/sigset_t.h"
#include "hdr/types/struct_epoll_event.h"
#include "hdr/types/struct_timespec.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

// TODO: Use this include once the include headers are also using quotes.
// #include "include/llvm-libc-types/sigset_t.h"
// #include "include/llvm-libc-types/struct_epoll_event.h"
// #include "include/llvm-libc-types/struct_timespec.h"

#include <sys/epoll.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE {

Expand Down
9 changes: 3 additions & 6 deletions libc/src/sys/epoll/linux/epoll_wait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@

#include "src/sys/epoll/epoll_wait.h"

#include "hdr/types/sigset_t.h"
#include "hdr/types/struct_epoll_event.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/errno/libc_errno.h"
#include <sys/syscall.h> // For syscall numbers.

// TODO: Use this include once the include headers are also using quotes.
// #include "include/llvm-libc-types/sigset_t.h"
// #include "include/llvm-libc-types/struct_epoll_event.h"

#include <sys/epoll.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE {

Expand Down
8 changes: 4 additions & 4 deletions libc/src/sys/select/linux/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

#include "src/sys/select/select.h"

#include "hdr/types/sigset_t.h"
#include "hdr/types/struct_timespec.h"
#include "src/__support/CPP/limits.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "src/errno/libc_errno.h"
#include <signal.h>
#include <stddef.h> // For size_t
#include <sys/select.h>

#include <stddef.h> // For size_t
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE {
Expand Down
13 changes: 13 additions & 0 deletions utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3417,6 +3417,15 @@ libc_function(

############################## sys/epoll targets ###############################

libc_support_library(
name = "types_sigset_t",
hdrs = ["hdr/types/sigset_t.h"],
)
libc_support_library(
name = "types_struct_epoll_event",
hdrs = ["hdr/types/struct_epoll_event.h"],
)

libc_function(
name = "epoll_wait",
srcs = ["src/sys/epoll/linux/epoll_wait.cpp"],
Expand All @@ -3429,6 +3438,8 @@ libc_function(
deps = [
":__support_osutil_syscall",
":errno",
":types_sigset_t",
":types_struct_epoll_event",
],
)

Expand All @@ -3444,6 +3455,8 @@ libc_function(
deps = [
":__support_osutil_syscall",
":errno",
":types_sigset_t",
":types_struct_epoll_event",
],
)

Expand Down