Commit Graph

4829 Commits

Author SHA1 Message Date
deadwood 650ca7741e Support registering atexit() functions before CrtProgCtx is created
This can happen in C++ when there is a global object which creates a
static object in its constructor. Creation of global object is run in
CTORS set and static object destructor is registered with atexit.

This all happens before __progonly_program_startup had a chance to run
and create CrtProgCtx
2024-04-26 19:31:14 +02:00
Kalamatee 87aa4cf0f2 update cunit to 3.2.7 2024-04-24 14:46:53 +02:00
deadwood 596906f125 Publish asprintf and vasprintf 2024-04-23 20:27:07 +02:00
deadwood 370f79daf2 Add include to resolve warnings 2024-04-23 20:26:26 +02:00
Kalamatee cf01fc779a move environ handling to stdcio, and add the missing perror for stdcio so that it doesn't recursively try to open itself. 2024-04-23 19:19:33 +02:00
Kalamatee ff86935809 w.i.p - add stubs for select/pselect. 2024-04-23 18:59:53 +02:00
Kalamatee 71b1ccd637 revert and replace instead by caching the original flags, and restoring on close. 2024-04-23 18:59:28 +02:00
Kalamatee e052c5f0d3 duplicate the handles so that we don't alter the original versions flags. 2024-04-23 18:58:39 +02:00
Kalamatee 4ead0f936c include the function parameter names 2024-04-23 18:58:39 +02:00
Kalamatee 59a4744055 remove the header included in error 2024-04-23 18:58:39 +02:00
Kalamatee 3c99006370 add the function parameter names 2024-04-23 18:58:39 +02:00
Kalamatee be18c5467d define BOOL_MAX and BOOL_WIDTH 2024-04-23 18:56:17 +02:00
Kalamatee 966958cf6a add the function parameter names 2024-04-23 18:56:17 +02:00
Kalamatee 724711d974 and the other typo... *sigh * 2024-04-23 18:47:15 +02:00
Kalamatee 1f1b161a4e put the define first in case the header is pulled in earlier. 2024-04-23 18:46:36 +02:00
Kalamatee c8fd84ef31 fix a typo 2024-04-23 18:46:36 +02:00
Kalamatee 8ee9cf0833 implement the gnu asprintf/vasprintf extensions. 2024-04-23 18:45:27 +02:00
Kalamatee aff6c19e3b Because the C11 and C++11 standards override the previous C99 standard, usage of the __STDC_FORMAT_MACROS macro was altered in <inttypes.h> to enable the macros for format specifiers within C++, and usage of the __STDC_LIMIT_MACROS macro and the __STDC_CONSTANT_MACROS macro was altered in <stdint.h> to enable the macros for limits of integer types within C++. As a result, the macros within <inttypes.h> and <stdint.h> are now unconditionally defined for both C and C++ if _cplusplus >= 201103L 2024-04-23 18:40:38 +02:00
Kalamatee abe8ddd4a6 make sure setvbuf does what it is supposed to. 2024-04-23 16:49:32 +02:00
Kalamatee d2fcd7f505 correct setbuf behaviour when no buffer is used. 2024-04-23 16:49:32 +02:00
Kalamatee 5a67997f76 revert - perror is part of c89, but is not being exposed by stdcio (corrected). 2024-04-23 16:48:25 +02:00
Kalamatee ca08360287 perror is from posixc, not stdc 2024-04-23 16:46:52 +02:00
Kalamatee c27c2f4dc9 Always provide the USB3 and OTG definitions, regardless if experimental code is being built. Also provide a USB4 definition. move the "new" version definitions to the end of the possible range. 2024-04-23 16:31:25 +02:00
deadwood 03cb6edc72 Remove internal functions from headers
Those functions were exposed by stdc to be used by posixc, but now they
are used internally in crt and not exposed by crt.
2024-04-15 12:12:31 +02:00
deadwood 99ab254f6f Remove references to stdc
Note: currently there are no third party linker libraries available that
could stop linking due to name changes, thus this and previous changes
are considered backwards compatible. In case some problems surface,
an .alias can be added with the old name.
2024-04-13 22:27:27 +02:00
deadwood 421d0b9e86 Remove last instances of NO_POSIX_WRAPPERS 2024-04-13 20:11:55 +02:00
deadwood 532d5d8ffe Update names in SEE ALSO block 2024-04-13 20:03:09 +02:00
deadwood 5ede7edb1a Remove posixc wrappers
stdlib/crt do not share same functions like stdcio/posixc did. There is
then no need for those wrappers and makes code less complex and more
standard.
2024-04-13 20:02:49 +02:00
deadwood 834a4bcf05 Fix for '*' in sscanf
Ignore ('*') comes before width and length, not after width. Previous code
was failing where there was * and width.
2024-01-30 10:17:26 +01:00
deadwood 33908cb48c Add missing getopt_long function 2024-01-14 18:32:59 +01:00
deadwood bca2eac59d Port newer version of random.c from FreeBSD
This version correctly supports 64-bit systems with datasizes fixed at 32
bit integers rather than "longs" as in old version.
2023-12-27 08:43:21 +01:00
deadwood feba347cf4 Synchronize how bootstrap is built between i386 and x86_64
Name change to stdc32.static is needed to make sure stdc.static from
main AROS output is not used on 32-bit.
2023-12-14 13:41:12 +01:00
deadwood d4da5acdd0 Increase priority of close function to guarantee free() working
At priority 0, C memory management is shutdown.
2023-12-10 10:43:14 +01:00
deadwood 7e33c68df6 Implement experimental shareable support in crt.library
Shareable support allows for an executable to share it's crt.library base
with another library. This library must allow using a shareable crt base.

