ladybird/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
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
file.cpp
file.h
internals.h
ioctl.h Kernel+Userland: Move LibC/sys/ioctl_numbers to Kernel/API/Ioctl.h 2023-01-21 10:43:59 -07:00
mman.cpp
mman.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
param.h
poll.h
prctl.cpp
prctl.h Kernel+Userland: Move prctl numbers header file to Kernel/API directory 2023-02-24 20:35:45 +01:00
ptrace.cpp
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
select.h LibC: Fix struct declaration visibility 2023-07-29 16:51:58 -06:00
socket.cpp
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
statvfs.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
sysmacros.h
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
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
utsname.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
wait.cpp
wait.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00