1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:05:08 +00:00
Commit graph

746 commits

Author SHA1 Message Date
Idan Horowitz
7b24fc6fb8 Kernel+LibC: Stub out getifaddrs() and freeifaddrs()
These are required for some ports.
2021-12-22 00:02:36 -08:00
Idan Horowitz
468ae105d8 Kernel+LibC: Stub out if_nameindex() and if_freenameindex()
These should allow users to receive the names of network interfaces in
the system, but for now these are only stubs required to compile some
ports.
2021-12-22 00:02:36 -08:00
Idan Horowitz
efb69508f4 LibC: Add the netinet/if_ether.h header and define ETH_ALEN
This header defines various constants related to ethernet packets,
with ETH_ALEN being the length of an ethernet address (which is needed
by some ports).
2021-12-22 00:02:36 -08:00
Idan Horowitz
3080cc16ec LibC: Stub out munlock()
This function is supposed to unlock memory ranges that were locked by
mlock, but since mlock is stubbed out right now, this is a no-op.
2021-12-22 00:02:36 -08:00
Tim Schumacher
dfc682dc40 LibC: Remove deprecation warnings from "unsafe" string functions
We have close to zero usages of the C string functions in our codebase
(including the "safe" alternatives), so the deprecation warnings are
unlikely to have an actual effect on preventing large-scale use of the
"unsafe" functions.

Meanwhile, the deprecation warnings are causing issues for ports that
are compiled using -Werror by default, and are generally a large source
for logspam when compiling.
2021-12-21 19:42:49 -08:00
Brian Gianforcaro
1fdd1915c2 LibC: Add POSIX spec comments for stat APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
890fba95f7 LibC: Add POSIX spec comments for posix_spawn APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
6fe71970f5 LibC: Add POSIX spec comments for signal APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
ea355fbf17 LibC: Add POSIX spec comments for search APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
140a544051 LibC: Add POSIX spec comments for stdio APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
7fd1de01a7 LibC: Add POSIX spec comments for stdlib APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
11a12c2312 LibC: Add POSIX spec comments for string APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
0f53e0aaea LibC: Add POSIX spec comments for sched APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
6db9b6cf79 LibC: Add POSIX spec comments for qsort 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
e9c46a23c8 LibC: Add POSIX spec comments for select APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
5568aee35f LibC: Add POSIX spec comments for memory management APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
4484634d8a LibC: Add POSIX spec comments for socket APIs 2021-12-21 18:16:48 -08:00
Brian Gianforcaro
3c897d0443 LibC: Add POSIX spec comments for poll 2021-12-21 18:16:48 -08:00
Nick Johnson
08e4a1a4dc AK+Everywhere: Replace __builtin bit functions
In order to reduce our reliance on __builtin_{ffs, clz, ctz, popcount},
this commit removes all calls to these functions and replaces them with
the equivalent functions in AK/BuiltinWrappers.h.
2021-12-21 22:13:51 +01:00
Ali Mohammad Pur
ccb9cae8e9 LibC: Make WEOF a signed value on clang
The actual value is unchanged, but the previous `0xffffffff` was an
unsigned value, which lead to clang getting mad at `foowc() == WEOF`.
This commit makes it a signed int on clang, which *should* serve
the same purpose and not lead to clang getting mad at us.
2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
0d7d2b825e LibC: Add POSIX spec links to all applicable wide character functions 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
0fdf52f6dd LibC: Define WCHAR_{MIN,MAX} 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
687a3351c2 LibC: Stub out wcsftime() 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
e717ca32d1 LibC: Implement ungetwc() 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
14b91a3fe9 LibC: Stub out some wscanf variants 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
f0709c7a24 LibC+AK: Implement all sorts of wprintf variants 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
db7a6d6e74 LibC: Implement f{get,put}ws() 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
bd9a22e7e7 LibC: Stub out fwide()
This is a mess, and I'd rather not perform checks on every single stdio
operation, so just make it a noop.
2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
cb90856756 LibC: Implement {f,}putwc() 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
a4e8a09188 LibC: Implement getwchar() 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
cf17677206 LibC: Implement {f,}getwc() 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
3b281baf75 LibC: Implement wcs{,c}spn() 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
4f8d095f5a LibC: Sort the SOURCES entries in CMakeLists.txt 2021-12-21 21:24:36 +03:30
Ali Mohammad Pur
cacc3ee857 LibC: Switch to using east const in wchar.cpp 2021-12-21 21:24:36 +03:30
davidot
733a70671b LibRegex: Disallow duplicate named capture groups in ECMA262 parser 2021-12-21 14:04:23 +01:00
Tim Schumacher
8eca395e4c LibC: Implement wcsdup 2021-12-19 18:22:41 -08:00
Michel Hermier
0bfb7f9675 LibC: Move _abort next to abort
It should be now the only user of it, and it is more logical to have it
in `stdlib.h` than in `assert.h`
2021-12-18 21:01:10 -08:00
Michel Hermier
2c62d51e25 LibC: Remove VERIFY_NOT_REACHED() from assert.h
Both `AK/Assertions.h` and `assert.h` would define the macro if `NDEBUG`
is set.

