1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:24:58 +00:00
serenity/Userland/Libraries/LibC/sys
Sergey Bugaev b604640950 LibC: Fix struct declaration visibility
Isn't

"expected struct timeval *, but argument is of type struct timeval *"

a fun error message? C considers a 'struct foo' mentioned inside a
function argument to be a distinct type from 'struct foo' declared on
the global level, but only if the in-function definition comes first. So
we need to ensure that struct timeval is declared (either fully, or
forward-declared) before we declare select() and pselect(). This was
taken care of by including <sys/time.h>, but
https://github.com/SerenityOS/serenity/pull/20044 made it so that
<sys/time.h> itself includes <sys/select.h>. So if the user's program
includes <sys/time.h> (before possibly including <sys/select.h>), then
<sys/select.h>'s include of <sys/time.h> will turn into a no-op (since
<sys/time.h> is already being included), yet there will not have been a
struct timeval definition yet, and we'd get the fun error message.

Fix this by including <Kernel/API/POSIX/sys/time.h> instead of
<sys/time.h>
2023-07-29 16:51:58 -06:00
..
arch Kernel+LibC: Modify aarch64's __mcontext to store registers in an array 2023-04-06 21:19:58 +03:00
auxv.cpp LibC+LibELF: Move getauxval and AT_* flags to sys/auxv.h 2021-10-28 11:24:36 +02:00
auxv.h Kernel+Libraries: Move defines and types from sys/auxv.h to Kernel/API 2023-01-21 10:43:59 -07:00
cdefs.h LibC: Define offsetof in stddef.h instead of sys/cdefs.h 2022-02-28 20:28:01 -08:00
file.cpp LibC: Support blocking flock() 2022-07-21 16:39:22 +02:00
file.h LibC: Implement flock(2) using fcntl's F_SETLK 2021-07-20 17:44:30 +04:30
internals.h LibC+LibDl: Declare functions taking no arguments as taking void 2022-01-08 19:22:00 +01:00
ioctl.h Kernel+Userland: Move LibC/sys/ioctl_numbers to Kernel/API/Ioctl.h 2023-01-21 10:43:59 -07:00
mman.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
mman.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
param.h LibC: Add MIN, MAX and howmany macros to sys/param.h 2022-04-29 22:01:27 +02:00
poll.h LibC: Add <sys/poll.h> as an alias for <poll.h> 2021-08-22 10:29:06 +02:00
prctl.cpp LibC: Make prctl() a varargs function 2022-03-29 09:10:34 -07:00
prctl.h Kernel+Userland: Move prctl numbers header file to Kernel/API directory 2023-02-24 20:35:45 +01:00
ptrace.cpp LibCore: Implement new ptrace_peekbuf wrapper for PT_PEEKBUF syscall 2021-12-05 22:59:09 +01:00
ptrace.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
resource.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00
select.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
select.h LibC: Fix struct declaration visibility 2023-07-29 16:51:58 -06:00
socket.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
socket.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00
stat.h Kernel+LibC+LibCore: Implement mkdirat(2) 2022-12-11 19:55:37 -07:00
statvfs.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
statvfs.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
sysmacros.h Everywhere: Add serenity_dev_{makedev,major,minor} 2022-01-09 00:58:44 +01:00
time.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00
times.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
ttydefaults.h Kernel: Move TYPEDEF_* TTY macros to API/ttydefaults.h file 2023-03-01 19:36:53 -07:00
types.h Kernel+LibC: Share definitions in fcntl.h and sys/types.h 2021-08-14 19:58:11 +02:00
uio.cpp Kernel+LibC+Tests: Implement pwritev(2) 2022-12-11 19:55:37 -07:00
uio.h Kernel+LibC+Tests: Implement pwritev(2) 2022-12-11 19:55:37 -07:00
un.h Kernel+LibC: Share definitions for sys/socket.h and sys/un.h 2021-08-14 19:58:11 +02:00
utsname.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
wait.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
wait.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00