summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC
AgeCommit message (Collapse)Author
2021-10-20LibC: Add missing header in search.hBen Wiederhake
2021-10-17LibC: Define ULLONG_MAXL Pereira
Some ports require this constant to be defined as it is specified in the standard[1]. [1] https://www.cplusplus.com/reference/climits/
2021-10-17Everywhere: Make some symbols `__attribute__((used))` for LTODaniel Bertalan
With these changes, the userland builds correctly with Clang's ThinLTO enabled.
2021-10-17LibC: Primitively implement wcsxfrmDaniel Bertalan
The `wcsxfrm` function copies a wide character string into a buffer, such that comparing the new string against any similarly pre-processed string with `wcscmp` produces the same result as if the original strings were compared with `wcscoll`. Our current `wcscoll` implementation is simply an alias for `wcscmp`, so `wcsxfrm` needs to perform no actions other than copying the string.
2021-10-17LibC: Implement wcslcpyDaniel Bertalan
2021-10-17LibC: Fix wcsrchr declaration to return a non-const wchar*Daniel Bertalan
This is how the standard specifies it; similarly to the already correctly declared wcschr function.
2021-10-17LibC: Stub out mbsnrtowcsDaniel Bertalan
2021-10-17LibC: Stub out wcsnrtombsDaniel Bertalan
2021-10-17LibC: Implement wmemcmpDaniel Bertalan
2021-10-17LibC: Add ELAST errno macroDaniel Bertalan
The ELAST macro is used on many systems to refer to the largest possible valid errno value. LLVM's libc++ uses errno values of ELAST+1 and ELAST+2 internally, and defines an arbitrary fallback value for platforms which don't have the macro. This means that it's possible for their internal errno numbers could coincide with values we actually use, which would be a very bad thing.
2021-10-17LibC: Forward-declare `struct tm` in wchar.hDaniel Bertalan
The C standard specifies that this forward-declaration be present in wchar.h, and is needed in order to build libstdc++.
2021-10-17LibC: Implement wctobTim Schumacher
2021-10-17LibC: Implement mbstowcsTim Schumacher
2021-10-17LibC: Implement wctombTim Schumacher
2021-10-15LibC: Implement mbsrtowcsTim Schumacher
2021-10-15LibC: Implement wcsrtombsTim Schumacher
2021-10-15LibC: Implement wcrtombDaniel Bertalan
This function converts a single wide character into its multibyte representation (UTF-8 in our case). It is called from libc++'s `std::basic_ostream<wchar_t>::flush`, which gets called at program exit from a global destructor in order to flush `std::wcout`.
2021-10-15LibC: Partially implement wcwidthTim Schumacher
2021-10-15LibC: Stub out tdeleteTim Schumacher
2021-10-15LibC: Implement twalkTim Schumacher
2021-10-15LibC: Implement tfind and tsearchTim Schumacher
2021-10-15LibC: Mark termcap symbols as weakTim Schumacher
Otherwise, we may end up preferring those over the more accurate implementation in ncurses (if available).
2021-10-13LibC: Use the new pread syscall to implement preadRodrigo Tobar
This new implementation of pread saves two lseek system calls and is thread-safe thanks to it simply forwarding the call to the pread system call.
2021-10-09Kernel: Add ioctl request for getting a storage device's block sizeDavid Isaksson
2021-10-09Kernel: Add STORAGE_DEVICE_GET_SIZE ioctl requestDavid Isaksson
This ioctl request makes it possible to get the size of a storage device that has not yet been mounted.
2021-10-06LibC: Fix redeclaration in x86_64/regs.hBen Wiederhake
In QtCreator (and under weird configurations with gcc), this used to fail with the error messages like: "error: member of anonymous union redeclares '___'". This patch gives each member a unique name.
2021-10-06LibC: Make sure ARCH macro is available before useBen Wiederhake
2021-10-04Everywhere: Fix more Copyright header inconsistenciesTim Schumacher
2021-10-03LibC: Implement mbrtowc closer to POSIXTim Schumacher
2021-10-03LibC: Specifically clear only stored bytes after successful mbrtowcTim Schumacher
2021-10-03LibC: Manually count stored bytes in mbstate_tTim Schumacher
This is probably a bit faster than constantly having to look through all stored bytes. It also helps when we are trying to store actual null bytes.
2021-10-03LibC: Remove the mbstate_reset helperTim Schumacher
A zero-initialized mbstate_t struct has to be a valid initial state, so we can just zero-initialize it whenever we need to reset. Having a helper function for resetting the struct might imply that you can add additional setup operations afterwards, which is not the case.
2021-10-03LibC: Stub out swprintfTim Schumacher
2021-10-03LibC: Stub out wcstoldTim Schumacher
2021-10-03LibC: Stub out wcstodTim Schumacher
2021-10-03LibC: Stub out wcstofTim Schumacher
2021-10-03LibC: Stub out wcstoullTim Schumacher
2021-10-03LibC: Stub out wcstoulTim Schumacher
2021-10-03LibC: Implement wmemmoveTim Schumacher
2021-10-03LibC: Implement wmemsetTim Schumacher
2021-10-03LibC: Implement wmemcpyTim Schumacher
2021-10-03LibC: Implement wmemchrTim Schumacher
2021-10-03LibC: Implement wcsstrTim Schumacher
2021-10-03LibC: Implement wcspbrkTim Schumacher
2021-09-26LibC+LibELF: Add definitions for extra dtagsRodrigo Tobar
These are found in some libraries, and LibELF doesn't know how to handle them, not even their name. Adding these definitions should at least help readelf display information correctly, but more work is needed to actually implement them.
2021-09-23LibC: Add getpriority() and setpriority() stubsJelle Raaijmakers
Expected behavior left as a FIXME is outlined here: https://pubs.opengroup.org/onlinepubs/7908799/xsh/getpriority.html
2021-09-23LibC: Add chroot() stubJelle Raaijmakers
Expected behavior left as a FIXME is described here: https://pubs.opengroup.org/onlinepubs/7908799/xsh/chroot.html It is marked as LEGACY but still used in projects such as PHP.
2021-09-20LibC+DynamicLoader: Store the auxiliary vector address at startupItamar
Previously, getauxval() got the address of the auxiliary vector by traversing to the end of the `environ` pointer. The assumption that the auxiliary vector comes after the environment array is true at program startup, however the environment array may be re-allocated and change its address during runtime which would cause getauxval() to work with an incorrect auxiliary vector address. To fix this, we now get the address of the auxiliary vector once in __libc_init and store it in a libc-internal pointer which is then used by getauxval(). Fixes #10087.
2021-09-20LibC: Spec compliant IN6_IS_ADDR_V4MAPPEDKenneth Myhra
An IPv4 mapped IPv6 address consist of 80 "0" bits, followed by 16 "1" bits, followed by the 32-bit IPv4 address. Example of IPv4 mapped IPv6 address: IPv4 address: 169.219.13.133 IPv6 address: 0000:0000:0000:0000:FFFF:A9DB:0D85 Simplified : ::FFFF:A9DB:0D85
2021-09-20AK+LibC: Remove SERENITY_LIBC_BUILD guard around `<initializer_list>`Andrew Kaster
This was required before commit 5f724b6ca1aae3a5a8c7189069649e8a9347cca2 when we were building LibC before libstdc++ headers were available in the sysroot. However as noted in that commit, we never actually needed to be building LibC before libstdc++, so we can go ahead and remove this ancient hack.