aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/include
AgeCommit message (Collapse)AuthorFilesLines
11 daysmips: Implement MIPS HAL and UHIJovan Dmitrović3-2/+22
Implement abstract interface for MIPS, including unified hosting interface (UHI). Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
13 daysnewlib: increase jump buffer length to 25 to fit all non-volatile registers ↵Radek Bartoň1-1/+10
for aarch64-pc-cygwin Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-06-24libc: Update the guard for quick_exit() and at_quick_exit() functionsMazen Adel Elmessady1-1/+4
Updated the guard for stdlib functions to use the POSIX Issue 8 guard added in 2024.
2025-06-24libc/../pthread.h: Updated the guard for Posix Issue 8 functionsMazen Adel Elmessady1-6/+6
Updated the guard for pthread functions added in POSIX Issue 8 to use the POSIX Issue 8 guard added in 2024. These functions are: pthread_mutex_clocklock() pthread_cond_clockwait() pthread_rwlock_clockrdlock() pthread_rwlock_clockwrlock()
2025-06-24libc: Added timespec_get() to time.hMazen Adel Elmessady1-0/+5
Added timespec_get() prototype to libc/include/time.h and removed the prototype from winsup/cygwin/include/cygwin/time.h
2025-06-18add value for _h_errno in _REENT_INIT(var) for struct, _reentJohannes Rosa1-1/+2
The define '_REENT_INIT' for the case '!_REENT_SMALL' was missing an initializing value for 'int _h_errno'. If code uses the _REENT_INIT() macro to preset a variable of type struct _reent, this led to an issue when compiling with -Wmissing-field-initializers.
2025-05-02Newlib: Update search.h functions for POSIX.1-2024Mark Geisert1-4/+6
Add type posix_tnode. Change certain uses of "void" to "posix_tnode" in both the prototypes and definitions of functions associated with <search.h>. (Necessary changes to Cygwin's /usr/include/search.h will follow in a separate patch to be sent to cygwin-patches.) Reported-by: Collin Funk <collin.funk1@gmail.com> Addresses: https://cygwin.com/pipermail/cygwin/2025-April/258032.html Signed-off-by: Mark Geisert <mark@maxrnd.com> Fixes: ec98d19a08c2 "* wininfo.h (wininfo::timer_active): Delete."
2025-04-11newlib: sys/unistd.h: Change inline to __inlineTakashi Yano1-1/+1
Addresses: https://sourceware.org/pipermail/cygwin-patches/2025q2/013644.html Fixes: 3e8a7eb1a868 ("sys/unistd.h: fix definition of setproctitle_init") Reported-by: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca> Co-authored-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-03-24getlocalename_l: allow LC_ALL categoryCorinna Vinschen1-2/+9
Following the changes from Austin Group bug https://www.austingroupbugs.net/view.php?id=1741, getlocalename_l() now allows to specify LC_ALL and returns a setlocale-conmpatible LC_ALL locale string. Consequentially we have to raise the size of _reent::_getlocalename_l_buf so there's enough space for the LC_ALL locale string. Guard all different definitions and usages of _getlocalename_l_buf in reent.h with _MB_CAPABLE. Link: https://www.austingroupbugs.net/view.php?id=1741 Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-03-05sys/unistd.h: fix definition of setproctitle_initCorinna Vinschen1-1/+1
setproctitle_init is defined in c2x manner, omitting names for the unused parameters. This can result in warnings or errors on certain compiler versions: clang 8: error: parameter name omitted clang 15: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions] gcc -Wsystem-headers -pedantic -std=c17: warning: ISO C does not support omitting parameter names in function definitions before C2X [-Wpedantic] Add parameters to avoid above warning and errors. Fixes: 2e7f7b96e5f1 ("Cygwin: implement setproctitle") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-02-14unistd.h: enable SEEK_DATA and SEEK_HOLE also for POSIX-1.2024Christian Franke1-1/+1
https://pubs.opengroup.org/onlinepubs/9799919799/functions/lseek.html Signed-off-by: Christian Franke <christian.franke@t-online.de>
2025-01-28unistd.h: declare posix_closeCorinna Vinschen1-0/+10
Declare posix_close, a new function defined by POSIX-1.2024, per https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_close.html Define POSIX_CLOSE_RESTART. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-23devctl.h: update for POSIX-1.2024Corinna Vinschen1-16/+0
posix_devctl is now part of POSIX-1.2024, thus the requirement to define _POSIX_26_C_SOURCE has been dropped. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-16Add posix_spawn_file_actions_add{f}chdirCorinna Vinschen1-2/+7
POSIX®.1-2024 now defines posix_spawn_file_actions_addchdir and posix_spawn_file_actions_addfchdir. Add these interfaces to spawn.h, guarded as POSIX 202405 symbols. Cygwin-only: Export them as aliases of the *_np counterparts. Bump API minor. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-12-12Cygwin: sched_setscheduler: accept SCHED_RESET_ON_FORK flagChristian Franke1-0/+3
Add SCHED_RESET_ON_FORK to <sys/sched.h>. If this flag is set, SCHED_FIFO and SCHED_RR are reset to SCHED_OTHER and negative nice values are reset to zero in each child process created with fork(2). Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-12Cygwin: sched_setscheduler: accept SCHED_BATCHChristian Franke1-0/+1
Add SCHED_BATCH to <sys/sched.h>. SCHED_BATCH is similar to SCHED_OTHER, except that the nice value is mapped to a one step lower Windows priority. Rework the mapping functions to ease the addition of this functionality. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-04Cygwin: sched_setscheduler: accept SCHED_IDLEChristian Franke1-0/+4
Add SCHED_IDLE to <sys/sched.h>. If SCHED_IDLE is selected, preserve the nice value and set the Windows priority to IDLE_PRIORITY_CLASS. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-11-20newlib/libc/include/time.h: Removed clock_id castsAaron Nyholm1-10/+10
The POSIX specification defines these as constants. The cast is unnecessary. This brings newlib inline with the equivalent FreeBSD defines.
2024-11-04sys/features.h: Use _ISOC23_SOURCE instead of _ISOC23_SOURCE and remap ↵Lenard Mollenkopf1-7/+14
_ISOC2x_SOURCE to _ISOC23_SOURCE Signed-off-by: Lenard Mollenkopf <newlib@lenardmollenkopf.de>
2024-10-28sys/features.h: Spelling _ISOC2x_SOURCE is not C11Lenard Mollenkopf1-1/+1
2024-09-02Replace __restrict with __restrict_arr in regex.hyang.zhang1-1/+1
when a C++ source file include this header file, it would build fail. Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
2024-08-21arc64: Add port for Synopsys DesignWare ARCv3 ISAYuriy Kolerov2-0/+14
Synopsys ARCv3 ISA includes 32-bit ARC HS5x targets and 64-bit ARC HS6x targets. Both CPU families are placed in "arc64" subdirectories as it done for GCC port. Target name arc64 is used for historical reasons and Synopsys ARCv3 baremetal toolchains contain multilib configurations both for 32-bit and 64-bit families. arc32 target name is reserved for 32-bit ARC HS5x targets in case of non-multilib 32-bit builds. Note that libgloss libraries for ARCv3 are compatible with libgloss for ARCv1/2. Thus, Makefile.inc for libgloss uses sources from libgloss/arc directory except crtX.S files. Co-authored-by: Shahab Vahedi <list@vahedi.org> Co-authored-by: Claudiu Zissulescu <claziss@gmail.com> Co-authored-by: Bruno Mauricio <brunoasmauricio@gmail.com> Co-authored-by: Luis Silva <luis.m.silva99@hotmail.com> Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
2024-08-20Fix glob() functionJordi Sanfeliu1-0/+1
Fixed glob() function to return GLOB_NOMATCH if pattern does not match any existing pathname (and GLOB_NOCHECK was not set in flags).
2024-08-19newlib/libc/include/sys/tree.h: Add deprecation warningJoel Sherrill1-0/+4
2024-08-19libc/include/sys/tree.h: Re-add sys/tree.hJoel Sherrill1-0/+864
Reverts 1339af44679aee0895fe311cfad89d38cfc2b919
2024-08-15stdlib.h: define __itoa/__utoa while building newlibCorinna Vinschen1-1/+1
This avoids a `__utoa undefined' warning when building newlib for Cygwin. We still need to export the symbols for backward compatibility. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-08-15Fix POSIX guards for POSIX.1-2024 extensionsCorinna Vinschen2-3/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-08-15features.h: support POSIX.1-2024Corinna Vinschen1-3/+15
TBD: Align _GNU_SOURCE, too? Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-08-15features.h: fix whitespaceCorinna Vinschen1-44/+44
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-07-30stdatomic: make atomics compatible with GCC-14Alexey Lapshin1-1/+2
https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631525.html brings c_atomic and cxx_atomic definitions into GCC. This patch makes atomics type detection correct for GCC. https://github.com/freebsd/freebsd-src/commit/680f40f38343de118d5b973129683804e496faaf
2024-07-09sys/tree.h: RemovedJoel Sherrill1-864/+0
This file was from a specific older FreeBSD version. There have been multiple changes to this file with FreeBSD 14 including breaking changes to the file. Including this file as part of newlib results in not always having the correct version of sys/tree.h for any specific software. RTEMS will manage its use of this file outside of newlib.
2024-07-09libc/include/sys/resource.h: Add RUSAGE_THREADJoel Sherrill1-0/+3
2024-07-09sys: Remove $FreeBSD$: two-line .h patternWarner Losh1-2/+0
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2024-07-09spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh1-1/+1
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2024-07-09sys/stdatomic.h: be nicer to c++Konstantin Belousov1-0/+10
Use of stdatomic.h is undefined in C++, even the C++ 2020 standard does not list stdatomic.h as a C library header supported by the language. More, there are some subtle differences between the <atomic> C++ header, and C11+ stdatomic.h provided features. Nonetheless, it is a quality of the implementation aspect, so let mis-users mis-use stdatomic.h as they want, by making a compat shim for _Bool. PR: 262683 Reported by: yuri Reviewed by: dim, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34686
2024-07-09sys/sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni1-0/+2
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
2024-07-03libc/include/complex.h: Add CMPLX, CMPLXF, and CMPLXLJoel Sherrill1-0/+13
2024-07-03libc/include/sys/_default_fcntl.h: O_RSYNC and O_DSYNC are POSIXJoel Sherrill1-2/+3
These should not be in a Cygewin conditional.
2024-05-22arc: libc: Record r58/r59 in long-jump's bufferShahab Vahedi1-1/+1
The "longjmp" expects the "setjmp" to save the r58/r59 registers, if there is any. With this change they are saved accordingly. Checked for regression with running GCC's DejaGnu tests: $ runtest execute.exp=pr56982.c dg-torture.exp=pr48542.c Signed-off-by: Shahab Vahedi <shahab@synopsys.com>
2024-03-13libc/include/sys/select.h: Use elif not elifdefJoel Sherrill1-1/+1
The cpp directive "elifdef" is only available in very recent GCC versions. This should be able to compile on older toolchains in C99 mode.`
2024-03-13RTEMS: Increase FS_SETSIZE to 256 bitsChris Johns1-0/+2
2024-02-28Cygwin: add compile warning if ENOSHARE or ECASECLASH is usedChristian Franke1-3/+3
These errno values are no longer used by Cygwin. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-02-05getlocalename_l: fix _reent for _REENT_SMALL targetsCorinna Vinschen1-1/+6
The new _MB_CAPABALE-only _misc_reent member getlocalename_l_buf was incorrectly initialized in the _REENT_INIT_MISC macro, so the build failed for _REENT_SMALL targets, independet of the _MB_CAPABALE setting. Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: implement setproctitletopic/3.6Corinna Vinschen1-0/+8
Make sure to create commandline according to setting of setproctitle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31sys/stat.h: drop __INSIDE_CYGWIN__ guardsCorinna Vinschen1-2/+2
These were only necessary until we dropped 32 bit Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: posix_getdents: implement per SUS Base Specifications Issue 8 draftCorinna Vinschen1-0/+3
- Basically maintain a hidden DIR* inside fhandlers. - lseek has to be tweaked to allow basic seeking on the directory descriptor. - the current implementation does not keep the dir positions between duplicated descriptor in sync. In fact, every descriptor keeps its own copy of the DIR* and after dup/fork/exec, the directory position is reset to 0, i. e., to the start of the directory, as if rewinddir() has been called on the new descriptors. While this behaviour isn't yet covered by the Issue 8 draft, a bug report along these lines exists and will probably be picked up for TC1. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31getlocalename_l: implement per SUS Base Specifications Issue 8 draftCorinna Vinschen2-0/+17
#include <locale.h> const char *getlocalename_l(int category, locale_t locobj); Most notably, we need a per-thread space to store the string returned if locobj is LC_GLOBAL_LOCALE. No errors are defined for getlocalename_l. So we can't use buffer allocation which might lead to an ENOMEM error. We have to use a "static" buffer in the per-thread state. Note that the feature test macro in locale.h is not quite correct. This needs to be fixed as soon as the Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Hide itoa, utoa, __itoa and __utoa in stdlib.h on Cygwin onlycygwin-3.5.0Christian Franke1-1/+3
These functions are non-standard and not exported by Cygwin. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-01-29ssp: add support for _FORTIFY_SOURCE=3Christian Franke4-8/+23
If specified, use __builtin_dynamic_object_size() instead of __builtin_object_size() if supported (GCC 12.0 or later). This enables buffer overflow checks if the buffer size is non-const but known during runtime. Use new macro __ssp_bos_known() instead of the (bos(p) != (size_t)-1) checks. The latter is no longer a compile time constant in all cases. This avoids the generation of unused code. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-01-15Cygwin: introduce close_range(2)Christian Franke1-0/+6
This function closes or sets the close-on-exec flag for a specified range of file descriptors. It is available on FreeBSD and Linux. Signed-off-by: Christian Franke <christian.franke@t-online.de>