Remove the definition from `assert.h` since it is not an ISO-C
requirement.
2021-12-18 21:01:10 -08:00
Michel Hermier
ee42acddf8 LibC: Make __assertion_failed always defined
The symbol should be always defined, in case Serenity is built with
`NDEBUG` defined, and users wants to use `assert` from `LibC`.
2021-12-18 21:01:10 -08:00
Michel Hermier
35a5305264 LibC: Remove undefined __generate_unique_filename declaration 2021-12-18 21:01:10 -08:00
Junior Rantila
1f7c196788 LibC: Make sysbeep return int instead of void
Since the beep syscall may fail it is strange that the error is
discarded by the LibC wrapper.
2021-12-18 10:36:35 -08:00
sin-ack
69ef211925 Kernel+LibC: Move errno definitions to Kernel/API/POSIX
This fixes at least half of our LibC includes in the kernel. The source
of truth for errno codes and their description strings now lives in
Kernel/API/POSIX/errno.h as an enumeration, which LibC includes.
2021-12-16 22:21:35 +03:30
sin-ack
59eb2d5de4 LibC: Implement serenity_open
This syscall is very much similar to open(2), with the difference of
accepting a string and a length, instead of requiring a null-terminated
string. This way, if the string passed is not null-terminated, we can
still perform the syscall.
2021-12-16 22:21:35 +03:30
Hendiadyoin1
dea86f511c LibC: Use FlatPtr for malloced char* address storage
This would break with the next commit, after which char* will always be
treated as c-strings.
2021-12-15 13:09:49 +03:30
Jean-Baptiste Boric
b840c8f68e LibC: Rewrite pselect() as a wrapper for ppoll() 2021-12-12 21:48:50 +01:00
Idan Horowitz
656b1dd6be LibC: Implement sigwait()
This is done internally by just calling the more modern sigtimedwait
syscall and then massaging the results to fit sigwait's interface.
2021-12-12 08:34:19 +02:00
Idan Horowitz
640844c965 LibC: Implement sigwaitinfo()
This is implemented as a simple wrapper around sigtimedwait()
2021-12-12 08:34:19 +02:00
Idan Horowitz
762e047ec9 Kernel+LibC: Implement sigtimedwait()
This includes a new Thread::Blocker called SignalBlocker which blocks
until a signal of a matching type is pending. The current Blocker
implementation in the Kernel is very complicated, but cleaning it up is
a different yak for a different day.
2021-12-12 08:34:19 +02:00
Ben Wiederhake
70e96fb917 LibCore: Implement new ptrace_peekbuf wrapper for PT_PEEKBUF syscall 2021-12-05 22:59:09 +01:00
Ben Wiederhake
3e223185b3 Kernel+strace: Remove unnecessary indirection for PEEK
Also, remove incomplete, superfluous check.
Incomplete, because only the byte at the provided address was checked;
this misses the last bytes of the "jerk page".
Superfluous, because it is already correctly checked by peek_user_data
(which calls copy_from_user).

The caller/tracer should not typically attempt to read non-userspace
addresses, we don't need to "hot-path" it either.
2021-12-05 22:59:09 +01:00