Right now the support is considered experimental and used only in
regina.library and RexxMast. Functions are market .private on purpose. The
interface is subject to change.

crt.library also starts generating rellinklib as inside library, crt base
needs to be relative to a libraries per-opener base for shareable support
to make sense.
2023-12-06 16:03:13 +01:00
deadwood 3976730447 Add UNIX-AmigaOS offset for clock_gettime(CLOCK_REALTIME)
This makes sure time values returned by clock_gettime, gettimeofday
and stat are synchronized.
Example: GNU make is comparing stat values with clock_gettime values.
2023-04-29 15:01:35 +02:00
Kalamatee bfad301272 update copyright 2023-04-03 12:55:34 +02:00
Kalamatee 9cf079c06d define EXECDEBUGF_SHUTDOWN 2023-04-03 12:55:34 +02:00
Kalamatee 6f53b06b95 adjust shutdown priorities 2023-04-03 10:49:57 +02:00
Kalamatee 85609cb4cc fix a typo 2023-04-03 10:49:57 +02:00
Kalamatee 0c694d210b move execs power related definitions to their own header 2023-04-03 10:49:57 +02:00
deadwood 5fd14e7ae1 Defined version for all existing functions as version 1
This stabilizes headers at version change.
2023-04-02 18:51:46 +02:00
Kalamatee 2914e9e5a3 add definitions for aarch64, riscv and riscv64. sort includes alphabeticaly and include the aarch64/risc-v variants. 2023-04-02 15:11:28 +02:00
Kalamatee 51687c6ded add filesystem ids for rockridge and joliet iso9660 filesystems 2023-04-02 15:11:27 +02:00
deadwood 585d023d6b Restore writing classname attribute to JUnit output XML
This attribute is used by junit2html scripts
2023-03-28 15:44:09 +02:00
deadwood f1bf80b022 Introduce backward compatible stat, lstat, readdir
Needed by gcc, ls, find
2023-03-05 10:52:09 +01:00
deadwood a756c65bd6 Allow stat, lstat, fstat prototypes declaration
This matches behavior of other function defined as static inline in headers
and allows code re-implementing these functions to compile
2023-03-01 09:34:28 +01:00
deadwood 1ee53aaa8b Restore original field types
These fields are used when kernel is SMPREADY, but SMP is not enabled.
Changing the types means that comparisons like TDNESTCOUNT_GET < 0 give
wrong answers (UBYTE 255 = BYTE -1, -1 < 0 but 0 < 255)
2023-02-12 21:25:14 +01:00
deadwood 7f2b07eb84 Introduce backward compatible fstat, fgetpos, fsetpos
Needed by MUIBase
2023-01-30 18:07:49 +01:00
deadwood c259ccccdf Make ino_t a 64-bit type on 64-bit systems
This makes ino_t consistent with other file system types. ino_t will now be
64-bit on 64-bit system and on 32-bit systems when _FILE_OFFSET_BITS=64.
In other case it will be 32-bit wide. This sizing behavior was also
validated with GNU Linux.

Change of ino_t impacts sizes of struct dirent and struct stat. This
impacts a number of functions. They are are moved to new LVOs where they
will support 64-bit ino_t on 64-bit system. Existing LVOs are kept reserved
in case application was already compiled using 32-bit ino_t, so that
a backwards compatible function can be introduced if needed.
2023-01-29 19:48:14 +01:00
deadwood 00779c96b5 Make fpos_t a 64-bit type on 64-bit systems
This makes fpos_t consistent with off_t and other file system types. fpos_t
will now be 64-bit on 64-bit system and on 32-bit systems when
_FILE_OFFSET_BITS=64. In other case it will be 32-bit wide. This sizing
behavior was also validated with GNU Linux.

fsetpos and fgetpos functions are moved to new LVOs where they will
support 64-bit fpos_t on 64-bit system. Existing LVOs are kept reserved
in case application was already compiled using 32-bit fpos_t
2023-01-29 19:48:05 +01:00