| Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Aligned definition with FreeBSD to simplify porting FreeBSD headers.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
These are not strictly necessary, but POSIX headers can define
other types based on them even if stddef.h isn't included.
It also simplifies porting BSD headers.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Move the heavy machinery evaluating the fast types from stdint.h
to machine/_default_types.h. Do not try to guess from INTMAX.
In the unlikely case that __INT_FASTn_TYPE__ and __UINT_FASTn_TYPE__
are not defined, use the size-correct base types instead, just as
with the least types.
Nice side-effect: We don't need the "define fast as least" fallback
code in stdint.h anymore, given that the definitions of least
and fast types in machine/_default_types.h are now equivalent:
If fast couldn't be defined, least couldn't have been defined either.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
These types are to be used from stdatomic.h and uchar.h.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
The winsup/ version of regex.h already had this include. Without
it, including <regex.h> by itself would not compile.
|
|
-Wundef warns if an undefined identifier is evaluated in an #if
directive. This would be valid as they are replaced with 0. However, it
is often an early warning sign and not intentional. To allow for
enabling -Wundef even outside system directories (where compilers
ignore such problems unless -Wsystem-headers is enabled) this patch
adds the required defined() checks.
glibc also has been supporting this for 10 years now:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=f248238cf43bd751db29e6f151d6da7645337ff5
I have not exhaustively tested this but you can see the effect with
something like the following (+ using -stdc= and/or -D...):
echo | gcc -include newlib/libc/include/sys/features.h -Inewlib/libc/include/ -E - -Wundef
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
|
|
The documentation states that _GNU_SOURCE enables "all of the above
plus GNU extensions.". Furthermore the documentation states that
_DEFAULT_SOURCE would enable POSIX-1.2008 with BSD and SVr4 extensions.
The code did different things though:
* For _GNU_SOURCE it only enabled POSIX.1-2008 but it should have been the
highest available one, POSIX.1-2024.
* For _DEFAULT_SOURCE it enabled POSIX.1-2024.
Let's use the highest available POSIX standard possible and fix
documentation where necessary.
|
|
POSIX.1-2024 added strlcpy, strlcat, and memmem to strings.h. Previously
these functions were only available as parts of BSD or GNU extensions.
Fix the header so that the symbol are visible for either the right
extensions, or for POSIX.1-2024.
|
|
The RTEMS section defined macros for features RTEMS does not have.
|
|
The setjmp() function needs this attribute to help GCC avoid false
positives for the -Wclobbered warning. The -Wclobbered warning is
part of -Wextra.
|
|
Linux and POSIX-1.2024 define operations to create OFD (Open
File Description) locks.
OFD locks are like POSIX record locks, but bound to the file descriptor,
not bound to the process. As such, they are also inherited via fork(2)
and dup(2), just like BSD flock(2) locks.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
The macro was not protecting properly its first parameter, which caused
it to silently return an invalid value when passing a composed
parameter, ie.
__builtin_is_aligned(src | dst | len, 32);
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
|
|
The commit cited below introduced changes which included
conditionals strictly on __mips__. This ignored tailoring
for any environment on MIPS except that targeted by the
author of the change. This patch just fixes this code for
RTEMS.
commit 467a2bdf17ad376dafada9f1734784f4611fa6fd
Author: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
Date: Wed Jun 11 10:11:33 2025 +0200
mips: Implement MIPS HAL and UHI
Implement abstract interface for MIPS, including unified hosting
interface (UHI).
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
This commit changes the return type of the read() and write() syscalls for
nvptx to ssize_t. This would allow large files to be handled properly by
these syscalls in situations where the read/write buffer length exceeds
INT_MAX, for example. This also makes the syscall signatures fully complaint
with their current POSIX specifications.
We additionally define two macros: '_READ_WRITE_RETURN_TYPE' as _ssize_t and
'_READ_WRITE_BUFSIZE_TYPE' as __size_t in libc/include/sys/config.h under
__nvptx__ for consistency.
Signed-off-by: Arijit Kumar Das <arijitkdgit.official@gmail.com>
|
|
For _GNU_VISIBLE, provide the CLOCK_TAI clock identifier for the
International Atomic Time. Use the value specified by glibc and Linux.
Add _BSD_VISIBLE given FreeBSD also provides this clock identifier.
|
|
Implement abstract interface for MIPS, including unified hosting
interface (UHI).
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
for aarch64-pc-cygwin
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Updated the guard for stdlib functions to use the POSIX Issue 8 guard
added in 2024.
|
|
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()
|
|
Added timespec_get() prototype to libc/include/time.h
and removed the prototype from winsup/cygwin/include/cygwin/time.h
|
|
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.
|
|
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."
|
|
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>
|
|
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>
|
|
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>
|
|
https://pubs.opengroup.org/onlinepubs/9799919799/functions/lseek.html
Signed-off-by: Christian Franke <christian.franke@t-online.de>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The POSIX specification defines these as constants. The cast is
unnecessary. This brings newlib inline with the equivalent FreeBSD
defines.
|
|
_ISOC2x_SOURCE to _ISOC23_SOURCE
Signed-off-by: Lenard Mollenkopf <newlib@lenardmollenkopf.de>
|
|
|
|
when a C++ source file include this header file, it would build fail.
Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
|
|
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>
|
|
Fixed glob() function to return GLOB_NOMATCH if pattern does
not match any existing pathname (and GLOB_NOCHECK was not set in flags).
|
|
|
|
Reverts 1339af44679aee0895fe311cfad89d38cfc2b919
|
|
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>
|
|
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
TBD: Align _GNU_SOURCE, too?
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
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
|
|
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.
|
|
|