From bc4f29a1912cfe8a9067e3f78a58105e73ec85e5 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez Date: Sat, 19 Jul 2025 20:14:02 +0200 Subject: [PATCH] ada: Add System.C_Time and GNAT.C_Time units to libgnat The first unit provides the time_t, timeval and timespec types corresponding to the C types defined by the OS, as well as various conversion functions. The second unit is a mere renaming of the first under the GNAT hierarchy. This removes C time types and conversions under System, and from bodies and private parts under GNAT, while keeping visible types and conversions under GNAT as Obsolescent. gcc/ada/ChangeLog: PR ada/114065 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-c_time$(objext) and s-c_time$(objext). (Aarch64/Android): Do not use s-osinte__android.adb. (SPARC/Solaris): Do not use s-osprim__solaris.adb. (x86/Solaris): Likewise. (LynxOS178): Do not use s-parame__posix2008.ads. (RTEMS): Likewise. (x32/Linux): Likewise, as well as s-linux__x32.ads. Replace s-osprim__x32.adb with s-osprim__posix.adb. (LIBGNAT_OBJS): Remove cal.o. * cal.c: Delete. * doc/gnat_rm/the_gnat_library.rst (GNAT.C_Time): New entry. (GNAT.Calendar): Do not mention the obsolete conversion functions. * impunit.adb (Non_Imp_File_Names_95): Add g-c_time. * libgnarl/a-exetim__posix.adb: Add with clause for System.C_Time (Clock): Use type and functions from System.C_Time. * libgnarl/s-linux.ads: Remove with clause for System.Parameters. Remove declarations of C time types. * libgnarl/s-linux__alpha.ads: Likewise. * libgnarl/s-linux__android-aarch64.ads: Likewise. * libgnarl/s-linux__android-arm.ads: Likewise. * libgnarl/s-linux__hppa.ads: Likewise. * libgnarl/s-linux__loongarch.ads: Likewise. * libgnarl/s-linux__mips.ads: Likewise. * libgnarl/s-linux__riscv.ads: Likewise. * libgnarl/s-linux__sparc.ads: Likewise. * libgnarl/s-osinte__aix.ads: Likewise. * libgnarl/s-osinte__android.ads: Likewise. * libgnarl/s-osinte__cheribsd.ads: Likewise. * libgnarl/s-osinte__darwin.ads: Likewise. * libgnarl/s-osinte__dragonfly.ads: Likewise. * libgnarl/s-osinte__freebsd.ads: Likewise. * libgnarl/s-osinte__gnu.ads: Likewise. * libgnarl/s-osinte__hpux.ads: Likewise. * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise. * libgnarl/s-osinte__linux.ads: Likewise. * libgnarl/s-osinte__lynxos178e.ads: Likewise. * libgnarl/s-osinte__qnx.ads: Likewise. * libgnarl/s-osinte__rtems.ads: Likewise. * libgnarl/s-osinte__solaris.ads: Likewise. * libgnarl/s-osinte__vxworks.ads: Likewise. * libgnarl/s-qnx.ads: Likewise. * libgnarl/s-linux__x32.ads: Delete. * libgnarl/s-osinte__darwin.adb (To_Duration): Remove. (To_Timespec): Likewise. * libgnarl/s-osinte__aix.adb: Likewise. * libgnarl/s-osinte__dragonfly.adb: Likewise. * libgnarl/s-osinte__freebsd.adb: Likewise. * libgnarl/s-osinte__gnu.adb: Likewise. * libgnarl/s-osinte__lynxos178.adb: Likewise. * libgnarl/s-osinte__posix.adb: Likewise. * libgnarl/s-osinte__qnx.adb: Likewise. * libgnarl/s-osinte__rtems.adb: Likewise. * libgnarl/s-osinte__solaris.adb: Likewise. * libgnarl/s-osinte__vxworks.adb: Likewise. * libgnarl/s-osinte__x32.adb: Likewise. * libgnarl/s-taprop__solaris.adb: Add with clause for System.C_Time. (Monotonic_Clock): Use type and functions from System.C_Time. (RT_Resolution): Likewise. (Timed_Sleep): Likewise. (Timed_Delay): Likewise. * libgnarl/s-taprop__vxworks.adb: Likewise. * libgnarl/s-tpopmo.adb: Likewise. * libgnarl/s-osinte__android.adb: Delete. * libgnat/g-c_time.ads: New file. * libgnat/g-calend.adb: Delegate to System.C_Time. * libgnat/g-calend.ads: Likewise. * libgnat/g-socket.adb: Likewise. * libgnat/g-socthi.adb: Likewise. * libgnat/g-socthi__vxworks.adb: Likewise. * libgnat/g-sothco.ads: Likewise. * libgnat/g-spogwa.adb: Likewise. * libgnat/s-c_time.adb: New file. * libgnat/s-c_time.ads: Likewise. * libgnat/s-optide.adb: Import nanosleep here. * libgnat/s-os_lib.ads (time_t): Remove. (To_Ada): Adjust. (To_C): Likewise. * libgnat/s-os_lib.adb: Likewise. * libgnat/s-osprim__darwin.adb: Delegate to System.C_Time. * libgnat/s-osprim__posix.adb: Likewise. * libgnat/s-osprim__posix2008.adb: Likewise. * libgnat/s-osprim__rtems.adb: Likewise. * libgnat/s-osprim__unix.adb: Likewise. * libgnat/s-osprim__solaris.adb: Delete. * libgnat/s-osprim__x32.adb: Likewise. * libgnat/s-parame.ads (time_t_bits): Remove. * libgnat/s-parame__hpux.ads: Likewise. * libgnat/s-parame__vxworks.ads: Likewise. * libgnat/s-parame__posix2008.ads: Delete. * s-oscons-tmplt.c (SIZEOF_tv_nsec): New constant. * gnat_rm.texi: Regenerate. --- gcc/ada/Makefile.rtl | 15 +- gcc/ada/cal.c | 74 --- gcc/ada/doc/gnat_rm/the_gnat_library.rst | 14 +- gcc/ada/gnat_rm.texi | 426 +++++++++--------- gcc/ada/impunit.adb | 1 + gcc/ada/libgnarl/a-exetim__posix.adb | 9 +- gcc/ada/libgnarl/s-linux.ads | 17 - gcc/ada/libgnarl/s-linux__alpha.ads | 17 - gcc/ada/libgnarl/s-linux__android-aarch64.ads | 17 - gcc/ada/libgnarl/s-linux__android-arm.ads | 17 - gcc/ada/libgnarl/s-linux__hppa.ads | 17 - gcc/ada/libgnarl/s-linux__loongarch.ads | 18 - gcc/ada/libgnarl/s-linux__mips.ads | 22 +- gcc/ada/libgnarl/s-linux__riscv.ads | 22 +- gcc/ada/libgnarl/s-linux__sparc.ads | 17 - gcc/ada/libgnarl/s-linux__x32.ads | 133 ------ gcc/ada/libgnarl/s-osinte__aix.adb | 32 -- gcc/ada/libgnarl/s-osinte__aix.ads | 25 +- gcc/ada/libgnarl/s-osinte__android.ads | 25 +- gcc/ada/libgnarl/s-osinte__cheribsd.ads | 27 +- gcc/ada/libgnarl/s-osinte__darwin.adb | 61 +-- gcc/ada/libgnarl/s-osinte__darwin.ads | 25 +- gcc/ada/libgnarl/s-osinte__dragonfly.adb | 33 -- gcc/ada/libgnarl/s-osinte__dragonfly.ads | 27 +- gcc/ada/libgnarl/s-osinte__freebsd.adb | 32 -- gcc/ada/libgnarl/s-osinte__freebsd.ads | 27 +- gcc/ada/libgnarl/s-osinte__gnu.adb | 33 -- gcc/ada/libgnarl/s-osinte__gnu.ads | 27 +- gcc/ada/libgnarl/s-osinte__hpux.ads | 25 +- gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads | 27 +- gcc/ada/libgnarl/s-osinte__linux.ads | 18 +- gcc/ada/libgnarl/s-osinte__lynxos178.adb | 32 -- gcc/ada/libgnarl/s-osinte__lynxos178e.ads | 35 +- gcc/ada/libgnarl/s-osinte__posix.adb | 34 +- gcc/ada/libgnarl/s-osinte__qnx.adb | 34 +- gcc/ada/libgnarl/s-osinte__qnx.ads | 25 +- gcc/ada/libgnarl/s-osinte__rtems.adb | 30 -- gcc/ada/libgnarl/s-osinte__rtems.ads | 29 +- gcc/ada/libgnarl/s-osinte__solaris.adb | 34 -- gcc/ada/libgnarl/s-osinte__solaris.ads | 25 +- gcc/ada/libgnarl/s-osinte__vxworks.adb | 32 -- gcc/ada/libgnarl/s-osinte__vxworks.ads | 28 +- gcc/ada/libgnarl/s-osinte__x32.adb | 35 +- gcc/ada/libgnarl/s-qnx.ads | 18 - gcc/ada/libgnarl/s-taprop__solaris.adb | 17 +- gcc/ada/libgnarl/s-taprop__vxworks.adb | 5 +- gcc/ada/libgnarl/s-tpopmo.adb | 18 +- .../g-c_time.ads} | 58 +-- gcc/ada/libgnat/g-calend.adb | 61 +-- gcc/ada/libgnat/g-calend.ads | 25 +- gcc/ada/libgnat/g-socket.adb | 78 +--- gcc/ada/libgnat/g-socthi.adb | 4 +- gcc/ada/libgnat/g-socthi__vxworks.adb | 4 +- gcc/ada/libgnat/g-sothco.ads | 34 +- gcc/ada/libgnat/g-spogwa.adb | 11 +- gcc/ada/libgnat/s-c_time.adb | 203 +++++++++ gcc/ada/libgnat/s-c_time.ads | 93 ++++ gcc/ada/libgnat/s-optide.adb | 11 +- gcc/ada/libgnat/s-os_lib.adb | 6 +- gcc/ada/libgnat/s-os_lib.ads | 29 +- gcc/ada/libgnat/s-osprim__darwin.adb | 62 +-- gcc/ada/libgnat/s-osprim__posix.adb | 69 +-- gcc/ada/libgnat/s-osprim__posix2008.adb | 52 +-- gcc/ada/libgnat/s-osprim__rtems.adb | 71 +-- gcc/ada/libgnat/s-osprim__solaris.adb | 126 ------ gcc/ada/libgnat/s-osprim__unix.adb | 29 +- gcc/ada/libgnat/s-osprim__x32.adb | 170 ------- gcc/ada/libgnat/s-parame.ads | 7 - gcc/ada/libgnat/s-parame__hpux.ads | 7 - gcc/ada/libgnat/s-parame__posix2008.ads | 189 -------- gcc/ada/libgnat/s-parame__vxworks.ads | 15 - gcc/ada/s-oscons-tmplt.c | 11 + 72 files changed, 765 insertions(+), 2371 deletions(-) delete mode 100644 gcc/ada/cal.c delete mode 100644 gcc/ada/libgnarl/s-linux__x32.ads rename gcc/ada/{libgnarl/s-osinte__android.adb => libgnat/g-c_time.ads} (59%) create mode 100644 gcc/ada/libgnat/s-c_time.adb create mode 100644 gcc/ada/libgnat/s-c_time.ads delete mode 100644 gcc/ada/libgnat/s-osprim__solaris.adb delete mode 100644 gcc/ada/libgnat/s-osprim__x32.adb delete mode 100644 gcc/ada/libgnat/s-parame__posix2008.ads diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 9d8c2f1aeae4..0c290794309a 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -415,6 +415,7 @@ GNATRTL_NONTASKING_OBJS= \ g-busorg$(objext) \ g-byorma$(objext) \ g-bytswa$(objext) \ + g-c_time$(objext) \ g-calend$(objext) \ g-casuti$(objext) \ g-catiio$(objext) \ @@ -535,6 +536,7 @@ GNATRTL_NONTASKING_OBJS= \ s-boarop$(objext) \ s-boustr$(objext) \ s-bytswa$(objext) \ + s-c_time$(objext) \ s-carsi8$(objext) \ s-carun8$(objext) \ s-casi16$(objext) \ @@ -1418,7 +1420,6 @@ ifeq ($(strip $(filter-out arm% aarch64 linux-android%,$(target_cpu) $(target_os s-inmaop.adb. * - * * - * GNAT was originally developed by the GNAT team at New York University. * - * Extensive contributions were provided by Ada Core Technologies Inc. * - * * - ****************************************************************************/ - -/* This file contains routines marked with pragmas Import in package */ -/* GNAT.Calendar. It is used to do Duration to timeval conversion. */ -/* These are simple wrapper functions to abstract the fact that the C */ -/* struct timeval fields are not normalized (they are generally */ -/* defined as int or long values). */ - -#if defined (__vxworks) -#ifdef __RTP__ -#include -#include -#if (_WRS_VXWORKS_MAJOR == 7) || (_WRS_VXWORKS_MINOR != 0) -#include -#endif -#else -#include -#endif -#elif defined (__nucleus__) -#include -#else -#include -#endif - -#ifdef __MINGW32__ -#include "mingw32.h" -#include -#endif - -void -__gnat_timeval_to_duration (struct timeval *t, long long *sec, long *usec) -{ - *sec = (long long) t->tv_sec; - *usec = (long) t->tv_usec; -} - -void -__gnat_duration_to_timeval (long long sec, long usec, struct timeval *t) -{ - /* here we are doing implicit conversion to the struct timeval - fields types. */ - - t->tv_sec = sec; - t->tv_usec = usec; -} diff --git a/gcc/ada/doc/gnat_rm/the_gnat_library.rst b/gcc/ada/doc/gnat_rm/the_gnat_library.rst index d041090eab06..29642aa89709 100644 --- a/gcc/ada/doc/gnat_rm/the_gnat_library.rst +++ b/gcc/ada/doc/gnat_rm/the_gnat_library.rst @@ -663,6 +663,18 @@ sequences for various UCS input formats. General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. +.. _`GNAT.C_Time_(g-c_time.ads)`: + +``GNAT.C_Time`` (:file:`g-c_time.ads`) +====================================== + +.. index:: GNAT.C_Time (g-c_time.ads) + +.. index:: Time + +Provides the time_t, timeval and timespec types corresponding to the C +types defined by the OS, as well as various conversion functions. + .. _`GNAT.Calendar_(g-calend.ads)`: ``GNAT.Calendar`` (:file:`g-calend.ads`) @@ -674,8 +686,6 @@ Machine-specific implementations are available in some cases. Extends the facilities provided by ``Ada.Calendar`` to include handling of days of the week, an extended ``Split`` and ``Time_Of`` capability. -Also provides conversion of ``Ada.Calendar.Time`` values to and from the -C ``timeval`` format. .. _`GNAT.Calendar.Time_IO_(g-catiio.ads)`: diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index d094720047c4..e2ede5ea1b74 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -755,6 +755,7 @@ The GNAT Library * GNAT.Bubble_Sort_G (g-busorg.ads): GNAT Bubble_Sort_G g-busorg ads. * GNAT.Byte_Order_Mark (g-byorma.ads): GNAT Byte_Order_Mark g-byorma ads. * GNAT.Byte_Swapping (g-bytswa.ads): GNAT Byte_Swapping g-bytswa ads. +* GNAT.C_Time (g-c_time.ads): GNAT C_Time g-c_time ads. * GNAT.Calendar (g-calend.ads): GNAT Calendar g-calend ads. * GNAT.Calendar.Time_IO (g-catiio.ads): GNAT Calendar Time_IO g-catiio ads. * GNAT.CRC32 (g-crc32.ads): GNAT CRC32 g-crc32 ads. @@ -23522,6 +23523,7 @@ of GNAT, and will generate a warning message. * GNAT.Bubble_Sort_G (g-busorg.ads): GNAT Bubble_Sort_G g-busorg ads. * GNAT.Byte_Order_Mark (g-byorma.ads): GNAT Byte_Order_Mark g-byorma ads. * GNAT.Byte_Swapping (g-bytswa.ads): GNAT Byte_Swapping g-bytswa ads. +* GNAT.C_Time (g-c_time.ads): GNAT C_Time g-c_time ads. * GNAT.Calendar (g-calend.ads): GNAT Calendar g-calend ads. * GNAT.Calendar.Time_IO (g-catiio.ads): GNAT Calendar Time_IO g-catiio ads. * GNAT.CRC32 (g-crc32.ads): GNAT CRC32 g-crc32 ads. @@ -24261,7 +24263,7 @@ see whether it is one of the standard byte order marks (BOM’s) which signal the encoding of the string. The routine includes detection of special XML sequences for various UCS input formats. -@node GNAT Byte_Swapping g-bytswa ads,GNAT Calendar g-calend ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library +@node GNAT Byte_Swapping g-bytswa ads,GNAT C_Time g-c_time ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library @anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{34a}@anchor{gnat_rm/the_gnat_library id45}@anchor{34b} @section @code{GNAT.Byte_Swapping} (@code{g-bytswa.ads}) @@ -24275,8 +24277,20 @@ sequences for various UCS input formats. General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. -@node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id46}@anchor{34d} +@node GNAT C_Time g-c_time ads,GNAT Calendar g-calend ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library +@anchor{gnat_rm/the_gnat_library gnat-c-time-g-c-time-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id46}@anchor{34d} +@section @code{GNAT.C_Time} (@code{g-c_time.ads}) + + +@geindex GNAT.C_Time (g-c_time.ads) + +@geindex Time + +Provides the time_t, timeval and timespec types corresponding to the C +types defined by the OS, as well as various conversion functions. + +@node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT C_Time g-c_time ads,The GNAT Library +@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id47}@anchor{34f} @section @code{GNAT.Calendar} (@code{g-calend.ads}) @@ -24286,11 +24300,9 @@ Machine-specific implementations are available in some cases. Extends the facilities provided by @code{Ada.Calendar} to include handling of days of the week, an extended @code{Split} and @code{Time_Of} capability. -Also provides conversion of @code{Ada.Calendar.Time} values to and from the -C @code{timeval} format. @node GNAT Calendar Time_IO g-catiio ads,GNAT CRC32 g-crc32 ads,GNAT Calendar g-calend ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id47}@anchor{34f} +@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{350}@anchor{gnat_rm/the_gnat_library id48}@anchor{351} @section @code{GNAT.Calendar.Time_IO} (@code{g-catiio.ads}) @@ -24301,7 +24313,7 @@ C @code{timeval} format. @geindex GNAT.Calendar.Time_IO (g-catiio.ads) @node GNAT CRC32 g-crc32 ads,GNAT Case_Util g-casuti ads,GNAT Calendar Time_IO g-catiio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{350}@anchor{gnat_rm/the_gnat_library id48}@anchor{351} +@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{352}@anchor{gnat_rm/the_gnat_library id49}@anchor{353} @section @code{GNAT.CRC32} (@code{g-crc32.ads}) @@ -24318,7 +24330,7 @@ of this algorithm see Aug. 1988. Sarwate, D.V. @node GNAT Case_Util g-casuti ads,GNAT CGI g-cgi ads,GNAT CRC32 g-crc32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{352}@anchor{gnat_rm/the_gnat_library id49}@anchor{353} +@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id50}@anchor{355} @section @code{GNAT.Case_Util} (@code{g-casuti.ads}) @@ -24333,7 +24345,7 @@ without the overhead of the full casing tables in @code{Ada.Characters.Handling}. @node GNAT CGI g-cgi ads,GNAT CGI Cookie g-cgicoo ads,GNAT Case_Util g-casuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id50}@anchor{355} +@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{356}@anchor{gnat_rm/the_gnat_library id51}@anchor{357} @section @code{GNAT.CGI} (@code{g-cgi.ads}) @@ -24348,7 +24360,7 @@ builds a table whose index is the key and provides some services to deal with this table. @node GNAT CGI Cookie g-cgicoo ads,GNAT CGI Debug g-cgideb ads,GNAT CGI g-cgi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{356}@anchor{gnat_rm/the_gnat_library id51}@anchor{357} +@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{358}@anchor{gnat_rm/the_gnat_library id52}@anchor{359} @section @code{GNAT.CGI.Cookie} (@code{g-cgicoo.ads}) @@ -24363,7 +24375,7 @@ Common Gateway Interface (CGI). It exports services to deal with Web cookies (piece of information kept in the Web client software). @node GNAT CGI Debug g-cgideb ads,GNAT Command_Line g-comlin ads,GNAT CGI Cookie g-cgicoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{358}@anchor{gnat_rm/the_gnat_library id52}@anchor{359} +@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id53}@anchor{35b} @section @code{GNAT.CGI.Debug} (@code{g-cgideb.ads}) @@ -24375,7 +24387,7 @@ This is a package to help debugging CGI (Common Gateway Interface) programs written in Ada. @node GNAT Command_Line g-comlin ads,GNAT Compiler_Version g-comver ads,GNAT CGI Debug g-cgideb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id53}@anchor{35b} +@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{35c}@anchor{gnat_rm/the_gnat_library id54}@anchor{35d} @section @code{GNAT.Command_Line} (@code{g-comlin.ads}) @@ -24388,7 +24400,7 @@ including the ability to scan for named switches with optional parameters and expand file names using wildcard notations. @node GNAT Compiler_Version g-comver ads,GNAT Ctrl_C g-ctrl_c ads,GNAT Command_Line g-comlin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{35c}@anchor{gnat_rm/the_gnat_library id54}@anchor{35d} +@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{35e}@anchor{gnat_rm/the_gnat_library id55}@anchor{35f} @section @code{GNAT.Compiler_Version} (@code{g-comver.ads}) @@ -24406,7 +24418,7 @@ of the compiler if a consistent tool set is used to compile all units of a partition). @node GNAT Ctrl_C g-ctrl_c ads,GNAT Current_Exception g-curexc ads,GNAT Compiler_Version g-comver ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{35e}@anchor{gnat_rm/the_gnat_library id55}@anchor{35f} +@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{360}@anchor{gnat_rm/the_gnat_library id56}@anchor{361} @section @code{GNAT.Ctrl_C} (@code{g-ctrl_c.ads}) @@ -24417,7 +24429,7 @@ of a partition). Provides a simple interface to handle Ctrl-C keyboard events. @node GNAT Current_Exception g-curexc ads,GNAT Debug_Pools g-debpoo ads,GNAT Ctrl_C g-ctrl_c ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{360}@anchor{gnat_rm/the_gnat_library id56}@anchor{361} +@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id57}@anchor{363} @section @code{GNAT.Current_Exception} (@code{g-curexc.ads}) @@ -24434,7 +24446,7 @@ This is particularly useful in simulating typical facilities for obtaining information about exceptions provided by Ada 83 compilers. @node GNAT Debug_Pools g-debpoo ads,GNAT Debug_Utilities g-debuti ads,GNAT Current_Exception g-curexc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id57}@anchor{363} +@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{364}@anchor{gnat_rm/the_gnat_library id58}@anchor{365} @section @code{GNAT.Debug_Pools} (@code{g-debpoo.ads}) @@ -24451,7 +24463,7 @@ problems. See @code{The GNAT Debug_Pool Facility} section in the @cite{GNAT User’s Guide}. @node GNAT Debug_Utilities g-debuti ads,GNAT Decode_String g-decstr ads,GNAT Debug_Pools g-debpoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{364}@anchor{gnat_rm/the_gnat_library id58}@anchor{365} +@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id59}@anchor{367} @section @code{GNAT.Debug_Utilities} (@code{g-debuti.ads}) @@ -24464,7 +24476,7 @@ to and from string images of address values. Supports both C and Ada formats for hexadecimal literals. @node GNAT Decode_String g-decstr ads,GNAT Decode_UTF8_String g-deutst ads,GNAT Debug_Utilities g-debuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id59}@anchor{367} +@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{368}@anchor{gnat_rm/the_gnat_library id60}@anchor{369} @section @code{GNAT.Decode_String} (@code{g-decstr.ads}) @@ -24488,7 +24500,7 @@ Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Decode_UTF8_String g-deutst ads,GNAT Directory_Operations g-dirope ads,GNAT Decode_String g-decstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{368}@anchor{gnat_rm/the_gnat_library id60}@anchor{369} +@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{36a}@anchor{gnat_rm/the_gnat_library id61}@anchor{36b} @section @code{GNAT.Decode_UTF8_String} (@code{g-deutst.ads}) @@ -24509,7 +24521,7 @@ preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Decode_Strings for UTF-8 encoding. @node GNAT Directory_Operations g-dirope ads,GNAT Directory_Operations Iteration g-diopit ads,GNAT Decode_UTF8_String g-deutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{36a}@anchor{gnat_rm/the_gnat_library id61}@anchor{36b} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{36c}@anchor{gnat_rm/the_gnat_library id62}@anchor{36d} @section @code{GNAT.Directory_Operations} (@code{g-dirope.ads}) @@ -24522,7 +24534,7 @@ the current directory, making new directories, and scanning the files in a directory. @node GNAT Directory_Operations Iteration g-diopit ads,GNAT Dynamic_HTables g-dynhta ads,GNAT Directory_Operations g-dirope ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{36c}@anchor{gnat_rm/the_gnat_library id62}@anchor{36d} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{36e}@anchor{gnat_rm/the_gnat_library id63}@anchor{36f} @section @code{GNAT.Directory_Operations.Iteration} (@code{g-diopit.ads}) @@ -24534,7 +24546,7 @@ A child unit of GNAT.Directory_Operations providing additional operations for iterating through directories. @node GNAT Dynamic_HTables g-dynhta ads,GNAT Dynamic_Tables g-dyntab ads,GNAT Directory_Operations Iteration g-diopit ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{36e}@anchor{gnat_rm/the_gnat_library id63}@anchor{36f} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{370}@anchor{gnat_rm/the_gnat_library id64}@anchor{371} @section @code{GNAT.Dynamic_HTables} (@code{g-dynhta.ads}) @@ -24552,7 +24564,7 @@ dynamic instances of the hash table, while an instantiation of @code{GNAT.HTable} creates a single instance of the hash table. @node GNAT Dynamic_Tables g-dyntab ads,GNAT Encode_String g-encstr ads,GNAT Dynamic_HTables g-dynhta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{370}@anchor{gnat_rm/the_gnat_library id64}@anchor{371} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{372}@anchor{gnat_rm/the_gnat_library id65}@anchor{373} @section @code{GNAT.Dynamic_Tables} (@code{g-dyntab.ads}) @@ -24572,7 +24584,7 @@ dynamic instances of the table, while an instantiation of @code{GNAT.Table} creates a single instance of the table type. @node GNAT Encode_String g-encstr ads,GNAT Encode_UTF8_String g-enutst ads,GNAT Dynamic_Tables g-dyntab ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{372}@anchor{gnat_rm/the_gnat_library id65}@anchor{373} +@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{374}@anchor{gnat_rm/the_gnat_library id66}@anchor{375} @section @code{GNAT.Encode_String} (@code{g-encstr.ads}) @@ -24594,7 +24606,7 @@ encoding method. Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Encode_UTF8_String g-enutst ads,GNAT Exception_Actions g-excact ads,GNAT Encode_String g-encstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{374}@anchor{gnat_rm/the_gnat_library id66}@anchor{375} +@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{376}@anchor{gnat_rm/the_gnat_library id67}@anchor{377} @section @code{GNAT.Encode_UTF8_String} (@code{g-enutst.ads}) @@ -24615,7 +24627,7 @@ Note there is a preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Encode_Strings for UTF-8 encoding. @node GNAT Exception_Actions g-excact ads,GNAT Exception_Traces g-exctra ads,GNAT Encode_UTF8_String g-enutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{376}@anchor{gnat_rm/the_gnat_library id67}@anchor{377} +@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{378}@anchor{gnat_rm/the_gnat_library id68}@anchor{379} @section @code{GNAT.Exception_Actions} (@code{g-excact.ads}) @@ -24628,7 +24640,7 @@ for specific exceptions, or when any exception is raised. This can be used for instance to force a core dump to ease debugging. @node GNAT Exception_Traces g-exctra ads,GNAT Exceptions g-except ads,GNAT Exception_Actions g-excact ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{378}@anchor{gnat_rm/the_gnat_library id68}@anchor{379} +@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{37a}@anchor{gnat_rm/the_gnat_library id69}@anchor{37b} @section @code{GNAT.Exception_Traces} (@code{g-exctra.ads}) @@ -24642,7 +24654,7 @@ Provides an interface allowing to control automatic output upon exception occurrences. @node GNAT Exceptions g-except ads,GNAT Expect g-expect ads,GNAT Exception_Traces g-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{37a}@anchor{gnat_rm/the_gnat_library id69}@anchor{37b} +@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{37c}@anchor{gnat_rm/the_gnat_library id70}@anchor{37d} @section @code{GNAT.Exceptions} (@code{g-except.ads}) @@ -24663,7 +24675,7 @@ predefined exceptions, and for example allows raising @code{Constraint_Error} with a message from a pure subprogram. @node GNAT Expect g-expect ads,GNAT Expect TTY g-exptty ads,GNAT Exceptions g-except ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{37c}@anchor{gnat_rm/the_gnat_library id70}@anchor{37d} +@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{37e}@anchor{gnat_rm/the_gnat_library id71}@anchor{37f} @section @code{GNAT.Expect} (@code{g-expect.ads}) @@ -24679,7 +24691,7 @@ It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Expect TTY g-exptty ads,GNAT Float_Control g-flocon ads,GNAT Expect g-expect ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{37e}@anchor{gnat_rm/the_gnat_library id71}@anchor{37f} +@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{380}@anchor{gnat_rm/the_gnat_library id72}@anchor{381} @section @code{GNAT.Expect.TTY} (@code{g-exptty.ads}) @@ -24691,7 +24703,7 @@ ports. It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Float_Control g-flocon ads,GNAT Formatted_String g-forstr ads,GNAT Expect TTY g-exptty ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{380}@anchor{gnat_rm/the_gnat_library id72}@anchor{381} +@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{382}@anchor{gnat_rm/the_gnat_library id73}@anchor{383} @section @code{GNAT.Float_Control} (@code{g-flocon.ads}) @@ -24705,7 +24717,7 @@ library calls may cause this mode to be modified, and the Reset procedure in this package can be used to reestablish the required mode. @node GNAT Formatted_String g-forstr ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Float_Control g-flocon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{382}@anchor{gnat_rm/the_gnat_library id73}@anchor{383} +@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{384}@anchor{gnat_rm/the_gnat_library id74}@anchor{385} @section @code{GNAT.Formatted_String} (@code{g-forstr.ads}) @@ -24720,7 +24732,7 @@ derived from Integer, Float or enumerations as values for the formatted string. @node GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Heap_Sort g-heasor ads,GNAT Formatted_String g-forstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{384}@anchor{gnat_rm/the_gnat_library id74}@anchor{385} +@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{386}@anchor{gnat_rm/the_gnat_library id75}@anchor{387} @section @code{GNAT.Generic_Fast_Math_Functions} (@code{g-gfmafu.ads}) @@ -24738,7 +24750,7 @@ have a vector implementation that can be automatically used by the compiler when auto-vectorization is enabled. @node GNAT Heap_Sort g-heasor ads,GNAT Heap_Sort_A g-hesora ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{386}@anchor{gnat_rm/the_gnat_library id75}@anchor{387} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{388}@anchor{gnat_rm/the_gnat_library id76}@anchor{389} @section @code{GNAT.Heap_Sort} (@code{g-heasor.ads}) @@ -24752,7 +24764,7 @@ access-to-procedure values. The algorithm used is a modified heap sort that performs approximately N*log(N) comparisons in the worst case. @node GNAT Heap_Sort_A g-hesora ads,GNAT Heap_Sort_G g-hesorg ads,GNAT Heap_Sort g-heasor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{388}@anchor{gnat_rm/the_gnat_library id76}@anchor{389} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{38a}@anchor{gnat_rm/the_gnat_library id77}@anchor{38b} @section @code{GNAT.Heap_Sort_A} (@code{g-hesora.ads}) @@ -24768,7 +24780,7 @@ This differs from @code{GNAT.Heap_Sort} in having a less convenient interface, but may be slightly more efficient. @node GNAT Heap_Sort_G g-hesorg ads,GNAT HTable g-htable ads,GNAT Heap_Sort_A g-hesora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{38a}@anchor{gnat_rm/the_gnat_library id77}@anchor{38b} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{38c}@anchor{gnat_rm/the_gnat_library id78}@anchor{38d} @section @code{GNAT.Heap_Sort_G} (@code{g-hesorg.ads}) @@ -24782,7 +24794,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT HTable g-htable ads,GNAT IO g-io ads,GNAT Heap_Sort_G g-hesorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{38c}@anchor{gnat_rm/the_gnat_library id78}@anchor{38d} +@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{38e}@anchor{gnat_rm/the_gnat_library id79}@anchor{38f} @section @code{GNAT.HTable} (@code{g-htable.ads}) @@ -24795,7 +24807,7 @@ data. Provides two approaches, one a simple static approach, and the other allowing arbitrary dynamic hash tables. @node GNAT IO g-io ads,GNAT IO_Aux g-io_aux ads,GNAT HTable g-htable ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{38e}@anchor{gnat_rm/the_gnat_library id79}@anchor{38f} +@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{390}@anchor{gnat_rm/the_gnat_library id80}@anchor{391} @section @code{GNAT.IO} (@code{g-io.ads}) @@ -24811,7 +24823,7 @@ Standard_Input, and writing characters, strings and integers to either Standard_Output or Standard_Error. @node GNAT IO_Aux g-io_aux ads,GNAT Lock_Files g-locfil ads,GNAT IO g-io ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{390}@anchor{gnat_rm/the_gnat_library id80}@anchor{391} +@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{392}@anchor{gnat_rm/the_gnat_library id81}@anchor{393} @section @code{GNAT.IO_Aux} (@code{g-io_aux.ads}) @@ -24825,7 +24837,7 @@ Provides some auxiliary functions for use with Text_IO, including a test for whether a file exists, and functions for reading a line of text. @node GNAT Lock_Files g-locfil ads,GNAT MBBS_Discrete_Random g-mbdira ads,GNAT IO_Aux g-io_aux ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{392}@anchor{gnat_rm/the_gnat_library id81}@anchor{393} +@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{394}@anchor{gnat_rm/the_gnat_library id82}@anchor{395} @section @code{GNAT.Lock_Files} (@code{g-locfil.ads}) @@ -24839,7 +24851,7 @@ Provides a general interface for using files as locks. Can be used for providing program level synchronization. @node GNAT MBBS_Discrete_Random g-mbdira ads,GNAT MBBS_Float_Random g-mbflra ads,GNAT Lock_Files g-locfil ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{394}@anchor{gnat_rm/the_gnat_library id82}@anchor{395} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{396}@anchor{gnat_rm/the_gnat_library id83}@anchor{397} @section @code{GNAT.MBBS_Discrete_Random} (@code{g-mbdira.ads}) @@ -24851,7 +24863,7 @@ The original implementation of @code{Ada.Numerics.Discrete_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MBBS_Float_Random g-mbflra ads,GNAT MD5 g-md5 ads,GNAT MBBS_Discrete_Random g-mbdira ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{396}@anchor{gnat_rm/the_gnat_library id83}@anchor{397} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{398}@anchor{gnat_rm/the_gnat_library id84}@anchor{399} @section @code{GNAT.MBBS_Float_Random} (@code{g-mbflra.ads}) @@ -24863,7 +24875,7 @@ The original implementation of @code{Ada.Numerics.Float_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MD5 g-md5 ads,GNAT Memory_Dump g-memdum ads,GNAT MBBS_Float_Random g-mbflra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{398}@anchor{gnat_rm/the_gnat_library id84}@anchor{399} +@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{39a}@anchor{gnat_rm/the_gnat_library id85}@anchor{39b} @section @code{GNAT.MD5} (@code{g-md5.ads}) @@ -24876,7 +24888,7 @@ the HMAC-MD5 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Memory_Dump g-memdum ads,GNAT Most_Recent_Exception g-moreex ads,GNAT MD5 g-md5 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{39a}@anchor{gnat_rm/the_gnat_library id85}@anchor{39b} +@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{39c}@anchor{gnat_rm/the_gnat_library id86}@anchor{39d} @section @code{GNAT.Memory_Dump} (@code{g-memdum.ads}) @@ -24889,7 +24901,7 @@ standard output or standard error files. Uses GNAT.IO for actual output. @node GNAT Most_Recent_Exception g-moreex ads,GNAT OS_Lib g-os_lib ads,GNAT Memory_Dump g-memdum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{39c}@anchor{gnat_rm/the_gnat_library id86}@anchor{39d} +@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{39e}@anchor{gnat_rm/the_gnat_library id87}@anchor{39f} @section @code{GNAT.Most_Recent_Exception} (@code{g-moreex.ads}) @@ -24903,7 +24915,7 @@ various logging purposes, including duplicating functionality of some Ada 83 implementation dependent extensions. @node GNAT OS_Lib g-os_lib ads,GNAT Perfect_Hash_Generators g-pehage ads,GNAT Most_Recent_Exception g-moreex ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{39e}@anchor{gnat_rm/the_gnat_library id87}@anchor{39f} +@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{3a0}@anchor{gnat_rm/the_gnat_library id88}@anchor{3a1} @section @code{GNAT.OS_Lib} (@code{g-os_lib.ads}) @@ -24919,7 +24931,7 @@ including a portable spawn procedure, and access to environment variables and error return codes. @node GNAT Perfect_Hash_Generators g-pehage ads,GNAT Random_Numbers g-rannum ads,GNAT OS_Lib g-os_lib ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{3a0}@anchor{gnat_rm/the_gnat_library id88}@anchor{3a1} +@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{3a2}@anchor{gnat_rm/the_gnat_library id89}@anchor{3a3} @section @code{GNAT.Perfect_Hash_Generators} (@code{g-pehage.ads}) @@ -24937,7 +24949,7 @@ hashcode are in the same order. These hashing functions are very convenient for use with realtime applications. @node GNAT Random_Numbers g-rannum ads,GNAT Regexp g-regexp ads,GNAT Perfect_Hash_Generators g-pehage ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{3a2}@anchor{gnat_rm/the_gnat_library id89}@anchor{3a3} +@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{3a4}@anchor{gnat_rm/the_gnat_library id90}@anchor{3a5} @section @code{GNAT.Random_Numbers} (@code{g-rannum.ads}) @@ -24951,7 +24963,7 @@ however NOT suitable for situations requiring cryptographically secure randomness. @node GNAT Regexp g-regexp ads,GNAT Registry g-regist ads,GNAT Random_Numbers g-rannum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{279}@anchor{gnat_rm/the_gnat_library id90}@anchor{3a4} +@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{279}@anchor{gnat_rm/the_gnat_library id91}@anchor{3a6} @section @code{GNAT.Regexp} (@code{g-regexp.ads}) @@ -24967,7 +24979,7 @@ simplest of the three pattern matching packages provided, and is particularly suitable for ‘file globbing’ applications. @node GNAT Registry g-regist ads,GNAT Regpat g-regpat ads,GNAT Regexp g-regexp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id91}@anchor{3a6} +@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{3a7}@anchor{gnat_rm/the_gnat_library id92}@anchor{3a8} @section @code{GNAT.Registry} (@code{g-regist.ads}) @@ -24981,7 +24993,7 @@ registry API, but at a lower level of abstraction, refer to the Win32.Winreg package provided with the Win32Ada binding @node GNAT Regpat g-regpat ads,GNAT Rewrite_Data g-rewdat ads,GNAT Registry g-regist ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{3a7}@anchor{gnat_rm/the_gnat_library id92}@anchor{3a8} +@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{3a9}@anchor{gnat_rm/the_gnat_library id93}@anchor{3aa} @section @code{GNAT.Regpat} (@code{g-regpat.ads}) @@ -24996,7 +25008,7 @@ from the original V7 style regular expression library written in C by Henry Spencer (and binary compatible with this C library). @node GNAT Rewrite_Data g-rewdat ads,GNAT Secondary_Stack_Info g-sestin ads,GNAT Regpat g-regpat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3a9}@anchor{gnat_rm/the_gnat_library id93}@anchor{3aa} +@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id94}@anchor{3ac} @section @code{GNAT.Rewrite_Data} (@code{g-rewdat.ads}) @@ -25010,7 +25022,7 @@ full content to be processed is not loaded into memory all at once. This makes this interface usable for large files or socket streams. @node GNAT Secondary_Stack_Info g-sestin ads,GNAT Semaphores g-semaph ads,GNAT Rewrite_Data g-rewdat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id94}@anchor{3ac} +@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id95}@anchor{3ae} @section @code{GNAT.Secondary_Stack_Info} (@code{g-sestin.ads}) @@ -25022,7 +25034,7 @@ Provides the capability to query the high water mark of the current task’s secondary stack. @node GNAT Semaphores g-semaph ads,GNAT Serial_Communications g-sercom ads,GNAT Secondary_Stack_Info g-sestin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id95}@anchor{3ae} +@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id96}@anchor{3b0} @section @code{GNAT.Semaphores} (@code{g-semaph.ads}) @@ -25033,7 +25045,7 @@ secondary stack. Provides classic counting and binary semaphores using protected types. @node GNAT Serial_Communications g-sercom ads,GNAT SHA1 g-sha1 ads,GNAT Semaphores g-semaph ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id96}@anchor{3b0} +@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id97}@anchor{3b2} @section @code{GNAT.Serial_Communications} (@code{g-sercom.ads}) @@ -25045,7 +25057,7 @@ Provides a simple interface to send and receive data over a serial port. This is only supported on GNU/Linux and Windows. @node GNAT SHA1 g-sha1 ads,GNAT SHA224 g-sha224 ads,GNAT Serial_Communications g-sercom ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id97}@anchor{3b2} +@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id98}@anchor{3b4} @section @code{GNAT.SHA1} (@code{g-sha1.ads}) @@ -25058,7 +25070,7 @@ and RFC 3174, and the HMAC-SHA1 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA224 g-sha224 ads,GNAT SHA256 g-sha256 ads,GNAT SHA1 g-sha1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id98}@anchor{3b4} +@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id99}@anchor{3b6} @section @code{GNAT.SHA224} (@code{g-sha224.ads}) @@ -25071,7 +25083,7 @@ and the HMAC-SHA224 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA256 g-sha256 ads,GNAT SHA384 g-sha384 ads,GNAT SHA224 g-sha224 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id99}@anchor{3b6} +@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3b7}@anchor{gnat_rm/the_gnat_library id100}@anchor{3b8} @section @code{GNAT.SHA256} (@code{g-sha256.ads}) @@ -25084,7 +25096,7 @@ and the HMAC-SHA256 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA384 g-sha384 ads,GNAT SHA512 g-sha512 ads,GNAT SHA256 g-sha256 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3b7}@anchor{gnat_rm/the_gnat_library id100}@anchor{3b8} +@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id101}@anchor{3ba} @section @code{GNAT.SHA384} (@code{g-sha384.ads}) @@ -25097,7 +25109,7 @@ and the HMAC-SHA384 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA512 g-sha512 ads,GNAT Signals g-signal ads,GNAT SHA384 g-sha384 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id101}@anchor{3ba} +@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id102}@anchor{3bc} @section @code{GNAT.SHA512} (@code{g-sha512.ads}) @@ -25110,7 +25122,7 @@ and the HMAC-SHA512 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Signals g-signal ads,GNAT Sockets g-socket ads,GNAT SHA512 g-sha512 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id102}@anchor{3bc} +@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3bd}@anchor{gnat_rm/the_gnat_library id103}@anchor{3be} @section @code{GNAT.Signals} (@code{g-signal.ads}) @@ -25122,7 +25134,7 @@ Provides the ability to manipulate the blocked status of signals on supported targets. @node GNAT Sockets g-socket ads,GNAT Source_Info g-souinf ads,GNAT Signals g-signal ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3bd}@anchor{gnat_rm/the_gnat_library id103}@anchor{3be} +@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3bf}@anchor{gnat_rm/the_gnat_library id104}@anchor{3c0} @section @code{GNAT.Sockets} (@code{g-socket.ads}) @@ -25137,7 +25149,7 @@ on all native GNAT ports and on VxWorks cross ports. It is not implemented for the LynxOS cross port. @node GNAT Source_Info g-souinf ads,GNAT Spelling_Checker g-speche ads,GNAT Sockets g-socket ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3bf}@anchor{gnat_rm/the_gnat_library id104}@anchor{3c0} +@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id105}@anchor{3c2} @section @code{GNAT.Source_Info} (@code{g-souinf.ads}) @@ -25151,7 +25163,7 @@ subprograms yielding the date and time of the current compilation (like the C macros @code{__DATE__} and @code{__TIME__}) @node GNAT Spelling_Checker g-speche ads,GNAT Spelling_Checker_Generic g-spchge ads,GNAT Source_Info g-souinf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id105}@anchor{3c2} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id106}@anchor{3c4} @section @code{GNAT.Spelling_Checker} (@code{g-speche.ads}) @@ -25163,7 +25175,7 @@ Provides a function for determining whether one string is a plausible near misspelling of another string. @node GNAT Spelling_Checker_Generic g-spchge ads,GNAT Spitbol Patterns g-spipat ads,GNAT Spelling_Checker g-speche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id106}@anchor{3c4} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3c5}@anchor{gnat_rm/the_gnat_library id107}@anchor{3c6} @section @code{GNAT.Spelling_Checker_Generic} (@code{g-spchge.ads}) @@ -25176,7 +25188,7 @@ determining whether one string is a plausible near misspelling of another string. @node GNAT Spitbol Patterns g-spipat ads,GNAT Spitbol g-spitbo ads,GNAT Spelling_Checker_Generic g-spchge ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3c5}@anchor{gnat_rm/the_gnat_library id107}@anchor{3c6} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id108}@anchor{3c8} @section @code{GNAT.Spitbol.Patterns} (@code{g-spipat.ads}) @@ -25192,7 +25204,7 @@ the SNOBOL4 dynamic pattern construction and matching capabilities, using the efficient algorithm developed by Robert Dewar for the SPITBOL system. @node GNAT Spitbol g-spitbo ads,GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Patterns g-spipat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id108}@anchor{3c8} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3c9}@anchor{gnat_rm/the_gnat_library id109}@anchor{3ca} @section @code{GNAT.Spitbol} (@code{g-spitbo.ads}) @@ -25207,7 +25219,7 @@ useful for constructing arbitrary mappings from strings in the style of the SNOBOL4 TABLE function. @node GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol g-spitbo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3c9}@anchor{gnat_rm/the_gnat_library id109}@anchor{3ca} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3cb}@anchor{gnat_rm/the_gnat_library id110}@anchor{3cc} @section @code{GNAT.Spitbol.Table_Boolean} (@code{g-sptabo.ads}) @@ -25222,7 +25234,7 @@ for type @code{Standard.Boolean}, giving an implementation of sets of string values. @node GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol Table_VString g-sptavs ads,GNAT Spitbol Table_Boolean g-sptabo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3cb}@anchor{gnat_rm/the_gnat_library id110}@anchor{3cc} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3cd}@anchor{gnat_rm/the_gnat_library id111}@anchor{3ce} @section @code{GNAT.Spitbol.Table_Integer} (@code{g-sptain.ads}) @@ -25239,7 +25251,7 @@ for type @code{Standard.Integer}, giving an implementation of maps from string to integer values. @node GNAT Spitbol Table_VString g-sptavs ads,GNAT SSE g-sse ads,GNAT Spitbol Table_Integer g-sptain ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3cd}@anchor{gnat_rm/the_gnat_library id111}@anchor{3ce} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3cf}@anchor{gnat_rm/the_gnat_library id112}@anchor{3d0} @section @code{GNAT.Spitbol.Table_VString} (@code{g-sptavs.ads}) @@ -25256,7 +25268,7 @@ a variable length string type, giving an implementation of general maps from strings to strings. @node GNAT SSE g-sse ads,GNAT SSE Vector_Types g-ssvety ads,GNAT Spitbol Table_VString g-sptavs ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3cf}@anchor{gnat_rm/the_gnat_library id112}@anchor{3d0} +@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id113}@anchor{3d2} @section @code{GNAT.SSE} (@code{g-sse.ads}) @@ -25268,7 +25280,7 @@ targets. It exposes vector component types together with a general introduction to the binding contents and use. @node GNAT SSE Vector_Types g-ssvety ads,GNAT String_Hash g-strhas ads,GNAT SSE g-sse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id113}@anchor{3d2} +@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3d3}@anchor{gnat_rm/the_gnat_library id114}@anchor{3d4} @section @code{GNAT.SSE.Vector_Types} (@code{g-ssvety.ads}) @@ -25277,7 +25289,7 @@ introduction to the binding contents and use. SSE vector types for use with SSE related intrinsics. @node GNAT String_Hash g-strhas ads,GNAT Strings g-string ads,GNAT SSE Vector_Types g-ssvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3d3}@anchor{gnat_rm/the_gnat_library id114}@anchor{3d4} +@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id115}@anchor{3d6} @section @code{GNAT.String_Hash} (@code{g-strhas.ads}) @@ -25289,7 +25301,7 @@ Provides a generic hash function working on arrays of scalars. Both the scalar type and the hash result type are parameters. @node GNAT Strings g-string ads,GNAT String_Split g-strspl ads,GNAT String_Hash g-strhas ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id115}@anchor{3d6} +@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id116}@anchor{3d8} @section @code{GNAT.Strings} (@code{g-string.ads}) @@ -25299,7 +25311,7 @@ Common String access types and related subprograms. Basically it defines a string access and an array of string access types. @node GNAT String_Split g-strspl ads,GNAT Table g-table ads,GNAT Strings g-string ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id116}@anchor{3d8} +@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id117}@anchor{3da} @section @code{GNAT.String_Split} (@code{g-strspl.ads}) @@ -25313,7 +25325,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Table g-table ads,GNAT Task_Lock g-tasloc ads,GNAT String_Split g-strspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id117}@anchor{3da} +@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id118}@anchor{3dc} @section @code{GNAT.Table} (@code{g-table.ads}) @@ -25333,7 +25345,7 @@ while an instantiation of @code{GNAT.Dynamic_Tables} creates a type that can be used to define dynamic instances of the table. @node GNAT Task_Lock g-tasloc ads,GNAT Time_Stamp g-timsta ads,GNAT Table g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id118}@anchor{3dc} +@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id119}@anchor{3de} @section @code{GNAT.Task_Lock} (@code{g-tasloc.ads}) @@ -25350,7 +25362,7 @@ single global task lock. Appropriate for use in situations where contention between tasks is very rarely expected. @node GNAT Time_Stamp g-timsta ads,GNAT Threads g-thread ads,GNAT Task_Lock g-tasloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id119}@anchor{3de} +@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id120}@anchor{3e0} @section @code{GNAT.Time_Stamp} (@code{g-timsta.ads}) @@ -25365,7 +25377,7 @@ represents the current date and time in ISO 8601 format. This is a very simple routine with minimal code and there are no dependencies on any other unit. @node GNAT Threads g-thread ads,GNAT Traceback g-traceb ads,GNAT Time_Stamp g-timsta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id120}@anchor{3e0} +@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id121}@anchor{3e2} @section @code{GNAT.Threads} (@code{g-thread.ads}) @@ -25382,7 +25394,7 @@ further details if your program has threads that are created by a non-Ada environment which then accesses Ada code. @node GNAT Traceback g-traceb ads,GNAT Traceback Symbolic g-trasym ads,GNAT Threads g-thread ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id121}@anchor{3e2} +@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3e3}@anchor{gnat_rm/the_gnat_library id122}@anchor{3e4} @section @code{GNAT.Traceback} (@code{g-traceb.ads}) @@ -25394,7 +25406,7 @@ Provides a facility for obtaining non-symbolic traceback information, useful in various debugging situations. @node GNAT Traceback Symbolic g-trasym ads,GNAT UTF_32 g-utf_32 ads,GNAT Traceback g-traceb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3e3}@anchor{gnat_rm/the_gnat_library id122}@anchor{3e4} +@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3e5}@anchor{gnat_rm/the_gnat_library id123}@anchor{3e6} @section @code{GNAT.Traceback.Symbolic} (@code{g-trasym.ads}) @@ -25403,7 +25415,7 @@ in various debugging situations. @geindex Trace back facilities @node GNAT UTF_32 g-utf_32 ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Traceback Symbolic g-trasym ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3e5}@anchor{gnat_rm/the_gnat_library id123}@anchor{3e6} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id124}@anchor{3e8} @section @code{GNAT.UTF_32} (@code{g-utf_32.ads}) @@ -25422,7 +25434,7 @@ lower case to upper case fold routine corresponding to the Ada 2005 rules for identifier equivalence. @node GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Wide_Spelling_Checker g-wispch ads,GNAT UTF_32 g-utf_32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id124}@anchor{3e8} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id125}@anchor{3ea} @section @code{GNAT.UTF_32_Spelling_Checker} (@code{g-u3spch.ads}) @@ -25435,7 +25447,7 @@ near misspelling of another wide wide string, where the strings are represented using the UTF_32_String type defined in System.Wch_Cnv. @node GNAT Wide_Spelling_Checker g-wispch ads,GNAT Wide_String_Split g-wistsp ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id125}@anchor{3ea} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id126}@anchor{3ec} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-wispch.ads}) @@ -25447,7 +25459,7 @@ Provides a function for determining whether one wide string is a plausible near misspelling of another wide string. @node GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Spelling_Checker g-wispch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id126}@anchor{3ec} +@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3ed}@anchor{gnat_rm/the_gnat_library id127}@anchor{3ee} @section @code{GNAT.Wide_String_Split} (@code{g-wistsp.ads}) @@ -25461,7 +25473,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Wide_String_Split g-zistsp ads,GNAT Wide_String_Split g-wistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3ed}@anchor{gnat_rm/the_gnat_library id127}@anchor{3ee} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3ef}@anchor{gnat_rm/the_gnat_library id128}@anchor{3f0} @section @code{GNAT.Wide_Wide_Spelling_Checker} (@code{g-zspche.ads}) @@ -25473,7 +25485,7 @@ Provides a function for determining whether one wide wide string is a plausible near misspelling of another wide wide string. @node GNAT Wide_Wide_String_Split g-zistsp ads,Interfaces C Extensions i-cexten ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3ef}@anchor{gnat_rm/the_gnat_library id128}@anchor{3f0} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3f1}@anchor{gnat_rm/the_gnat_library id129}@anchor{3f2} @section @code{GNAT.Wide_Wide_String_Split} (@code{g-zistsp.ads}) @@ -25487,7 +25499,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node Interfaces C Extensions i-cexten ads,Interfaces C Streams i-cstrea ads,GNAT Wide_Wide_String_Split g-zistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id129}@anchor{3f1}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3f2} +@anchor{gnat_rm/the_gnat_library id130}@anchor{3f3}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3f4} @section @code{Interfaces.C.Extensions} (@code{i-cexten.ads}) @@ -25498,7 +25510,7 @@ for use with either manually or automatically generated bindings to C libraries. @node Interfaces C Streams i-cstrea ads,Interfaces Packed_Decimal i-pacdec ads,Interfaces C Extensions i-cexten ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id130}@anchor{3f3}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3f4} +@anchor{gnat_rm/the_gnat_library id131}@anchor{3f5}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3f6} @section @code{Interfaces.C.Streams} (@code{i-cstrea.ads}) @@ -25511,7 +25523,7 @@ This package is a binding for the most commonly used operations on C streams. @node Interfaces Packed_Decimal i-pacdec ads,Interfaces VxWorks i-vxwork ads,Interfaces C Streams i-cstrea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id131}@anchor{3f5}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3f6} +@anchor{gnat_rm/the_gnat_library id132}@anchor{3f7}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3f8} @section @code{Interfaces.Packed_Decimal} (@code{i-pacdec.ads}) @@ -25526,7 +25538,7 @@ from a packed decimal format compatible with that used on IBM mainframes. @node Interfaces VxWorks i-vxwork ads,Interfaces VxWorks IO i-vxwoio ads,Interfaces Packed_Decimal i-pacdec ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id132}@anchor{3f7}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3f8} +@anchor{gnat_rm/the_gnat_library id133}@anchor{3f9}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3fa} @section @code{Interfaces.VxWorks} (@code{i-vxwork.ads}) @@ -25540,7 +25552,7 @@ mainframes. This package provides a limited binding to the VxWorks API. @node Interfaces VxWorks IO i-vxwoio ads,System Address_Image s-addima ads,Interfaces VxWorks i-vxwork ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id133}@anchor{3f9}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3fa} +@anchor{gnat_rm/the_gnat_library id134}@anchor{3fb}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3fc} @section @code{Interfaces.VxWorks.IO} (@code{i-vxwoio.ads}) @@ -25563,7 +25575,7 @@ function codes. A particular use of this package is to enable the use of Get_Immediate under VxWorks. @node System Address_Image s-addima ads,System Assertions s-assert ads,Interfaces VxWorks IO i-vxwoio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id134}@anchor{3fb}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3fc} +@anchor{gnat_rm/the_gnat_library id135}@anchor{3fd}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3fe} @section @code{System.Address_Image} (@code{s-addima.ads}) @@ -25579,7 +25591,7 @@ function that gives an (implementation dependent) string which identifies an address. @node System Assertions s-assert ads,System Atomic_Counters s-atocou ads,System Address_Image s-addima ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id135}@anchor{3fd}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3fe} +@anchor{gnat_rm/the_gnat_library id136}@anchor{3ff}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{400} @section @code{System.Assertions} (@code{s-assert.ads}) @@ -25595,7 +25607,7 @@ by an run-time assertion failure, as well as the routine that is used internally to raise this assertion. @node System Atomic_Counters s-atocou ads,System Memory s-memory ads,System Assertions s-assert ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id136}@anchor{3ff}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{400} +@anchor{gnat_rm/the_gnat_library id137}@anchor{401}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{402} @section @code{System.Atomic_Counters} (@code{s-atocou.ads}) @@ -25609,7 +25621,7 @@ on most targets, including all Alpha, AARCH64, ARM, ia64, PowerPC, SPARC V9, x86, and x86_64 platforms. @node System Memory s-memory ads,System Multiprocessors s-multip ads,System Atomic_Counters s-atocou ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id137}@anchor{401}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{402} +@anchor{gnat_rm/the_gnat_library id138}@anchor{403}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{404} @section @code{System.Memory} (@code{s-memory.ads}) @@ -25627,7 +25639,7 @@ calls to this unit may be made for low level allocation uses (for example see the body of @code{GNAT.Tables}). @node System Multiprocessors s-multip ads,System Multiprocessors Dispatching_Domains s-mudido ads,System Memory s-memory ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id138}@anchor{403}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{404} +@anchor{gnat_rm/the_gnat_library id139}@anchor{405}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{406} @section @code{System.Multiprocessors} (@code{s-multip.ads}) @@ -25640,7 +25652,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Multiprocessors Dispatching_Domains s-mudido ads,System Partition_Interface s-parint ads,System Multiprocessors s-multip ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id139}@anchor{405}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{406} +@anchor{gnat_rm/the_gnat_library id140}@anchor{407}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{408} @section @code{System.Multiprocessors.Dispatching_Domains} (@code{s-mudido.ads}) @@ -25653,7 +25665,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Partition_Interface s-parint ads,System Pool_Global s-pooglo ads,System Multiprocessors Dispatching_Domains s-mudido ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id140}@anchor{407}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{408} +@anchor{gnat_rm/the_gnat_library id141}@anchor{409}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{40a} @section @code{System.Partition_Interface} (@code{s-parint.ads}) @@ -25666,7 +25678,7 @@ is used primarily in a distribution context when using Annex E with @code{PolyORB}. @node System Pool_Global s-pooglo ads,System Pool_Local s-pooloc ads,System Partition_Interface s-parint ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id141}@anchor{409}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{40a} +@anchor{gnat_rm/the_gnat_library id142}@anchor{40b}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{40c} @section @code{System.Pool_Global} (@code{s-pooglo.ads}) @@ -25683,7 +25695,7 @@ declared. It uses malloc/free to allocate/free and does not attempt to do any automatic reclamation. @node System Pool_Local s-pooloc ads,System Restrictions s-restri ads,System Pool_Global s-pooglo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id142}@anchor{40b}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{40c} +@anchor{gnat_rm/the_gnat_library id143}@anchor{40d}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{40e} @section @code{System.Pool_Local} (@code{s-pooloc.ads}) @@ -25700,7 +25712,7 @@ a list of allocated blocks, so that all storage allocated for the pool can be freed automatically when the pool is finalized. @node System Restrictions s-restri ads,System Rident s-rident ads,System Pool_Local s-pooloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id143}@anchor{40d}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{40e} +@anchor{gnat_rm/the_gnat_library id144}@anchor{40f}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{410} @section @code{System.Restrictions} (@code{s-restri.ads}) @@ -25716,7 +25728,7 @@ compiler determined information on which restrictions are violated by one or more packages in the partition. @node System Rident s-rident ads,System Strings Stream_Ops s-ststop ads,System Restrictions s-restri ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id144}@anchor{40f}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{410} +@anchor{gnat_rm/the_gnat_library id145}@anchor{411}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{412} @section @code{System.Rident} (@code{s-rident.ads}) @@ -25732,7 +25744,7 @@ since the necessary instantiation is included in package System.Restrictions. @node System Strings Stream_Ops s-ststop ads,System Unsigned_Types s-unstyp ads,System Rident s-rident ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id145}@anchor{411}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{412} +@anchor{gnat_rm/the_gnat_library id146}@anchor{413}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{414} @section @code{System.Strings.Stream_Ops} (@code{s-ststop.ads}) @@ -25748,7 +25760,7 @@ stream attributes are applied to string types, but the subprograms in this package can be used directly by application programs. @node System Unsigned_Types s-unstyp ads,System Wch_Cnv s-wchcnv ads,System Strings Stream_Ops s-ststop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id146}@anchor{413}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{414} +@anchor{gnat_rm/the_gnat_library id147}@anchor{415}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{416} @section @code{System.Unsigned_Types} (@code{s-unstyp.ads}) @@ -25761,7 +25773,7 @@ also contains some related definitions for other specialized types used by the compiler in connection with packed array types. @node System Wch_Cnv s-wchcnv ads,System Wch_Con s-wchcon ads,System Unsigned_Types s-unstyp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id147}@anchor{415}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{416} +@anchor{gnat_rm/the_gnat_library id148}@anchor{417}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{418} @section @code{System.Wch_Cnv} (@code{s-wchcnv.ads}) @@ -25782,7 +25794,7 @@ encoding method. It uses definitions in package @code{System.Wch_Con}. @node System Wch_Con s-wchcon ads,,System Wch_Cnv s-wchcnv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id148}@anchor{417}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{418} +@anchor{gnat_rm/the_gnat_library id149}@anchor{419}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{41a} @section @code{System.Wch_Con} (@code{s-wchcon.ads}) @@ -25794,7 +25806,7 @@ in ordinary strings. These definitions are used by the package @code{System.Wch_Cnv}. @node Interfacing to Other Languages,Specialized Needs Annexes,The GNAT Library,Top -@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{419}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{41a}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11} +@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{41b}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{41c}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11} @chapter Interfacing to Other Languages @@ -25812,7 +25824,7 @@ provided. @end menu @node Interfacing to C,Interfacing to C++,,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{41b}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{41c} +@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{41d}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{41e} @section Interfacing to C @@ -25952,7 +25964,7 @@ of the length corresponding to the @code{type'Size} value in Ada. @end itemize @node Interfacing to C++,Interfacing to COBOL,Interfacing to C,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{49}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{41d} +@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{49}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{41f} @section Interfacing to C++ @@ -26169,7 +26181,7 @@ builds an opaque @code{Type_Info_Ptr} to reference a @code{std::type_info} object at a given @code{System.Address}. @node Interfacing to COBOL,Interfacing to Fortran,Interfacing to C++,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{41e}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{41f} +@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{420}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{421} @section Interfacing to COBOL @@ -26177,7 +26189,7 @@ Interfacing to COBOL is achieved as described in section B.4 of the Ada Reference Manual. @node Interfacing to Fortran,Interfacing to non-GNAT Ada code,Interfacing to COBOL,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{420}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{421} +@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{422}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{423} @section Interfacing to Fortran @@ -26187,7 +26199,7 @@ multi-dimensional array causes the array to be stored in column-major order as required for convenient interface to Fortran. @node Interfacing to non-GNAT Ada code,,Interfacing to Fortran,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{422}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{423} +@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{424}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{425} @section Interfacing to non-GNAT Ada code @@ -26211,7 +26223,7 @@ values or simple record types without variants, or simple array types with fixed bounds. @node Specialized Needs Annexes,Implementation of Specific Ada Features,Interfacing to Other Languages,Top -@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{424}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{425}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12} +@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{426}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{427}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12} @chapter Specialized Needs Annexes @@ -26249,7 +26261,7 @@ in Ada 2005) is fully implemented. @end table @node Implementation of Specific Ada Features,Implementation of Ada 2022 Features,Specialized Needs Annexes,Top -@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{426}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{427}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13} +@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{428}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{429}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13} @chapter Implementation of Specific Ada Features @@ -26268,7 +26280,7 @@ facilities. @end menu @node Machine Code Insertions,GNAT Implementation of Tasking,,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{428}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{181} +@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{42a}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{181} @section Machine Code Insertions @@ -26436,7 +26448,7 @@ according to normal visibility rules. In particular if there is no qualification is required. @node GNAT Implementation of Tasking,GNAT Implementation of Shared Passive Packages,Machine Code Insertions,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{429}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{42a} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{42b}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{42c} @section GNAT Implementation of Tasking @@ -26452,7 +26464,7 @@ to compliance with the Real-Time Systems Annex. @end menu @node Mapping Ada Tasks onto the Underlying Kernel Threads,Ensuring Compliance with the Real-Time Annex,,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{42b}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{42c} +@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{42d}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{42e} @subsection Mapping Ada Tasks onto the Underlying Kernel Threads @@ -26521,7 +26533,7 @@ support this functionality when the parent contains more than one task. @geindex Forking a new process @node Ensuring Compliance with the Real-Time Annex,Support for Locking Policies,Mapping Ada Tasks onto the Underlying Kernel Threads,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{42d}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{42e} +@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{42f}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{430} @subsection Ensuring Compliance with the Real-Time Annex @@ -26572,7 +26584,7 @@ placed at the end. @c Support_for_Locking_Policies @node Support for Locking Policies,,Ensuring Compliance with the Real-Time Annex,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{42f} +@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{431} @subsection Support for Locking Policies @@ -26606,7 +26618,7 @@ then ceiling locking is used. Otherwise, the @code{Ceiling_Locking} policy is ignored. @node GNAT Implementation of Shared Passive Packages,Code Generation for Array Aggregates,GNAT Implementation of Tasking,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{430}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{431} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{432}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{433} @section GNAT Implementation of Shared Passive Packages @@ -26704,7 +26716,7 @@ This is used to provide the required locking semantics for proper protected object synchronization. @node Code Generation for Array Aggregates,The Size of Discriminated Records with Default Discriminants,GNAT Implementation of Shared Passive Packages,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{432}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{433} +@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{434}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{435} @section Code Generation for Array Aggregates @@ -26735,7 +26747,7 @@ component values and static subtypes also lead to simpler code. @end menu @node Static constant aggregates with static bounds,Constant aggregates with unconstrained nominal types,,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{434}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{435} +@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{436}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{437} @subsection Static constant aggregates with static bounds @@ -26782,7 +26794,7 @@ Zero2: constant two_dim := (others => (others => 0)); @end example @node Constant aggregates with unconstrained nominal types,Aggregates with static bounds,Static constant aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{436}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{437} +@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{438}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{439} @subsection Constant aggregates with unconstrained nominal types @@ -26797,7 +26809,7 @@ Cr_Unc : constant One_Unc := (12,24,36); @end example @node Aggregates with static bounds,Aggregates with nonstatic bounds,Constant aggregates with unconstrained nominal types,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{438}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{439} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{43a}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{43b} @subsection Aggregates with static bounds @@ -26825,7 +26837,7 @@ end loop; @end example @node Aggregates with nonstatic bounds,Aggregates in assignment statements,Aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{43a}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{43b} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{43c}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{43d} @subsection Aggregates with nonstatic bounds @@ -26836,7 +26848,7 @@ have to be applied to sub-arrays individually, if they do not have statically compatible subtypes. @node Aggregates in assignment statements,,Aggregates with nonstatic bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{43c}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{43d} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{43e}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{43f} @subsection Aggregates in assignment statements @@ -26878,7 +26890,7 @@ a temporary (created either by the front-end or the code generator) and then that temporary will be copied onto the target. @node The Size of Discriminated Records with Default Discriminants,Image Values For Nonscalar Types,Code Generation for Array Aggregates,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{43e}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{43f} +@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{440}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{441} @section The Size of Discriminated Records with Default Discriminants @@ -26958,7 +26970,7 @@ say) must be consistent, so it is imperative that the object, once created, remain invariant. @node Image Values For Nonscalar Types,Strict Conformance to the Ada Reference Manual,The Size of Discriminated Records with Default Discriminants,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{440}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{441} +@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{442}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{443} @section Image Values For Nonscalar Types @@ -26978,7 +26990,7 @@ control of image text is required for some type T, then T’Put_Image should be explicitly specified. @node Strict Conformance to the Ada Reference Manual,,Image Values For Nonscalar Types,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{442}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{443} +@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{444}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{445} @section Strict Conformance to the Ada Reference Manual @@ -27005,7 +27017,7 @@ behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated. @node Implementation of Ada 2022 Features,GNAT language extensions,Implementation of Specific Ada Features,Top -@anchor{gnat_rm/implementation_of_ada_2022_features doc}@anchor{444}@anchor{gnat_rm/implementation_of_ada_2022_features id1}@anchor{445}@anchor{gnat_rm/implementation_of_ada_2022_features implementation-of-ada-2022-features}@anchor{14} +@anchor{gnat_rm/implementation_of_ada_2022_features doc}@anchor{446}@anchor{gnat_rm/implementation_of_ada_2022_features id1}@anchor{447}@anchor{gnat_rm/implementation_of_ada_2022_features implementation-of-ada-2022-features}@anchor{14} @chapter Implementation of Ada 2022 Features @@ -30424,7 +30436,7 @@ RM references: 3.02.04 (31/5) 4.06 (51.1/5) @end itemize @node GNAT language extensions,Security Hardening Features,Implementation of Ada 2022 Features,Top -@anchor{gnat_rm/gnat_language_extensions doc}@anchor{446}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{447}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{448} +@anchor{gnat_rm/gnat_language_extensions doc}@anchor{448}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{449}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{44a} @chapter GNAT language extensions @@ -30456,7 +30468,7 @@ These features might be removed or heavily modified at any time. @end menu @node How to activate the extended GNAT Ada superset,Curated Extensions,,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{449} +@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{44b} @section How to activate the extended GNAT Ada superset @@ -30497,7 +30509,7 @@ for use in playground experiments. @end cartouche @node Curated Extensions,Experimental Language Extensions,How to activate the extended GNAT Ada superset,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{44a}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{6a} +@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{44c}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{6a} @section Curated Extensions @@ -30520,7 +30532,7 @@ Features activated via @code{-gnatX} or @end menu @node Local Declarations Without Block,Deep delta Aggregates,,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{44b} +@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{44d} @subsection Local Declarations Without Block @@ -30613,7 +30625,7 @@ And as such the second `@w{`}A`@w{`} declaration is hiding the first one. @end cartouche @node Deep delta Aggregates,Fixed lower bounds for array types and subtypes,Local Declarations Without Block,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions deep-delta-aggregates}@anchor{44c} +@anchor{gnat_rm/gnat_language_extensions deep-delta-aggregates}@anchor{44e} @subsection Deep delta Aggregates @@ -30635,7 +30647,7 @@ The syntax of delta aggregates in the extended version is the following: @end menu @node Syntax,Legality Rules,,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions syntax}@anchor{44d} +@anchor{gnat_rm/gnat_language_extensions syntax}@anchor{44f} @subsubsection Syntax @@ -30681,7 +30693,7 @@ array_subcomponent_choice ::= @end example @node Legality Rules,Dynamic Semantics,Syntax,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions legality-rules}@anchor{44e} +@anchor{gnat_rm/gnat_language_extensions legality-rules}@anchor{450} @subsubsection Legality Rules @@ -30718,7 +30730,7 @@ the object denoted by the base_expression, prior to any update.] @end enumerate @node Dynamic Semantics,Examples,Legality Rules,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions dynamic-semantics}@anchor{44f} +@anchor{gnat_rm/gnat_language_extensions dynamic-semantics}@anchor{451} @subsubsection Dynamic Semantics @@ -30775,7 +30787,7 @@ and assigned to the corresponding subcomponent of the anonymous object. @end itemize @node Examples,,Dynamic Semantics,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions examples}@anchor{450} +@anchor{gnat_rm/gnat_language_extensions examples}@anchor{452} @subsubsection Examples @@ -30803,7 +30815,7 @@ end; @end example @node Fixed lower bounds for array types and subtypes,Prefixed-view notation for calls to primitive subprograms of untagged types,Deep delta Aggregates,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{451} +@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{453} @subsection Fixed lower bounds for array types and subtypes @@ -30854,7 +30866,7 @@ lower bound of unconstrained array formals when the formal’s subtype has index ranges with static fixed lower bounds. @node Prefixed-view notation for calls to primitive subprograms of untagged types,Expression defaults for generic formal functions,Fixed lower bounds for array types and subtypes,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{452} +@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{454} @subsection Prefixed-view notation for calls to primitive subprograms of untagged types @@ -30904,7 +30916,7 @@ pragma Assert (V.Nth_Element(1) = 42); @end example @node Expression defaults for generic formal functions,String interpolation,Prefixed-view notation for calls to primitive subprograms of untagged types,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{453} +@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{455} @subsection Expression defaults for generic formal functions @@ -30935,7 +30947,7 @@ If the default is used (i.e. there is no actual corresponding to Copy), then calls to Copy in the instance will simply return Item. @node String interpolation,Constrained attribute for generic objects,Expression defaults for generic formal functions,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{454} +@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{456} @subsection String interpolation @@ -31102,7 +31114,7 @@ a double quote is " and an open brace is @{ @end example @node Constrained attribute for generic objects,Static aspect on intrinsic functions,String interpolation,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{455} +@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{457} @subsection Constrained attribute for generic objects @@ -31110,7 +31122,7 @@ The @code{Constrained} attribute is permitted for objects of generic types. The result indicates whether the corresponding actual is constrained. @node Static aspect on intrinsic functions,First Controlling Parameter,Constrained attribute for generic objects,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{456} +@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{458} @subsection @code{Static} aspect on intrinsic functions @@ -31119,7 +31131,7 @@ and the compiler will evaluate some of these intrinsics statically, in particular the @code{Shift_Left} and @code{Shift_Right} intrinsics. @node First Controlling Parameter,Unsigned_Base_Range aspect,Static aspect on intrinsic functions,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions first-controlling-parameter}@anchor{457} +@anchor{gnat_rm/gnat_language_extensions first-controlling-parameter}@anchor{459} @subsection First Controlling Parameter @@ -31219,7 +31231,7 @@ The result of a function is never a controlling result. @end itemize @node Unsigned_Base_Range aspect,Generalized Finalization,First Controlling Parameter,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions unsigned-base-range-aspect}@anchor{458} +@anchor{gnat_rm/gnat_language_extensions unsigned-base-range-aspect}@anchor{45a} @subsection @code{Unsigned_Base_Range} aspect @@ -31245,7 +31257,7 @@ It ensures that arithmetic operations of type @code{Uns_64} are carried out using 64 bits. @node Generalized Finalization,,Unsigned_Base_Range aspect,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{459} +@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{45b} @subsection Generalized Finalization @@ -31316,7 +31328,7 @@ in this case. @item The @code{Adjust} and @code{Finalize} procedures are automatically considered as -having the @ref{45a,,No_Raise aspect} specified for them. In particular, the +having the @ref{45c,,No_Raise aspect} specified for them. In particular, the compiler has permission to enforce none of the guarantees specified by the RM 7.6.1 (14/1) and subsequent subclauses. @end itemize @@ -31377,7 +31389,7 @@ end P; @end menu @node Finalizable tagged types,Composite types,,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions finalizable-tagged-types}@anchor{45b} +@anchor{gnat_rm/gnat_language_extensions finalizable-tagged-types}@anchor{45d} @subsubsection Finalizable tagged types @@ -31387,7 +31399,7 @@ dispatching whenever it makes sense, i.e. when the object in question is of a class-wide type and the class includes at least one finalizable tagged type. @node Composite types,Interoperability with controlled types,Finalizable tagged types,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions composite-types}@anchor{45c} +@anchor{gnat_rm/gnat_language_extensions composite-types}@anchor{45e} @subsubsection Composite types @@ -31397,7 +31409,7 @@ in order to call the primitives of their components. The dynamic semantics is the same as for controlled components of composite types. @node Interoperability with controlled types,,Composite types,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions interoperability-with-controlled-types}@anchor{45d} +@anchor{gnat_rm/gnat_language_extensions interoperability-with-controlled-types}@anchor{45f} @subsubsection Interoperability with controlled types @@ -31407,7 +31419,7 @@ versa, but the stricter dynamic semantics, in other words that of controlled types, is applied in this case. @node Experimental Language Extensions,,Curated Extensions,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6b}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{45e} +@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6b}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{460} @section Experimental Language Extensions @@ -31432,7 +31444,7 @@ Features activated via @code{-gnatX0} or @end menu @node Conditional when constructs,Implicit With,,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{45f} +@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{461} @subsection Conditional when constructs @@ -31501,7 +31513,7 @@ end; @end example @node Implicit With,Storage Model,Conditional when constructs,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions implicit-with}@anchor{460} +@anchor{gnat_rm/gnat_language_extensions implicit-with}@anchor{462} @subsection Implicit With @@ -31518,7 +31530,7 @@ end; @end example @node Storage Model,Attribute Super,Implicit With,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{461} +@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{463} @subsection Storage Model @@ -31535,7 +31547,7 @@ memory models, in particular to support interactions with GPU. @end menu @node Aspect Storage_Model_Type,Aspect Designated_Storage_Model,,Storage Model -@anchor{gnat_rm/gnat_language_extensions aspect-storage-model-type}@anchor{462} +@anchor{gnat_rm/gnat_language_extensions aspect-storage-model-type}@anchor{464} @subsubsection Aspect Storage_Model_Type @@ -31669,7 +31681,7 @@ end CUDA_Memory; @end example @node Aspect Designated_Storage_Model,Legacy Storage Pools,Aspect Storage_Model_Type,Storage Model -@anchor{gnat_rm/gnat_language_extensions aspect-designated-storage-model}@anchor{463} +@anchor{gnat_rm/gnat_language_extensions aspect-designated-storage-model}@anchor{465} @subsubsection Aspect Designated_Storage_Model @@ -31747,7 +31759,7 @@ begin @end example @node Legacy Storage Pools,,Aspect Designated_Storage_Model,Storage Model -@anchor{gnat_rm/gnat_language_extensions legacy-storage-pools}@anchor{464} +@anchor{gnat_rm/gnat_language_extensions legacy-storage-pools}@anchor{466} @subsubsection Legacy Storage Pools @@ -31798,7 +31810,7 @@ type Acc is access Integer_Array with Storage_Pool => My_Pool; can still be accepted as a shortcut for the new syntax. @node Attribute Super,Simpler Accessibility Model,Storage Model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{465} +@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{467} @subsection Attribute Super @@ -31833,7 +31845,7 @@ end; @end example @node Simpler Accessibility Model,Case pattern matching,Attribute Super,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{466} +@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{468} @subsection Simpler Accessibility Model @@ -31864,7 +31876,7 @@ All of the refined rules are compatible with the [use of anonymous access types @end menu @node Stand-alone objects,Subprogram parameters,,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions stand-alone-objects}@anchor{467} +@anchor{gnat_rm/gnat_language_extensions stand-alone-objects}@anchor{469} @subsubsection Stand-alone objects @@ -31912,7 +31924,7 @@ of the RM 4.6 rule “The accessibility level of the operand type shall not be statically deeper than that of the target type …”. @node Subprogram parameters,Function results,Stand-alone objects,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions subprogram-parameters}@anchor{468} +@anchor{gnat_rm/gnat_language_extensions subprogram-parameters}@anchor{46a} @subsubsection Subprogram parameters @@ -32005,7 +32017,7 @@ end; @end example @node Function results,,Subprogram parameters,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions function-results}@anchor{469} +@anchor{gnat_rm/gnat_language_extensions function-results}@anchor{46b} @subsubsection Function results @@ -32133,7 +32145,7 @@ end; @end example @node Case pattern matching,Mutably Tagged Types with Size’Class Aspect,Simpler Accessibility Model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{46a} +@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{46c} @subsection Case pattern matching @@ -32263,7 +32275,7 @@ message generated in such cases is usually “Capacity exceeded in compiling case statement with composite selector type”. @node Mutably Tagged Types with Size’Class Aspect,No_Raise aspect,Case pattern matching,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{46b} +@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{46d} @subsection Mutably Tagged Types with Size’Class Aspect @@ -32434,7 +32446,7 @@ parameter exists (that is, before leaving the corresponding callable construct). This is analogous to the RM 6.4.1(18) rule about discriminated parameters. @node No_Raise aspect,Inference of Dependent Types in Generic Instantiations,Mutably Tagged Types with Size’Class Aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions id3}@anchor{46c}@anchor{gnat_rm/gnat_language_extensions no-raise-aspect}@anchor{45a} +@anchor{gnat_rm/gnat_language_extensions id3}@anchor{46e}@anchor{gnat_rm/gnat_language_extensions no-raise-aspect}@anchor{45c} @subsection No_Raise aspect @@ -32444,7 +32456,7 @@ be raised during the execution of the subprogram, it is caught at the end of this execution and @code{Program_Error} is propagated to the caller. @node Inference of Dependent Types in Generic Instantiations,External_Initialization Aspect,No_Raise aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions inference-of-dependent-types-in-generic-instantiations}@anchor{46d} +@anchor{gnat_rm/gnat_language_extensions inference-of-dependent-types-in-generic-instantiations}@anchor{46f} @subsection Inference of Dependent Types in Generic Instantiations @@ -32521,7 +32533,7 @@ package Int_Array_Operations is new Array_Operations @end example @node External_Initialization Aspect,Finally construct,Inference of Dependent Types in Generic Instantiations,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions external-initialization-aspect}@anchor{46e} +@anchor{gnat_rm/gnat_language_extensions external-initialization-aspect}@anchor{470} @subsection External_Initialization Aspect @@ -32562,7 +32574,7 @@ The maximum size of loaded files is limited to 2@w{^31} bytes. @end cartouche @node Finally construct,Continue statement,External_Initialization Aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions finally-construct}@anchor{46f} +@anchor{gnat_rm/gnat_language_extensions finally-construct}@anchor{471} @subsection Finally construct @@ -32579,7 +32591,7 @@ This feature is similar to the one with the same name in other languages such as @end menu @node Syntax<2>,Legality Rules<2>,,Finally construct -@anchor{gnat_rm/gnat_language_extensions id4}@anchor{470} +@anchor{gnat_rm/gnat_language_extensions id4}@anchor{472} @subsubsection Syntax @@ -32594,7 +32606,7 @@ handled_sequence_of_statements ::= @end example @node Legality Rules<2>,Dynamic Semantics<2>,Syntax<2>,Finally construct -@anchor{gnat_rm/gnat_language_extensions id5}@anchor{471} +@anchor{gnat_rm/gnat_language_extensions id5}@anchor{473} @subsubsection Legality Rules @@ -32604,7 +32616,7 @@ to be transferred outside the finally part are forbidden. Goto & exit where the target is outside of the finally’s @code{sequence_of_statements} are forbidden @node Dynamic Semantics<2>,,Legality Rules<2>,Finally construct -@anchor{gnat_rm/gnat_language_extensions id6}@anchor{472} +@anchor{gnat_rm/gnat_language_extensions id6}@anchor{474} @subsubsection Dynamic Semantics @@ -32619,7 +32631,7 @@ execution, that is the finally block must be executed in full even if the contai aborted, or if the control is transferred out of the block. @node Continue statement,Destructors,Finally construct,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions continue-statement}@anchor{473} +@anchor{gnat_rm/gnat_language_extensions continue-statement}@anchor{475} @subsection Continue statement @@ -32637,7 +32649,7 @@ Note that @code{continue} is a keyword but it is not a reserved word. This is a configuration that does not exist in standard Ada. @node Destructors,,Continue statement,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions destructors}@anchor{474} +@anchor{gnat_rm/gnat_language_extensions destructors}@anchor{476} @subsection Destructors @@ -32707,7 +32719,7 @@ imposing that rule on outside types that derive from the private view of the type. @node Security Hardening Features,Obsolescent Features,GNAT language extensions,Top -@anchor{gnat_rm/security_hardening_features doc}@anchor{475}@anchor{gnat_rm/security_hardening_features id1}@anchor{476}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} +@anchor{gnat_rm/security_hardening_features doc}@anchor{477}@anchor{gnat_rm/security_hardening_features id1}@anchor{478}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} @chapter Security Hardening Features @@ -32729,7 +32741,7 @@ change. @end menu @node Register Scrubbing,Stack Scrubbing,,Security Hardening Features -@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{477} +@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{479} @section Register Scrubbing @@ -32765,7 +32777,7 @@ programming languages, see @cite{Using the GNU Compiler Collection (GCC)}. @c Stack Scrubbing: @node Stack Scrubbing,Hardened Conditionals,Register Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{478} +@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{47a} @section Stack Scrubbing @@ -32909,7 +32921,7 @@ Bar_Callable_Ptr. @c Hardened Conditionals: @node Hardened Conditionals,Hardened Booleans,Stack Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{479} +@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{47b} @section Hardened Conditionals @@ -32999,7 +33011,7 @@ be used with other programming languages supported by GCC. @c Hardened Booleans: @node Hardened Booleans,Control Flow Redundancy,Hardened Conditionals,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{47a} +@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{47c} @section Hardened Booleans @@ -33060,7 +33072,7 @@ and more details on that attribute, see @cite{Using the GNU Compiler Collection @c Control Flow Redundancy: @node Control Flow Redundancy,,Hardened Booleans,Security Hardening Features -@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{47b} +@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{47d} @section Control Flow Redundancy @@ -33228,7 +33240,7 @@ see @cite{Using the GNU Compiler Collection (GCC)}. These options can be used with other programming languages supported by GCC. @node Obsolescent Features,Compatibility and Porting Guide,Security Hardening Features,Top -@anchor{gnat_rm/obsolescent_features doc}@anchor{47c}@anchor{gnat_rm/obsolescent_features id1}@anchor{47d}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} +@anchor{gnat_rm/obsolescent_features doc}@anchor{47e}@anchor{gnat_rm/obsolescent_features id1}@anchor{47f}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} @chapter Obsolescent Features @@ -33247,7 +33259,7 @@ compatibility purposes. @end menu @node pragma No_Run_Time,pragma Ravenscar,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{47e}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{47f} +@anchor{gnat_rm/obsolescent_features id2}@anchor{480}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{481} @section pragma No_Run_Time @@ -33260,7 +33272,7 @@ preferred usage is to use an appropriately configured run-time that includes just those features that are to be made accessible. @node pragma Ravenscar,pragma Restricted_Run_Time,pragma No_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id3}@anchor{480}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{481} +@anchor{gnat_rm/obsolescent_features id3}@anchor{482}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{483} @section pragma Ravenscar @@ -33269,7 +33281,7 @@ The pragma @code{Ravenscar} has exactly the same effect as pragma is part of the new Ada 2005 standard. @node pragma Restricted_Run_Time,pragma Task_Info,pragma Ravenscar,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id4}@anchor{482}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{483} +@anchor{gnat_rm/obsolescent_features id4}@anchor{484}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{485} @section pragma Restricted_Run_Time @@ -33279,7 +33291,7 @@ preferred since the Ada 2005 pragma @code{Profile} is intended for this kind of implementation dependent addition. @node pragma Task_Info,package System Task_Info s-tasinf ads,pragma Restricted_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id5}@anchor{484}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{485} +@anchor{gnat_rm/obsolescent_features id5}@anchor{486}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{487} @section pragma Task_Info @@ -33305,7 +33317,7 @@ in the spec of package System.Task_Info in the runtime library. @node package System Task_Info s-tasinf ads,,pragma Task_Info,Obsolescent Features -@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{486}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{487} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{488}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{489} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -33315,7 +33327,7 @@ to support the @code{Task_Info} pragma. The predefined Ada package standard replacement for GNAT’s @code{Task_Info} functionality. @node Compatibility and Porting Guide,GNU Free Documentation License,Obsolescent Features,Top -@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{488}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{489} +@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{48a}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{48b} @chapter Compatibility and Porting Guide @@ -33337,7 +33349,7 @@ applications developed in other Ada environments. @end menu @node Writing Portable Fixed-Point Declarations,Compatibility with Ada 83,,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{48a}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{48b} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{48c}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{48d} @section Writing Portable Fixed-Point Declarations @@ -33459,7 +33471,7 @@ If you follow this scheme you will be guaranteed that your fixed-point types will be portable. @node Compatibility with Ada 83,Compatibility between Ada 95 and Ada 2005,Writing Portable Fixed-Point Declarations,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{48c}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{48d} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{48e}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{48f} @section Compatibility with Ada 83 @@ -33487,7 +33499,7 @@ following subsections treat the most likely issues to be encountered. @end menu @node Legal Ada 83 programs that are illegal in Ada 95,More deterministic semantics,,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{48e}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{48f} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{490}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{491} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -33587,7 +33599,7 @@ the fix is usually simply to add the @code{(<>)} to the generic declaration. @end itemize @node More deterministic semantics,Changed semantics,Legal Ada 83 programs that are illegal in Ada 95,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{490}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{491} +@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{492}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{493} @subsection More deterministic semantics @@ -33615,7 +33627,7 @@ which open select branches are executed. @end itemize @node Changed semantics,Other language compatibility issues,More deterministic semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{492}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{493} +@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{494}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{495} @subsection Changed semantics @@ -33657,7 +33669,7 @@ covers only the restricted range. @end itemize @node Other language compatibility issues,,Changed semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{494}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{495} +@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{496}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{497} @subsection Other language compatibility issues @@ -33690,7 +33702,7 @@ include @code{pragma Interface} and the floating point type attributes @end itemize @node Compatibility between Ada 95 and Ada 2005,Implementation-dependent characteristics,Compatibility with Ada 83,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{496}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{497} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{498}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{499} @section Compatibility between Ada 95 and Ada 2005 @@ -33762,7 +33774,7 @@ can declare a function returning a value from an anonymous access type. @end itemize @node Implementation-dependent characteristics,Compatibility with Other Ada Systems,Compatibility between Ada 95 and Ada 2005,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{498}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{499} +@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{49a}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{49b} @section Implementation-dependent characteristics @@ -33785,7 +33797,7 @@ transition from certain Ada 83 compilers. @end menu @node Implementation-defined pragmas,Implementation-defined attributes,,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{49a}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{49b} +@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{49c}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{49d} @subsection Implementation-defined pragmas @@ -33807,7 +33819,7 @@ avoiding compiler rejection of units that contain such pragmas; they are not relevant in a GNAT context and hence are not otherwise implemented. @node Implementation-defined attributes,Libraries,Implementation-defined pragmas,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{49c}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{49d} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{49e}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{49f} @subsection Implementation-defined attributes @@ -33821,7 +33833,7 @@ Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and @code{Type_Class}. @node Libraries,Elaboration order,Implementation-defined attributes,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{49e}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{49f} +@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{4a0}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{4a1} @subsection Libraries @@ -33850,7 +33862,7 @@ be preferable to retrofit the application using modular types. @end itemize @node Elaboration order,Target-specific aspects,Libraries,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{4a0}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{4a1} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{4a2}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{4a3} @subsection Elaboration order @@ -33886,7 +33898,7 @@ pragmas either globally (as an effect of the `-gnatE' switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{4a2}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{4a3} +@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{4a4}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{4a5} @subsection Target-specific aspects @@ -33899,10 +33911,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005, Ada 2012, and Ada 2022) are sometimes incompatible with typical Ada 83 compiler practices regarding implicit packing, the meaning of the Size attribute, and the size of access values. -GNAT’s approach to these issues is described in @ref{4a4,,Representation Clauses}. +GNAT’s approach to these issues is described in @ref{4a6,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{4a5}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{4a6} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{4a7}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{4a8} @section Compatibility with Other Ada Systems @@ -33945,7 +33957,7 @@ far beyond this minimal set, as described in the next section. @end itemize @node Representation Clauses,Compatibility with HP Ada 83,Compatibility with Other Ada Systems,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{4a7}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{4a4} +@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{4a9}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{4a6} @section Representation Clauses @@ -34038,7 +34050,7 @@ with thin pointers. @end itemize @node Compatibility with HP Ada 83,,Representation Clauses,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{4a8}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{4a9} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{4aa}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{4ab} @section Compatibility with HP Ada 83 @@ -34068,7 +34080,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license doc}@anchor{4aa}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{4ab} +@anchor{share/gnu_free_documentation_license doc}@anchor{4ac}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{4ad} @chapter GNU Free Documentation License diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index edb04a20f418..712d46c54abb 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -250,6 +250,7 @@ package body Impunit is ("g-busorg", F), -- GNAT.Bubble_Sort_G ("g-byorma", F), -- GNAT.Byte_Order_Mark ("g-bytswa", F), -- GNAT.Byte_Swapping + ("g-c_time", F), -- GNAT.C_Time ("g-calend", F), -- GNAT.Calendar ("g-catiio", F), -- GNAT.Calendar.Time_IO ("g-casuti", F), -- GNAT.Case_Util diff --git a/gcc/ada/libgnarl/a-exetim__posix.adb b/gcc/ada/libgnarl/a-exetim__posix.adb index ee27ff29f156..a57689e0847d 100644 --- a/gcc/ada/libgnarl/a-exetim__posix.adb +++ b/gcc/ada/libgnarl/a-exetim__posix.adb @@ -34,8 +34,9 @@ with Ada.Task_Identification; use Ada.Task_Identification; with Ada.Unchecked_Conversion; -with System.Tasking; +with System.C_Time; with System.OS_Interface; use System.OS_Interface; +with System.Tasking; with System.Task_Primitives.Operations; use System.Task_Primitives.Operations; with Interfaces.C; use Interfaces.C; @@ -98,7 +99,7 @@ package body Ada.Execution_Time is (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time is - TS : aliased timespec; + TS : aliased System.C_Time.timespec; Clock_Id : aliased Interfaces.C.int; Result : Interfaces.C.int; @@ -112,7 +113,7 @@ package body Ada.Execution_Time is function clock_gettime (clock_id : Interfaces.C.int; - tp : access timespec) + tp : access System.C_Time.timespec) return Interfaces.C.int; pragma Import (C, clock_gettime, "clock_gettime"); -- Function from the POSIX.1b Realtime Extensions library @@ -139,7 +140,7 @@ package body Ada.Execution_Time is (clock_id => Clock_Id, tp => TS'Unchecked_Access); pragma Assert (Result = 0); - return To_CPU_Time (To_Duration (TS)); + return To_CPU_Time (System.C_Time.To_Duration (TS)); end Clock; -------------------------- diff --git a/gcc/ada/libgnarl/s-linux.ads b/gcc/ada/libgnarl/s-linux.ads index 62176f1bd968..f41a67bd8a3a 100644 --- a/gcc/ada/libgnarl/s-linux.ads +++ b/gcc/ada/libgnarl/s-linux.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__alpha.ads b/gcc/ada/libgnarl/s-linux__alpha.ads index 855e6672e365..c05b90c04cb7 100644 --- a/gcc/ada/libgnarl/s-linux__alpha.ads +++ b/gcc/ada/libgnarl/s-linux__alpha.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__android-aarch64.ads b/gcc/ada/libgnarl/s-linux__android-aarch64.ads index 537c46b5d3cc..c7a69fa29c01 100644 --- a/gcc/ada/libgnarl/s-linux__android-aarch64.ads +++ b/gcc/ada/libgnarl/s-linux__android-aarch64.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__android-arm.ads b/gcc/ada/libgnarl/s-linux__android-arm.ads index 07bca55f6c47..fdc14c387fb9 100644 --- a/gcc/ada/libgnarl/s-linux__android-arm.ads +++ b/gcc/ada/libgnarl/s-linux__android-arm.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__hppa.ads b/gcc/ada/libgnarl/s-linux__hppa.ads index a3ce02bcb6e7..e249846cd302 100644 --- a/gcc/ada/libgnarl/s-linux__hppa.ads +++ b/gcc/ada/libgnarl/s-linux__hppa.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__loongarch.ads b/gcc/ada/libgnarl/s-linux__loongarch.ads index e0eaaa47e71d..20e3d909c0e0 100644 --- a/gcc/ada/libgnarl/s-linux__loongarch.ads +++ b/gcc/ada/libgnarl/s-linux__loongarch.ads @@ -35,7 +35,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -44,25 +43,8 @@ package System.Linux is -- Time -- ---------- - subtype int is Interfaces.C.int; - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__mips.ads b/gcc/ada/libgnarl/s-linux__mips.ads index 3ad7f45379eb..6a575c7a865e 100644 --- a/gcc/ada/libgnarl/s-linux__mips.ads +++ b/gcc/ada/libgnarl/s-linux__mips.ads @@ -35,7 +35,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -44,25 +43,8 @@ package System.Linux is -- Time -- ---------- - subtype int is Interfaces.C.int; - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- @@ -125,8 +107,8 @@ package System.Linux is -- struct_sigaction offsets - sa_handler_pos : constant := int'Size / 8; - sa_mask_pos : constant := int'Size / 8 + + sa_handler_pos : constant := Interfaces.C.int'Size / 8; + sa_mask_pos : constant := Interfaces.C.int'Size / 8 + Standard'Address_Size / 8; sa_flags_pos : constant := 0; diff --git a/gcc/ada/libgnarl/s-linux__riscv.ads b/gcc/ada/libgnarl/s-linux__riscv.ads index 867cb1fa8070..ad0a07b8c506 100644 --- a/gcc/ada/libgnarl/s-linux__riscv.ads +++ b/gcc/ada/libgnarl/s-linux__riscv.ads @@ -35,7 +35,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -44,25 +43,8 @@ package System.Linux is -- Time -- ---------- - subtype int is Interfaces.C.int; - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- @@ -125,8 +107,8 @@ package System.Linux is -- struct_sigaction offsets sa_handler_pos : constant := 0; - sa_mask_pos : constant := long'Size / 8; - sa_flags_pos : constant := long'Size / 8 + 128; + sa_mask_pos : constant := Interfaces.C.long'Size / 8; + sa_flags_pos : constant := Interfaces.C.long'Size / 8 + 128; SA_SIGINFO : constant := 16#04#; SA_ONSTACK : constant := 16#08000000#; diff --git a/gcc/ada/libgnarl/s-linux__sparc.ads b/gcc/ada/libgnarl/s-linux__sparc.ads index 5ff201cf832c..037834617d72 100644 --- a/gcc/ada/libgnarl/s-linux__sparc.ads +++ b/gcc/ada/libgnarl/s-linux__sparc.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__x32.ads b/gcc/ada/libgnarl/s-linux__x32.ads deleted file mode 100644 index 6144b8b34ce1..000000000000 --- a/gcc/ada/libgnarl/s-linux__x32.ads +++ /dev/null @@ -1,133 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . L I N U X -- --- -- --- S p e c -- --- -- --- Copyright (C) 2013-2025, Free Software Foundation, Inc. -- --- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- . -- --- -- --- -- ------------------------------------------------------------------------------- - --- This is the x32 version of this package - --- This package encapsulates cpu specific differences between implementations --- of GNU/Linux, in order to share s-osinte-linux.ads. - --- PLEASE DO NOT add any with-clauses to this package or remove the pragma --- Preelaborate. This package is designed to be a bottom-level (leaf) package - -with Interfaces.C; - -with System.Parameters; - -package System.Linux is - pragma Preelaborate; - - ---------- - -- Time -- - ---------- - - subtype suseconds_t is Long_Long_Integer; - -- Note that suseconds_t is 64 bits. - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - subtype clockid_t is Interfaces.C.int; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Long_Integer; - -- Note that tv_nsec is 64 bits. - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - - ----------- - -- Errno -- - ----------- - - EAGAIN : constant := 11; - EINTR : constant := 4; - EINVAL : constant := 22; - ENOMEM : constant := 12; - EPERM : constant := 1; - ETIMEDOUT : constant := 110; - - ------------- - -- Signals -- - ------------- - - SIGHUP : constant := 1; -- hangup - SIGINT : constant := 2; -- interrupt (rubout) - SIGQUIT : constant := 3; -- quit (ASCD FS) - SIGILL : constant := 4; -- illegal instruction (not reset) - SIGTRAP : constant := 5; -- trace trap (not reset) - SIGIOT : constant := 6; -- IOT instruction - SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future - SIGFPE : constant := 8; -- floating point exception - SIGKILL : constant := 9; -- kill (cannot be caught or ignored) - SIGBUS : constant := 7; -- bus error - SIGUSR1 : constant := 10; -- user defined signal 1 - SIGSEGV : constant := 11; -- segmentation violation - SIGUSR2 : constant := 12; -- user defined signal 2 - SIGPIPE : constant := 13; -- write on a pipe with no one to read it - SIGALRM : constant := 14; -- alarm clock - SIGTERM : constant := 15; -- software termination signal from kill - SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux) - SIGCLD : constant := 17; -- alias for SIGCHLD - SIGCHLD : constant := 17; -- child status change - SIGSTOP : constant := 19; -- stop (cannot be caught or ignored) - SIGTSTP : constant := 20; -- user stop requested from tty - SIGCONT : constant := 18; -- stopped process has been continued - SIGTTIN : constant := 21; -- background tty read attempted - SIGTTOU : constant := 22; -- background tty write attempted - SIGURG : constant := 23; -- urgent condition on IO channel - SIGXCPU : constant := 24; -- CPU time limit exceeded - SIGXFSZ : constant := 25; -- filesize limit exceeded - SIGVTALRM : constant := 26; -- virtual timer expired - SIGPROF : constant := 27; -- profiling timer expired - SIGWINCH : constant := 28; -- window size change - SIGPOLL : constant := 29; -- pollable event occurred - SIGIO : constant := 29; -- I/O now possible (4.2 BSD) - SIGLOST : constant := 29; -- File lock lost - SIGPWR : constant := 30; -- power-fail restart - SIGSYS : constant := 31; -- bad system call - SIGUNUSED : constant := 31; -- unused signal (mapped to SIGSYS) - SIG32 : constant := 32; -- glibc internal signal - SIG33 : constant := 33; -- glibc internal signal - SIG34 : constant := 34; -- glibc internal signal - - -- struct_sigaction offsets - - sa_handler_pos : constant := 0; - sa_mask_pos : constant := Standard'Address_Size / 8; - sa_flags_pos : constant := 128 + sa_mask_pos; - - SA_SIGINFO : constant := 16#04#; - SA_ONSTACK : constant := 16#08000000#; - -end System.Linux; diff --git a/gcc/ada/libgnarl/s-osinte__aix.adb b/gcc/ada/libgnarl/s-osinte__aix.adb index da057d47cf5b..3a2df424d91b 100644 --- a/gcc/ada/libgnarl/s-osinte__aix.adb +++ b/gcc/ada/libgnarl/s-osinte__aix.adb @@ -35,15 +35,6 @@ package body System.OS_Interface is use Interfaces.C; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -72,29 +63,6 @@ package body System.OS_Interface is end if; end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F is negative due to a round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- sched_yield -- ----------------- diff --git a/gcc/ada/libgnarl/s-osinte__aix.ads b/gcc/ada/libgnarl/s-osinte__aix.ads index 1e115b80d6fb..eb417a2cc999 100644 --- a/gcc/ada/libgnarl/s-osinte__aix.ads +++ b/gcc/ada/libgnarl/s-osinte__aix.ads @@ -43,8 +43,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; with Interfaces.C.Extensions; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -200,26 +200,18 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new long_long; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -420,7 +412,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -543,15 +535,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_attr_t is new System.Address; pragma Convention (C, pthread_attr_t); -- typedef struct __pt_attr *pthread_attr_t; diff --git a/gcc/ada/libgnarl/s-osinte__android.ads b/gcc/ada/libgnarl/s-osinte__android.ads index 4383860ed2b1..bf774fc491af 100644 --- a/gcc/ada/libgnarl/s-osinte__android.ads +++ b/gcc/ada/libgnarl/s-osinte__android.ads @@ -42,10 +42,10 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Linux; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -213,25 +213,17 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -463,7 +455,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -630,15 +622,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type unsigned_long_long_t is mod 2 ** 64; -- Local type only used to get the alignment of this type below diff --git a/gcc/ada/libgnarl/s-osinte__cheribsd.ads b/gcc/ada/libgnarl/s-osinte__cheribsd.ads index d9dae354d41e..350fa1f15ad9 100644 --- a/gcc/ada/libgnarl/s-osinte__cheribsd.ads +++ b/gcc/ada/libgnarl/s-osinte__cheribsd.ads @@ -44,8 +44,8 @@ with Ada.Unchecked_Conversion; with Interfaces; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -232,30 +232,22 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -463,7 +455,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -664,15 +656,6 @@ private Self_PID : constant pid_t := 0; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_t is new System.Address; type pthread_attr_t is new System.Address; type pthread_mutexattr_t is new System.Address; diff --git a/gcc/ada/libgnarl/s-osinte__darwin.adb b/gcc/ada/libgnarl/s-osinte__darwin.adb index f512210d3437..eeafbdbef8f1 100644 --- a/gcc/ada/libgnarl/s-osinte__darwin.adb +++ b/gcc/ada/libgnarl/s-osinte__darwin.adb @@ -36,15 +36,6 @@ with Interfaces.C.Extensions; package body System.OS_Interface is use Interfaces.C; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -56,37 +47,13 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------------- -- clock_gettime -- ------------------- function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int + tp : access C_Time.timespec) return int is pragma Unreferenced (clock_id); @@ -94,33 +61,18 @@ package body System.OS_Interface is use Interfaces; - type timeval is array (1 .. 3) of C.long; - -- The timeval array is sized to contain long_long sec and long usec. - -- If long_long'Size = long'Size then it will be overly large but that - -- won't effect the implementation since it's not accessed directly. - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access C.Extensions.long_long; - usec : not null access C.long); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased C.Extensions.long_long; - usec : aliased C.long; - TV : aliased timeval; + TV : aliased C_Time.timeval; Result : int; function gettimeofday - (Tv : access timeval; + (Tv : access C_Time.timeval; Tz : System.Address := System.Null_Address) return int; pragma Import (C, gettimeofday, "gettimeofday"); begin Result := gettimeofday (TV'Access, System.Null_Address); pragma Assert (Result = 0); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - tp.all := To_Timespec (Duration (sec) + Duration (usec) / Micro); + tp.all := C_Time.To_Timespec (TV); return Result; end clock_gettime; @@ -130,13 +82,12 @@ package body System.OS_Interface is function clock_getres (clock_id : clockid_t; - res : access timespec) return int + res : access C_Time.timespec) return int is pragma Unreferenced (clock_id); -- Darwin Threads don't have clock_getres. - Nano : constant := 10**9; nsec : int := 0; Result : int := -1; @@ -145,7 +96,7 @@ package body System.OS_Interface is begin nsec := clock_get_res; - res.all := To_Timespec (Duration (0.0) + Duration (nsec) / Nano); + res.all := C_Time.Nanoseconds_To_Timespec (nsec); if nsec > 0 then Result := 0; diff --git a/gcc/ada/libgnarl/s-osinte__darwin.ads b/gcc/ada/libgnarl/s-osinte__darwin.ads index ea62f24cbc0d..1b2a40b3cbe8 100644 --- a/gcc/ada/libgnarl/s-osinte__darwin.ads +++ b/gcc/ada/libgnarl/s-osinte__darwin.ads @@ -40,9 +40,9 @@ with Interfaces.C; +with System.C_Time; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -184,23 +184,15 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; - - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); + res : access C_Time.timespec) return int; ------------------------- -- Priority Scheduling -- @@ -397,7 +389,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -517,15 +509,6 @@ private type pid_t is new int32_t; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - -- -- Darwin specific signal implementation -- diff --git a/gcc/ada/libgnarl/s-osinte__dragonfly.adb b/gcc/ada/libgnarl/s-osinte__dragonfly.adb index 73061d9eeb0c..adfbaeb27fc7 100644 --- a/gcc/ada/libgnarl/s-osinte__dragonfly.adb +++ b/gcc/ada/libgnarl/s-osinte__dragonfly.adb @@ -69,15 +69,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -89,28 +80,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(ts_sec => S, - ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__dragonfly.ads b/gcc/ada/libgnarl/s-osinte__dragonfly.ads index 00dc11de2745..9e7b88e3c6e9 100644 --- a/gcc/ada/libgnarl/s-osinte__dragonfly.ads +++ b/gcc/ada/libgnarl/s-osinte__dragonfly.ads @@ -43,8 +43,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -198,30 +198,22 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new unsigned_long; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -432,7 +424,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); Relative_Timed_Wait : constant Boolean := False; @@ -636,15 +628,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_t is new System.Address; type pthread_attr_t is new System.Address; type pthread_mutexattr_t is new System.Address; diff --git a/gcc/ada/libgnarl/s-osinte__freebsd.adb b/gcc/ada/libgnarl/s-osinte__freebsd.adb index a3240bb38d18..4516935bbc8e 100644 --- a/gcc/ada/libgnarl/s-osinte__freebsd.adb +++ b/gcc/ada/libgnarl/s-osinte__freebsd.adb @@ -69,15 +69,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -89,27 +80,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(ts_sec => S, - ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__freebsd.ads b/gcc/ada/libgnarl/s-osinte__freebsd.ads index b10270a4cc49..027f81d060bf 100644 --- a/gcc/ada/libgnarl/s-osinte__freebsd.ads +++ b/gcc/ada/libgnarl/s-osinte__freebsd.ads @@ -43,8 +43,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -198,30 +198,22 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -431,7 +423,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -633,15 +625,6 @@ private type pid_t is new int; Self_PID : constant pid_t := 0; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_t is new System.Address; type pthread_attr_t is new System.Address; type pthread_mutexattr_t is new System.Address; diff --git a/gcc/ada/libgnarl/s-osinte__gnu.adb b/gcc/ada/libgnarl/s-osinte__gnu.adb index 675cd0d93990..2c70f0dea157 100644 --- a/gcc/ada/libgnarl/s-osinte__gnu.adb +++ b/gcc/ada/libgnarl/s-osinte__gnu.adb @@ -93,15 +93,6 @@ package body System.OS_Interface is return 0; end pthread_setschedparam; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -113,28 +104,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__gnu.ads b/gcc/ada/libgnarl/s-osinte__gnu.ads index 870059d09670..18410c60415e 100644 --- a/gcc/ada/libgnarl/s-osinte__gnu.ads +++ b/gcc/ada/libgnarl/s-osinte__gnu.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -210,9 +210,7 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; @@ -221,21 +219,15 @@ package System.OS_Interface is -- From: /usr/include/time.h function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - -- From: /usr/include/unistd.h function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -487,7 +479,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); Relative_Timed_Wait : constant Boolean := False; @@ -656,15 +648,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - -- From: /usr/include/pthread/pthreadtypes.h: -- typedef struct __pthread_attr pthread_attr_t; -- /usr/include/i386-gnu/bits/thread-attr.h: struct __pthread_attr... diff --git a/gcc/ada/libgnarl/s-osinte__hpux.ads b/gcc/ada/libgnarl/s-osinte__hpux.ads index 9d0f26d50f70..60fab698113b 100644 --- a/gcc/ada/libgnarl/s-osinte__hpux.ads +++ b/gcc/ada/libgnarl/s-osinte__hpux.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -181,26 +181,18 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -400,7 +392,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -517,15 +509,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_attr_t is new int; type pthread_condattr_t is new int; type pthread_mutexattr_t is new int; diff --git a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads index 9924659cce5d..fc6d7a992f19 100644 --- a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads +++ b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -205,9 +205,7 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; @@ -215,21 +213,15 @@ package System.OS_Interface is function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -430,7 +422,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -602,15 +594,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_attr_t is record detachstate : int; schedpolicy : int; diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads index 7aeb15da523b..2c6b353a5e0f 100644 --- a/gcc/ada/libgnarl/s-osinte__linux.ads +++ b/gcc/ada/libgnarl/s-osinte__linux.ads @@ -42,6 +42,7 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Linux; with System.OS_Constants; with System.OS_Locks; @@ -54,8 +55,6 @@ package System.OS_Interface is pragma Linker_Options ("-lpthread"); - use type System.Linux.time_t; - subtype int is Interfaces.C.int; subtype char is Interfaces.C.char; subtype short is Interfaces.C.short; @@ -229,26 +228,17 @@ package System.OS_Interface is -- Time -- ---------- - subtype time_t is System.Linux.time_t; - subtype timespec is System.Linux.timespec; - subtype timeval is System.Linux.timeval; subtype clockid_t is System.Linux.clockid_t; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -457,7 +447,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- diff --git a/gcc/ada/libgnarl/s-osinte__lynxos178.adb b/gcc/ada/libgnarl/s-osinte__lynxos178.adb index 88758a954f8a..beeefb617fe9 100644 --- a/gcc/ada/libgnarl/s-osinte__lynxos178.adb +++ b/gcc/ada/libgnarl/s-osinte__lynxos178.adb @@ -85,15 +85,6 @@ package body System.OS_Interface is return int (sysconf (SC_PAGESIZE)); end Get_Page_Size; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -105,29 +96,6 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F is negative due to a round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------- -- sigwait -- ------------- diff --git a/gcc/ada/libgnarl/s-osinte__lynxos178e.ads b/gcc/ada/libgnarl/s-osinte__lynxos178e.ads index 8b31e204acb5..dcc36b251857 100644 --- a/gcc/ada/libgnarl/s-osinte__lynxos178e.ads +++ b/gcc/ada/libgnarl/s-osinte__lynxos178e.ads @@ -42,9 +42,9 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Multiprocessors; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -193,26 +193,18 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -220,8 +212,6 @@ package System.OS_Interface is pragma Convention (C, struct_timezone); type struct_timezone_ptr is access all struct_timezone; - type struct_timeval is private; - ------------------------- -- Priority Scheduling -- ------------------------- @@ -415,7 +405,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -541,23 +531,6 @@ private type pid_t is new long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type suseconds_t is new int; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type struct_timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, struct_timeval); - type st_attr is record stksize : int; prio : int; diff --git a/gcc/ada/libgnarl/s-osinte__posix.adb b/gcc/ada/libgnarl/s-osinte__posix.adb index 1cb4f23aec6e..2d9baeb7f363 100644 --- a/gcc/ada/libgnarl/s-osinte__posix.adb +++ b/gcc/ada/libgnarl/s-osinte__posix.adb @@ -36,6 +36,7 @@ -- that are needed by children of System. with Interfaces.C; use Interfaces.C; + package body System.OS_Interface is -------------------- @@ -58,15 +59,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -78,28 +70,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__qnx.adb b/gcc/ada/libgnarl/s-osinte__qnx.adb index 720022548df1..bf95b0eab34f 100644 --- a/gcc/ada/libgnarl/s-osinte__qnx.adb +++ b/gcc/ada/libgnarl/s-osinte__qnx.adb @@ -36,6 +36,7 @@ -- that are needed by children of System. with Interfaces.C; use Interfaces.C; + package body System.OS_Interface is ----------------- @@ -70,15 +71,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -90,28 +82,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__qnx.ads b/gcc/ada/libgnarl/s-osinte__qnx.ads index ea940d86330d..ee13235d891b 100644 --- a/gcc/ada/libgnarl/s-osinte__qnx.ads +++ b/gcc/ada/libgnarl/s-osinte__qnx.ads @@ -41,9 +41,9 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -213,25 +213,17 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - ------------------------- -- Priority Scheduling -- ------------------------- @@ -418,7 +410,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -572,15 +564,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type unsigned_long_long_t is mod 2 ** 64; -- Local type only used to get the alignment of this type below diff --git a/gcc/ada/libgnarl/s-osinte__rtems.adb b/gcc/ada/libgnarl/s-osinte__rtems.adb index c0f6c265b509..efd602e73f82 100644 --- a/gcc/ada/libgnarl/s-osinte__rtems.adb +++ b/gcc/ada/libgnarl/s-osinte__rtems.adb @@ -92,15 +92,6 @@ package body System.OS_Interface is return int with Import, External_Name => "rtems_semaphore_release", Convention => C; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -112,27 +103,6 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------------------- -- Binary_Semaphore_Create -- ----------------------------- diff --git a/gcc/ada/libgnarl/s-osinte__rtems.ads b/gcc/ada/libgnarl/s-osinte__rtems.ads index 21b1be8a306a..184d48978364 100644 --- a/gcc/ada/libgnarl/s-osinte__rtems.ads +++ b/gcc/ada/libgnarl/s-osinte__rtems.ads @@ -52,9 +52,9 @@ with Interfaces.C; +with System.C_Time; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -181,8 +181,6 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - type clockid_t is new int; CLOCK_REALTIME : constant clockid_t; @@ -190,20 +188,14 @@ package System.OS_Interface is function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - ------------------------- -- Priority Scheduling -- ------------------------- @@ -428,7 +420,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -454,8 +446,8 @@ package System.OS_Interface is type struct_sched_param is record sched_priority : int; ss_low_priority : int; - ss_replenish_period : timespec; - ss_initial_budget : timespec; + ss_replenish_period : C_Time.timespec; + ss_initial_budget : C_Time.timespec; sched_ss_max_repl : int; end record; pragma Convention (C, struct_sched_param); @@ -591,15 +583,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - CLOCK_REALTIME : constant clockid_t := System.OS_Constants.CLOCK_REALTIME; CLOCK_MONOTONIC : constant clockid_t := System.OS_Constants.CLOCK_MONOTONIC; diff --git a/gcc/ada/libgnarl/s-osinte__solaris.adb b/gcc/ada/libgnarl/s-osinte__solaris.adb index e5626fc4f0d8..78144efdbcdb 100644 --- a/gcc/ada/libgnarl/s-osinte__solaris.adb +++ b/gcc/ada/libgnarl/s-osinte__solaris.adb @@ -35,42 +35,8 @@ -- This package encapsulates all direct interfaces to OS services -- that are needed by children of System. -with Interfaces.C; use Interfaces.C; - package body System.OS_Interface is - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------------ -- pthread_init -- ------------------ diff --git a/gcc/ada/libgnarl/s-osinte__solaris.ads b/gcc/ada/libgnarl/s-osinte__solaris.ads index d62dd37110eb..e9b59fe1ca92 100644 --- a/gcc/ada/libgnarl/s-osinte__solaris.ads +++ b/gcc/ada/libgnarl/s-osinte__solaris.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -241,24 +241,16 @@ package System.OS_Interface is -- Time -- ---------- - type timespec is private; - type clockid_t is new int; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres - (clock_id : clockid_t; res : access timespec) return int; + (clock_id : clockid_t; res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -347,7 +339,7 @@ package System.OS_Interface is function cond_timedwait (cond : access cond_t; mutex : access mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, cond_timedwait, "cond_timedwait"); function cond_signal (cond : access cond_t) return int; @@ -526,15 +518,6 @@ private type pid_t is new long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type array_type_9 is array (0 .. 3) of unsigned_char; type record_type_3 is record flag : array_type_9; diff --git a/gcc/ada/libgnarl/s-osinte__vxworks.adb b/gcc/ada/libgnarl/s-osinte__vxworks.adb index 5c227a1e54c8..0b2b5d442698 100644 --- a/gcc/ada/libgnarl/s-osinte__vxworks.adb +++ b/gcc/ada/libgnarl/s-osinte__vxworks.adb @@ -41,38 +41,6 @@ package body System.OS_Interface is Low_Priority : constant := 255; -- VxWorks native (default) lowest scheduling priority - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; - end To_Duration; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F is negative due to a round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(ts_sec => S, - ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------------------- -- To_VxWorks_Priority -- ------------------------- diff --git a/gcc/ada/libgnarl/s-osinte__vxworks.ads b/gcc/ada/libgnarl/s-osinte__vxworks.ads index a4095735bd6d..ecb63440a5db 100644 --- a/gcc/ada/libgnarl/s-osinte__vxworks.ads +++ b/gcc/ada/libgnarl/s-osinte__vxworks.ads @@ -40,10 +40,10 @@ with Interfaces.C; +with System.C_Time; with System.VxWorks; with System.VxWorks.Ext; with System.Multiprocessors; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -244,37 +244,13 @@ package System.OS_Interface is -- Time -- ---------- - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - -- Time_t here used to be unsigned to match the VxWorks header declaration. - -- The header declaration has changed in newer releases and is now signed - -- for applications. - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type clockid_t is new int; - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - -- Convert a Duration value to a timespec value. Note that in VxWorks, - -- timespec is always non-negative (since time_t is defined above as - -- unsigned long). This means that there is a potential problem if a - -- negative argument is passed for D. However, in actual usage, the - -- value of the input argument D is always non-negative, so no problem - -- arises in practice. - function To_Clock_Ticks (D : Duration) return int; -- Convert a duration value (in seconds) into clock ticks function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); ---------------------- diff --git a/gcc/ada/libgnarl/s-osinte__x32.adb b/gcc/ada/libgnarl/s-osinte__x32.adb index 27313a4bcc07..2e6585352d3d 100644 --- a/gcc/ada/libgnarl/s-osinte__x32.adb +++ b/gcc/ada/libgnarl/s-osinte__x32.adb @@ -35,7 +35,7 @@ -- This package encapsulates all direct interfaces to OS services -- that are needed by children of System. -with Interfaces.C; use Interfaces.C; +with Interfaces.C; package body System.OS_Interface is @@ -59,15 +59,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -79,28 +70,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => Long_Long_Integer (F * 10#1#E9)); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-qnx.ads b/gcc/ada/libgnarl/s-qnx.ads index 1197be15ef6c..f342ad673056 100644 --- a/gcc/ada/libgnarl/s-qnx.ads +++ b/gcc/ada/libgnarl/s-qnx.ads @@ -37,8 +37,6 @@ with Interfaces.C; -with System.Parameters; - package System.QNX is pragma Preelaborate; @@ -46,24 +44,8 @@ package System.QNX is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-taprop__solaris.adb b/gcc/ada/libgnarl/s-taprop__solaris.adb index 8edc58ea9d80..1b65100362c4 100644 --- a/gcc/ada/libgnarl/s-taprop__solaris.adb +++ b/gcc/ada/libgnarl/s-taprop__solaris.adb @@ -36,6 +36,7 @@ with Interfaces.C; +with System.C_Time; with System.Interrupt_Management; with System.Multiprocessors; with System.OS_Constants; @@ -762,12 +763,12 @@ package body System.Task_Primitives.Operations is --------------------- function Monotonic_Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_gettime (OSC.CLOCK_RT_Ada, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end Monotonic_Clock; ------------------- @@ -775,13 +776,13 @@ package body System.Task_Primitives.Operations is ------------------- function RT_Resolution return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_getres (OSC.CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end RT_Resolution; ----------- @@ -1175,7 +1176,7 @@ package body System.Task_Primitives.Operations is Base_Time : constant Duration := Monotonic_Clock; Check_Time : Duration := Base_Time; Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; begin @@ -1189,7 +1190,7 @@ package body System.Task_Primitives.Operations is else Duration'Min (Check_Time + Max_Sensible_Delay, Time)); if Abs_Time > Check_Time then - Request := To_Timespec (Abs_Time); + Request := C_Time.To_Timespec (Abs_Time); loop exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; @@ -1230,7 +1231,7 @@ package body System.Task_Primitives.Operations is Base_Time : constant Duration := Monotonic_Clock; Check_Time : Duration := Base_Time; Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; Yielded : Boolean := False; @@ -1243,7 +1244,7 @@ package body System.Task_Primitives.Operations is else Duration'Min (Check_Time + Max_Sensible_Delay, Time)); if Abs_Time > Check_Time then - Request := To_Timespec (Abs_Time); + Request := C_Time.To_Timespec (Abs_Time); Self_ID.Common.State := Delay_Sleep; pragma Assert (Check_Sleep (Delay_Sleep)); diff --git a/gcc/ada/libgnarl/s-taprop__vxworks.adb b/gcc/ada/libgnarl/s-taprop__vxworks.adb index a0f1885a7e8d..a4dab5fa9d1e 100644 --- a/gcc/ada/libgnarl/s-taprop__vxworks.adb +++ b/gcc/ada/libgnarl/s-taprop__vxworks.adb @@ -38,6 +38,7 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Float_Control; with System.Interrupt_Management; with System.Multiprocessors; @@ -681,12 +682,12 @@ package body System.Task_Primitives.Operations is --------------------- function Monotonic_Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : int; begin Result := clock_gettime (OSC.CLOCK_RT_Ada, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end Monotonic_Clock; ------------------- diff --git a/gcc/ada/libgnarl/s-tpopmo.adb b/gcc/ada/libgnarl/s-tpopmo.adb index 9ff1ecdc329f..547a5e44abcd 100644 --- a/gcc/ada/libgnarl/s-tpopmo.adb +++ b/gcc/ada/libgnarl/s-tpopmo.adb @@ -31,6 +31,8 @@ -- This is the Monotonic version of this package for Posix and Linux targets. +with System.C_Time; + separate (System.Task_Primitives.Operations) package body Monotonic is @@ -54,14 +56,14 @@ package body Monotonic is --------------------- function Monotonic_Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_gettime (clock_id => OSC.CLOCK_RT_Ada, tp => TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end Monotonic_Clock; ------------------- @@ -69,14 +71,14 @@ package body Monotonic is ------------------- function RT_Resolution return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_getres (OSC.CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end RT_Resolution; ---------------------- @@ -150,7 +152,7 @@ package body Monotonic is Abs_Time : Duration; P_Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; Exit_Outer : Boolean := False; @@ -184,7 +186,7 @@ package body Monotonic is end if; pragma Warnings (On); - Request := To_Timespec (P_Abs_Time); + Request := C_Time.To_Timespec (P_Abs_Time); Inner : loop exit Outer @@ -236,7 +238,7 @@ package body Monotonic is Check_Time : Duration; Abs_Time : Duration; P_Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; Exit_Outer : Boolean := False; @@ -271,7 +273,7 @@ package body Monotonic is end if; pragma Warnings (On); - Request := To_Timespec (P_Abs_Time); + Request := C_Time.To_Timespec (P_Abs_Time); Inner : loop exit Outer diff --git a/gcc/ada/libgnarl/s-osinte__android.adb b/gcc/ada/libgnat/g-c_time.ads similarity index 59% rename from gcc/ada/libgnarl/s-osinte__android.adb rename to gcc/ada/libgnat/g-c_time.ads index 3e36d284c918..02461955b2f4 100644 --- a/gcc/ada/libgnarl/s-osinte__android.adb +++ b/gcc/ada/libgnat/g-c_time.ads @@ -1,12 +1,12 @@ ------------------------------------------------------------------------------ -- -- --- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- GNAT RUN-TIME COMPONENTS -- -- -- --- S Y S T E M . O S _ I N T E R F A C E -- +-- G N A T . C _ T I M E -- -- -- --- B o d y -- +-- S p e c -- -- -- --- Copyright (C) 1995-2025, AdaCore -- +-- Copyright (C) 2025, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -24,51 +24,15 @@ -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- . -- -- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ --- This is an Android version of this package. +-- This package provides the time_t, timeval and timespec types corresponding +-- to the C types defined by the OS, as well as various conversion functions. --- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +-- See file s-c_time.ads for full documentation of the interface -with Interfaces.C; use Interfaces.C; - -package body System.OS_Interface is - - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - -end System.OS_Interface; +with System.C_Time; +package GNAT.C_Time renames System.C_Time; diff --git a/gcc/ada/libgnat/g-calend.adb b/gcc/ada/libgnat/g-calend.adb index a2bc77c1cc7b..80b62b7547f5 100644 --- a/gcc/ada/libgnat/g-calend.adb +++ b/gcc/ada/libgnat/g-calend.adb @@ -29,11 +29,8 @@ -- -- ------------------------------------------------------------------------------ -with Interfaces.C.Extensions; - package body GNAT.Calendar is use Ada.Calendar; - use Interfaces; ----------------- -- Day_In_Year -- @@ -333,25 +330,8 @@ package body GNAT.Calendar is ----------------- function To_Duration (T : not null access timeval) return Duration is - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access C.Extensions.long_long; - usec : not null access C.long); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased C.Extensions.long_long; - usec : aliased C.long; - - pragma Unsuppress (Overflow_Check); - begin - timeval_to_duration (T, sec'Access, usec'Access); - pragma Annotate (CodePeer, Modified, sec); - pragma Annotate (CodePeer, Modified, usec); - - return Duration (sec) + Duration (usec) / Micro; + return System.C_Time.To_Duration (T.all); end To_Duration; ---------------- @@ -359,45 +339,8 @@ package body GNAT.Calendar is ---------------- function To_Timeval (D : Duration) return timeval is - - procedure duration_to_timeval - (Sec : C.Extensions.long_long; - Usec : C.long; - T : not null access timeval); - pragma Import (C, duration_to_timeval, "__gnat_duration_to_timeval"); - - Micro : constant := 10**6; - Result : aliased timeval; - sec : C.Extensions.long_long; - usec : C.long; - - pragma Unsuppress (Overflow_Check); - begin - if D = 0.0 then - sec := 0; - usec := 0; - - elsif D < 0.0 then - sec := C.Extensions.long_long (D + 0.5); - if D = Duration (sec) then - usec := 0; - else - usec := C.long ((D - Duration (sec)) * Micro + 0.5); - end if; - - else - sec := C.Extensions.long_long (D - 0.5); - if D = Duration (sec) then - usec := 0; - else - usec := C.long ((D - Duration (sec)) * Micro - 0.5); - end if; - end if; - - duration_to_timeval (sec, usec, Result'Access); - - return Result; + return System.C_Time.To_Timeval (D); end To_Timeval; ------------------ diff --git a/gcc/ada/libgnat/g-calend.ads b/gcc/ada/libgnat/g-calend.ads index a3294993aa6d..c57b7df7a220 100644 --- a/gcc/ada/libgnat/g-calend.ads +++ b/gcc/ada/libgnat/g-calend.ads @@ -40,7 +40,8 @@ -- Day_Of_Week, Day_In_Year and Week_In_Year. with Ada.Calendar.Formatting; -with Interfaces.C; + +with System.C_Time; package GNAT.Calendar is @@ -126,7 +127,7 @@ package GNAT.Calendar is -- locale (equivalent to Clock). Due to this simplified behavior, the -- implementation does not require expensive system calls on targets such -- as Windows. - -- WARNING: Split_At_Locale is no longer aware of historic events and may + -- WARNING: Time_At_Locale is no longer aware of historic events and may -- produce inaccurate results over DST changes which occurred in the past. function Week_In_Year (Date : Ada.Calendar.Time) return Week_In_Year_Number; @@ -145,24 +146,18 @@ package GNAT.Calendar is -- Return the week number as defined in ISO 8601 along with the year in -- which the week occurs. - -- C timeval conversion - - -- C timeval represent a duration (used in Select for example). This - -- structure is composed of a number of seconds and a number of micro - -- seconds. The timeval structure is not exposed here because its - -- definition is target dependent. Interface to C programs is done via a - -- pointer to timeval structure. - - type timeval is private; + subtype timeval is System.C_Time.timeval; + pragma Obsolescent (timeval, "use type from GNAT.C_Time instead"); function To_Duration (T : not null access timeval) return Duration; + pragma Inline (To_Duration); + pragma Obsolescent (To_Duration, "use function from GNAT.C_Time instead"); + function To_Timeval (D : Duration) return timeval; + pragma Inline (To_Timeval); + pragma Obsolescent (To_Timeval, "use function from GNAT.C_Time instead"); private - -- This is a dummy declaration that should be the largest possible timeval - -- structure of all supported targets. - - type timeval is array (1 .. 3) of Interfaces.C.long; function Julian_Day (Year : Ada.Calendar.Year_Number; diff --git a/gcc/ada/libgnat/g-socket.adb b/gcc/ada/libgnat/g-socket.adb index 303640f7fcca..37232ec031c0 100644 --- a/gcc/ada/libgnat/g-socket.adb +++ b/gcc/ada/libgnat/g-socket.adb @@ -47,6 +47,7 @@ with GNAT.Sockets.Poll; with System; use System; with System.Communication; use System.Communication; with System.CRTL; use System.CRTL; +with System.C_Time; with System.Task_Lock; package body GNAT.Sockets is @@ -179,13 +180,6 @@ package body GNAT.Sockets is function Value (S : System.Address) return String; -- Same as Interfaces.C.Strings.Value but taking a System.Address - function To_Timeval (Val : Timeval_Duration) return Timeval; - -- Separate Val in seconds and microseconds - - function To_Duration (Val : Timeval) return Timeval_Duration; - -- Reconstruct a Duration value from a Timeval record (seconds and - -- microseconds). - function Dedot (Value : String) return String is (if Value /= "" and then Value (Value'Last) = '.' then Value (Value'First .. Value'Last - 1) @@ -528,7 +522,7 @@ package body GNAT.Sockets is Res : C.int; Last : C.int; RSig : Socket_Type := No_Socket; - TVal : aliased Timeval; + TVal : aliased System.C_Time.timeval; TPtr : Timeval_Access; begin @@ -543,7 +537,7 @@ package body GNAT.Sockets is if Timeout = Forever then TPtr := null; else - TVal := To_Timeval (Timeout); + TVal := System.C_Time.To_Timeval (Timeout); TPtr := TVal'Unchecked_Access; end if; @@ -1423,7 +1417,7 @@ package body GNAT.Sockets is U4 : aliased C.unsigned; V1 : aliased C.unsigned_char; VS : aliased C.char_array (1 .. NS); -- for devices name - VT : aliased Timeval; + VT : aliased System.C_Time.timeval; Len : aliased C.int; Add : System.Address; Res : C.int; @@ -1596,8 +1590,10 @@ package body GNAT.Sockets is Opt.Timeout := Duration (U4) / 1000; end if; + elsif System.C_Time.In_Timeval_Duration (VT) then + Opt.Timeout := System.C_Time.To_Duration (VT); else - Opt.Timeout := To_Duration (VT); + Opt.Timeout := Forever; end if; when Bind_To_Device => @@ -2633,7 +2629,7 @@ package body GNAT.Sockets is (1 .. (if Option.Name = Bind_To_Device then C.size_t (ASU.Length (Option.Device) + 1) else 0)); - VT : aliased Timeval; + VT : aliased System.C_Time.timeval; Len : C.int; Add : System.Address := Null_Address; Res : C.int; @@ -2767,7 +2763,7 @@ package body GNAT.Sockets is end if; else - VT := To_Timeval (Option.Timeout); + VT := System.C_Time.To_Timeval (Option.Timeout); Len := VT'Size / 8; Add := VT'Address; end if; @@ -2865,33 +2861,6 @@ package body GNAT.Sockets is return Integer (Socket); end To_C; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (Val : Timeval) return Timeval_Duration is - Max_D : constant Long_Long_Integer := Long_Long_Integer (Forever - 0.5); - Tv_sec_64 : constant Boolean := SOSC.SIZEOF_tv_sec = 8; - -- Need to separate this condition into the constant declaration to - -- avoid GNAT warning about "always true" or "always false". - begin - if Tv_sec_64 then - -- Check for possible Duration overflow when Tv_Sec field is 64 bit - -- integer. - - if Val.Tv_Sec > time_t (Max_D) - or else - (Val.Tv_Sec = time_t (Max_D) - and then - Val.Tv_Usec > suseconds_t ((Forever - Duration (Max_D)) * 1E6)) - then - return Forever; - end if; - end if; - - return Duration (Val.Tv_Sec) + Duration (Val.Tv_Usec) * 1.0E-6; - end To_Duration; - ------------------- -- To_Host_Entry -- ------------------- @@ -3041,35 +3010,6 @@ package body GNAT.Sockets is return HN.Name (1 .. HN.Length); end To_String; - ---------------- - -- To_Timeval -- - ---------------- - - function To_Timeval (Val : Timeval_Duration) return Timeval is - S : time_t; - uS : suseconds_t; - - begin - -- If zero, set result as zero (otherwise it gets rounded down to -1) - - if Val = 0.0 then - S := 0; - uS := 0; - - -- Normal case where we do round down - - else - S := time_t (Val - 0.5); - if Val = Timeval_Duration (S) then - uS := 0; - else - uS := suseconds_t ((Val - Timeval_Duration (S)) * 1_000_000 - 0.5); - end if; - end if; - - return (S, uS); - end To_Timeval; - ----------- -- Value -- ----------- diff --git a/gcc/ada/libgnat/g-socthi.adb b/gcc/ada/libgnat/g-socthi.adb index 5540dce04aef..c79b8db868be 100644 --- a/gcc/ada/libgnat/g-socthi.adb +++ b/gcc/ada/libgnat/g-socthi.adb @@ -40,6 +40,8 @@ with GNAT.Task_Lock; with Interfaces.C; use Interfaces.C; +with System.C_Time; + package body GNAT.Sockets.Thin is Non_Blocking_Sockets : aliased Fd_Set; @@ -215,7 +217,7 @@ package body GNAT.Sockets.Thin is declare -- unreachable if Thread_Blocking_IO is statically True pragma Warnings (On, "unreachable code"); WSet : aliased Fd_Set; - Now : aliased Timeval; + Now : aliased System.C_Time.timeval; begin Reset_Socket_Set (WSet'Access); diff --git a/gcc/ada/libgnat/g-socthi__vxworks.adb b/gcc/ada/libgnat/g-socthi__vxworks.adb index a3f05b384025..6ae74eb5f6bf 100644 --- a/gcc/ada/libgnat/g-socthi__vxworks.adb +++ b/gcc/ada/libgnat/g-socthi__vxworks.adb @@ -40,6 +40,8 @@ with GNAT.Task_Lock; with Interfaces.C; use Interfaces.C; +with System.C_Time; + package body GNAT.Sockets.Thin is Non_Blocking_Sockets : aliased Fd_Set; @@ -194,7 +196,7 @@ package body GNAT.Sockets.Thin is declare -- unreachable if Thread_Blocking_IO is statically True pragma Warnings (On, "unreachable code"); WSet : aliased Fd_Set; - Now : aliased Timeval; + Now : aliased System.C_Time.timeval; begin Reset_Socket_Set (WSet'Access); loop diff --git a/gcc/ada/libgnat/g-sothco.ads b/gcc/ada/libgnat/g-sothco.ads index cdf0a16ef086..ec9b5746f0c6 100644 --- a/gcc/ada/libgnat/g-sothco.ads +++ b/gcc/ada/libgnat/g-sothco.ads @@ -33,8 +33,10 @@ -- This package should not be directly with'ed by an applications program. with Ada.Unchecked_Conversion; + with Interfaces.C.Strings; -with System.Parameters; + +with System.C_Time; package GNAT.Sockets.Thin_Common is @@ -44,31 +46,23 @@ package GNAT.Sockets.Thin_Common is Success : constant C.int := 0; Failure : constant C.int := -1; - type time_t is - range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - for time_t'Size use System.Parameters.time_t_bits; - pragma Convention (C, time_t); - - type suseconds_t is - range -2 ** (8 * SOSC.SIZEOF_tv_usec - 1) - .. 2 ** (8 * SOSC.SIZEOF_tv_usec - 1) - 1; - for suseconds_t'Size use 8 * SOSC.SIZEOF_tv_usec; - pragma Convention (C, suseconds_t); - - type Timeval is record - Tv_Sec : time_t; - Tv_Usec : suseconds_t; - end record; - pragma Convention (C, Timeval); + subtype time_t is System.C_Time.time_t; + pragma Obsolescent (time_t, "use type from GNAT.C_Time instead"); + + subtype suseconds_t is System.C_Time.usec_t; + pragma Obsolescent (suseconds_t, "use type from GNAT.C_Time instead"); + + subtype timeval is System.C_Time.timeval; + pragma Obsolescent (timeval, "use type from GNAT.C_Time instead"); - type Timeval_Access is access all Timeval; + type Timeval_Access is access all System.C_Time.timeval; pragma Convention (C, Timeval_Access); type socklen_t is mod 2 ** (8 * SOSC.SIZEOF_socklen_t); for socklen_t'Size use (8 * SOSC.SIZEOF_socklen_t); - Immediat : constant Timeval := (0, 0); + Immediat : constant System.C_Time.timeval + := System.C_Time.Milliseconds_To_Timeval (0); ------------------------------------------- -- Mapping tables to low level constants -- diff --git a/gcc/ada/libgnat/g-spogwa.adb b/gcc/ada/libgnat/g-spogwa.adb index a4bbf962a9f3..3752b2bf4422 100644 --- a/gcc/ada/libgnat/g-spogwa.adb +++ b/gcc/ada/libgnat/g-spogwa.adb @@ -29,7 +29,7 @@ -- -- ------------------------------------------------------------------------------ -with GNAT.Sockets.Thin_Common; +with System.C_Time; procedure GNAT.Sockets.Poll.G_Wait (Fds : in out Set; Timeout : Interfaces.C.int; Result : out Integer) @@ -41,11 +41,11 @@ is readfds : access FD_Set_Type; writefds : access FD_Set_Type; exceptfds : access FD_Set_Type; - timeout : access Thin_Common.Timeval) return Integer + timeout : access System.C_Time.timeval) return Integer with Import => True, Convention => Stdcall, External_Name => "select"; - Timeout_V : aliased Thin_Common.Timeval; - Timeout_A : access Thin_Common.Timeval; + Timeout_V : aliased System.C_Time.timeval; + Timeout_A : access System.C_Time.timeval; Rfds : aliased FD_Set_Type; Rcount : Natural := 0; @@ -63,8 +63,7 @@ begin if Timeout >= 0 then Timeout_A := Timeout_V'Access; - Timeout_V.Tv_Sec := Thin_Common.time_t (Timeout / 1000); - Timeout_V.Tv_Usec := Thin_Common.suseconds_t (Timeout rem 1000 * 1000); + Timeout_V := System.C_Time.Milliseconds_To_Timeval (Timeout); end if; Reset_Socket_Set (Rfds); diff --git a/gcc/ada/libgnat/s-c_time.adb b/gcc/ada/libgnat/s-c_time.adb new file mode 100644 index 000000000000..70f8a9cac08f --- /dev/null +++ b/gcc/ada/libgnat/s-c_time.adb @@ -0,0 +1,203 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . C _ T I M E -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2025, Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +package body System.C_Time is + + -- Two Duration representations are described in targparm.ads: + -- Size Small Last = (2**(Size - 1) - 1) * Small + -- 32 0.02 42_949_672.94 + -- 64 0.000_000_001 9_223_372_036.854_775_807 + + Recip : constant := (if Duration'Size = 32 then 50 else 1_000_000_000); + -- The reciprocal of the Small used to write "* Small" as "/ Recip" + + Milli : constant := 1_000; + Micro : constant := 1_000_000; + Nano : constant := 1_000_000_000; + -- The standard divisors + + pragma Unsuppress (Overflow_Check); + -- Overflow may occur during the various conversions + + ------------------------- + -- In_Timeval_Duration -- + ------------------------- + + -- Immediate : constant Duration := 0.0; + + -- Forever : constant Duration := + -- Duration'Min (Duration'Last, 1.0 * OS_Constants.MAX_tv_sec); + + -- subtype Timeval_Duration is Duration range Immediate .. Forever; + + function In_Timeval_Duration (T : timeval) return Boolean is + Max_Dur : constant := 2**(Duration'Size - 1) - 1; + Max_Sec : constant := Max_Dur / Recip; + Max_Usec : constant := (Max_Dur mod Recip) * Micro / Recip; + + -- When Duration'Size = 64 and time_t'Size = 32, the compiler + -- complains that Max_Sec does not fit in time_t, hence cannot + -- be compared with T.tv_sec. + Safe_Max_Sec : constant := + (if Max_Sec > time_t'Last then time_t'Last else Max_Sec); + Safe_Max_Usec : constant := + (if Max_Sec > time_t'Last then usec_t'Last else Max_Usec); + + begin + pragma Warnings (Off, "condition is always"); + return T.tv_sec >= 0 + and then (T.tv_sec > 0 or else T.tv_usec >= 0) + and then T.tv_sec <= Safe_Max_Sec + and then (T.tv_sec < Safe_Max_Sec or else T.tv_usec <= Safe_Max_Usec) + and then T.tv_sec <= OS_Constants.MAX_tv_sec + and then (T.tv_sec < OS_Constants.MAX_tv_sec or else T.tv_usec = 0); + pragma Warnings (On, "condition is always"); + end In_Timeval_Duration; + + ----------------------------- + -- Milliseconds_To_Timeval -- + ----------------------------- + + function Milliseconds_To_Timeval (M : Interfaces.C.int) return timeval is + use Interfaces.C; + Q : constant int := M / Milli; + R : constant int := M rem Milli; + + begin + return (tv_sec => time_t (Q), tv_usec => usec_t (R) * (Micro / Milli)); + end Milliseconds_To_Timeval; + + ----------------------------- + -- Nanoseconds_To_Timespec -- + ----------------------------- + + function Nanoseconds_To_Timespec (N : Interfaces.C.int) return timespec is + use Interfaces.C; + Q : constant int := N / Nano; + R : constant int := N rem Nano; + + begin + return (tv_sec => time_t (Q), tv_nsec => nsec_t (R)); + end Nanoseconds_To_Timespec; + + ----------------- + -- To_Duration -- + ----------------- + + -- Duration (tv_usec) is OK even when Duration'Size = 32, see above + + function To_Duration (T : timeval) return Duration is + begin + return Duration (T.tv_sec) + Duration (T.tv_usec) / Micro; + end To_Duration; + + -- Duration (tv_nsec) overflows when Duration'Size = 32, see above. + -- Scale down nanoseconds by the value of the Small in nanoseconds. + + function To_Duration (T : timespec) return Duration is + S : constant := Nano / Recip; + + begin + return Duration (T.tv_sec) + Duration (T.tv_nsec / S) / (Nano / S); + end To_Duration; + + ----------------- + -- To_Timespec -- + ----------------- + + function To_Timespec (T : timeval) return timespec is + begin + return (tv_sec => T.tv_sec, tv_nsec => nsec_t (T.tv_usec) * Milli); + end To_Timespec; + + function To_Timespec (D : Duration) return timespec is + tv_sec : time_t; + tv_nsec : nsec_t; + + begin + if D = 0.0 then + tv_sec := 0; + tv_nsec := 0; + + elsif D < 0.0 then + tv_sec := time_t (D + 0.5); + if D = Duration (tv_sec) then + tv_nsec := 0; + else + tv_nsec := nsec_t ((D - Duration (tv_sec)) * Nano + 0.5); + end if; + + else + tv_sec := time_t (D - 0.5); + if D = Duration (tv_sec) then + tv_nsec := 0; + else + tv_nsec := nsec_t ((D - Duration (tv_sec)) * Nano - 0.5); + end if; + end if; + + return (tv_sec, tv_nsec); + end To_Timespec; + + ----------------- + -- To_Timeval -- + ----------------- + + function To_Timeval (D : Duration) return timeval is + tv_sec : time_t; + tv_usec : usec_t; + + begin + if D = 0.0 then + tv_sec := 0; + tv_usec := 0; + + elsif D < 0.0 then + tv_sec := time_t (D + 0.5); + if D = Duration (tv_sec) then + tv_usec := 0; + else + tv_usec := usec_t ((D - Duration (tv_sec)) * Micro + 0.5); + end if; + + else + tv_sec := time_t (D - 0.5); + if D = Duration (tv_sec) then + tv_usec := 0; + else + tv_usec := usec_t ((D - Duration (tv_sec)) * Micro - 0.5); + end if; + end if; + + return (tv_sec, tv_usec); + end To_Timeval; + +end System.C_Time; diff --git a/gcc/ada/libgnat/s-c_time.ads b/gcc/ada/libgnat/s-c_time.ads new file mode 100644 index 000000000000..626a02df5be0 --- /dev/null +++ b/gcc/ada/libgnat/s-c_time.ads @@ -0,0 +1,93 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . C _ T I M E -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2025, Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides the time_t, timeval and timespec types corresponding +-- to the C types defined by the OS, as well as various conversion functions. + +with Interfaces.C; + +with System.OS_Constants; + +package System.C_Time + with Pure +is + -- These two C structs represent durations with different accuracies and + -- maximal values. + + type time_t is range -2 ** (OS_Constants.SIZEOF_tv_sec * 8 - 1) .. + 2 ** (OS_Constants.SIZEOF_tv_sec * 8 - 1) - 1 + with Convention => C, Size => OS_Constants.SIZEOF_tv_sec * 8; + + type usec_t is range -2 ** (OS_Constants.SIZEOF_tv_usec * 8 - 1) .. + 2 ** (OS_Constants.SIZEOF_tv_usec * 8 - 1) - 1 + with Convention => C, Size => OS_Constants.SIZEOF_tv_usec * 8; + -- Larger than the suseconds_t C type on ARM 32 bits with GNU libc + -- when __TIME_BITS=64. + + type timeval is record + tv_sec : time_t; -- seconds + tv_usec : usec_t; -- microseconds + end record + with Convention => C; + + type nsec_t is range -2 ** (OS_Constants.SIZEOF_tv_nsec * 8 - 1) .. + 2 ** (OS_Constants.SIZEOF_tv_nsec * 8 - 1) - 1 + with Convention => C, Size => OS_Constants.SIZEOF_tv_nsec * 8; + -- Larger than the signed long int C type on x32. + + type timespec is record + tv_sec : time_t; -- seconds + tv_nsec : nsec_t; -- nanoseconds + end record + with Convention => C; + + -- All conversion functions truncate the result if it is inexact + + function To_Duration (T : timespec) return Duration with Inline; + function To_Duration (T : timeval) return Duration with Inline; + + function To_Timespec (D : Duration) return timespec with Inline; + function To_Timeval (D : Duration) return timeval with Inline; + + function In_Timeval_Duration (T : timeval) return Boolean with Inline; + -- g-socket.adb if not Windows target + + function Milliseconds_To_Timeval (M : Interfaces.C.int) return timeval + with Inline; + -- g-sothco.ads + -- g-spogwa.adb + + function Nanoseconds_To_Timespec (N : Interfaces.C.int) return timespec + with Inline; + function To_Timespec (T : timeval) return timespec with Inline; + -- s-osinte__darwin.adb + +end System.C_Time; diff --git a/gcc/ada/libgnat/s-optide.adb b/gcc/ada/libgnat/s-optide.adb index 6abe6d3a0e69..e39c7cbe2d20 100644 --- a/gcc/ada/libgnat/s-optide.adb +++ b/gcc/ada/libgnat/s-optide.adb @@ -36,8 +36,13 @@ procedure Timed_Delay (Time : Duration; Mode : Integer) is - Request : aliased timespec; - Remaind : aliased timespec; + + function nanosleep (rqtp, rmtp : not null access C_Time.timespec) + return Integer; + pragma Import (C, nanosleep, "nanosleep"); + + Request : aliased C_Time.timespec; + Remaind : aliased C_Time.timespec; Rel_Time : Duration; Abs_Time : Duration; Base_Time : constant Duration := Clock; @@ -71,7 +76,7 @@ begin end if; pragma Warnings (On); - Request := To_Timespec (Time_Chunk); + Request := C_Time.To_Timespec (Time_Chunk); Result := nanosleep (Request'Access, Remaind'Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb index b07bdeadd092..d0a0ad34859d 100644 --- a/gcc/ada/libgnat/s-os_lib.adb +++ b/gcc/ada/libgnat/s-os_lib.adb @@ -2985,7 +2985,7 @@ package body System.OS_Lib is -- To_Ada -- ------------ - function To_Ada (Time : time_t) return OS_Time is + function To_Ada (Time : Long_Long_Integer) return OS_Time is begin return OS_Time (Time); end To_Ada; @@ -3023,9 +3023,9 @@ package body System.OS_Lib is -- To_C -- ---------- - function To_C (Time : OS_Time) return time_t is + function To_C (Time : OS_Time) return Long_Long_Integer is begin - return time_t (Time); + return Long_Long_Integer (Time); end To_C; ------------------ diff --git a/gcc/ada/libgnat/s-os_lib.ads b/gcc/ada/libgnat/s-os_lib.ads index 38cfc88c4eaa..734f4fd50a5d 100644 --- a/gcc/ada/libgnat/s-os_lib.ads +++ b/gcc/ada/libgnat/s-os_lib.ads @@ -115,6 +115,12 @@ package System.OS_Lib is -- these have Intrinsic convention, so for example it is not permissible -- to create accesses to any of these functions. + function To_Ada (Time : Long_Long_Integer) return OS_Time; + -- Convert Long_Long_Integer to OS_Time + + function To_C (Time : OS_Time) return Long_Long_Integer; + -- Convert OS_Time to Long_Long_Integer + subtype Year_Type is Integer range 1900 .. 2099; subtype Month_Type is Integer range 1 .. 12; subtype Day_Type is Integer range 1 .. 31; @@ -161,27 +167,6 @@ package System.OS_Lib is -- component parts to be interpreted in the local time zone, and returns -- an OS_Time. Returns Invalid_Time if the creation fails. - ------------------ - -- Time_t Stuff -- - ------------------ - - -- Note: Do not use time_t in the compiler and host-based tools; instead - -- use OS_Time. - - subtype time_t is Long_Long_Integer; - -- C time_t can be either long or long long, so we choose the Ada - -- equivalent of the latter because eventually that will be the - -- type used out of necessity. This may affect some user code on 32-bit - -- targets that have not yet migrated to the Posix 2008 standard, - -- particularly pre version 5 32-bit Linux. Do not change this - -- declaration without coordinating it with conversions in Ada.Calendar. - - function To_C (Time : OS_Time) return time_t; - -- Convert OS_Time to C time_t type - - function To_Ada (Time : time_t) return OS_Time; - -- Convert C time_t type to OS_Time - ---------------- -- File Stuff -- ---------------- @@ -1126,8 +1111,8 @@ private pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">="); - pragma Inline (To_C); pragma Inline (To_Ada); + pragma Inline (To_C); type Process_Id is new Integer; Invalid_Pid : constant Process_Id := -1; diff --git a/gcc/ada/libgnat/s-osprim__darwin.adb b/gcc/ada/libgnat/s-osprim__darwin.adb index 28bfcb8c6831..7b978a3b486d 100644 --- a/gcc/ada/libgnat/s-osprim__darwin.adb +++ b/gcc/ada/libgnat/s-osprim__darwin.adb @@ -29,9 +29,10 @@ -- -- ------------------------------------------------------------------------------ --- This version is for darwin +-- This version is for Darwin + +with System.C_Time; -with System.Parameters; package body System.OS_Primitives is -- ??? These definitions are duplicated from System.OS_Interface @@ -46,27 +47,13 @@ package body System.OS_Primitives is pragma Convention (C, struct_timezone); type struct_timezone_ptr is access all struct_timezone; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type struct_timeval is record - tv_sec : time_t; - tv_usec : Integer; - end record; - pragma Convention (C, struct_timeval); - function gettimeofday - (tv : not null access struct_timeval; + (tv : not null access C_Time.timeval; tz : struct_timezone_ptr) return Integer; pragma Import (C, gettimeofday, "gettimeofday"); - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; + function nanosleep (rqtp, rmtp : not null access C_Time.timespec) + return Integer; pragma Import (C, nanosleep, "nanosleep"); ----------- @@ -74,7 +61,7 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - TV : aliased struct_timeval; + TV : aliased C_Time.timeval; Result : Integer; pragma Unreferenced (Result); @@ -89,36 +76,9 @@ package body System.OS_Primitives is -- value is never checked. Result := gettimeofday (TV'Access, null); - return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; + return C_Time.To_Duration (TV); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- @@ -127,8 +87,8 @@ package body System.OS_Primitives is (Time : Duration; Mode : Integer) is - Request : aliased timespec; - Remaind : aliased timespec; + Request : aliased C_Time.timespec; + Remaind : aliased C_Time.timespec; Rel_Time : Duration; Abs_Time : Duration; Base_Time : constant Duration := Clock; @@ -148,7 +108,7 @@ package body System.OS_Primitives is if Rel_Time > 0.0 then loop - Request := To_Timespec (Rel_Time); + Request := C_Time.To_Timespec (Rel_Time); Result := nanosleep (Request'Access, Remaind'Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-osprim__posix.adb b/gcc/ada/libgnat/s-osprim__posix.adb index 94d06c325bb2..45836ac806d3 100644 --- a/gcc/ada/libgnat/s-osprim__posix.adb +++ b/gcc/ada/libgnat/s-osprim__posix.adb @@ -30,26 +30,10 @@ ------------------------------------------------------------------------------ -- This version is for POSIX-like operating systems -with System.Parameters; -package body System.OS_Primitives is - - -- ??? These definitions are duplicated from System.OS_Interface - -- because we don't want to depend on any package. Consider removing - -- these declarations in System.OS_Interface and move these ones in - -- the spec. - - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; +with System.C_Time; - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; - pragma Import (C, nanosleep, "nanosleep"); +package body System.OS_Primitives is ----------- -- Clock -- @@ -57,27 +41,12 @@ package body System.OS_Primitives is function Clock return Duration is - type timeval is array (1 .. 3) of Long_Integer; - -- The timeval array is sized to contain Long_Long_Integer sec and - -- Long_Integer usec. If Long_Long_Integer'Size = Long_Integer'Size then - -- it will be overly large but that will not effect the implementation - -- since it is not accessed directly. - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access Long_Long_Integer; - usec : not null access Long_Integer); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased Long_Long_Integer; - usec : aliased Long_Integer; - TV : aliased timeval; + TV : aliased C_Time.timeval; Result : Integer; pragma Unreferenced (Result); function gettimeofday - (Tv : access timeval; + (Tv : access C_Time.timeval; Tz : System.Address := System.Null_Address) return Integer; pragma Import (C, gettimeofday, "gettimeofday"); @@ -91,37 +60,9 @@ package body System.OS_Primitives is -- value is never checked. Result := gettimeofday (TV'Access, System.Null_Address); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - return Duration (sec) + Duration (usec) / Micro; + return C_Time.To_Duration (TV); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- diff --git a/gcc/ada/libgnat/s-osprim__posix2008.adb b/gcc/ada/libgnat/s-osprim__posix2008.adb index 78b21c6444d9..fceb37cdd011 100644 --- a/gcc/ada/libgnat/s-osprim__posix2008.adb +++ b/gcc/ada/libgnat/s-osprim__posix2008.adb @@ -32,34 +32,19 @@ -- This version is for POSIX.1-2008-like operating systems with System.CRTL; +with System.C_Time; with System.OS_Constants; -with System.Parameters; + package body System.OS_Primitives is subtype int is System.CRTL.int; - -- ??? These definitions are duplicated from System.OS_Interface because - -- we don't want to depend on any package. Consider removing these - -- declarations in System.OS_Interface and move these ones to the spec. - - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; - pragma Import (C, nanosleep, "nanosleep"); - ----------- -- Clock -- ----------- function Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : int; type clockid_t is new int; @@ -68,42 +53,15 @@ package body System.OS_Primitives is function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); begin Result := clock_gettime (CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; + return C_Time.To_Duration (TS); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- diff --git a/gcc/ada/libgnat/s-osprim__rtems.adb b/gcc/ada/libgnat/s-osprim__rtems.adb index c8fbc8270ca8..99644b39424a 100644 --- a/gcc/ada/libgnat/s-osprim__rtems.adb +++ b/gcc/ada/libgnat/s-osprim__rtems.adb @@ -31,7 +31,8 @@ -- This version is for POSIX-like operating systems -with System.Parameters; +with System.C_Time; + package body System.OS_Primitives is -- ??? These definitions are duplicated from System.OS_Interface @@ -39,16 +40,8 @@ package body System.OS_Primitives is -- these declarations in System.OS_Interface and move these ones in -- the spec. - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; + function nanosleep (rqtp, rmtp : not null access C_Time.timespec) + return Integer; pragma Import (C, nanosleep, "nanosleep"); ----------- @@ -56,28 +49,12 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - - type timeval is record - tv_sec : time_t; - tv_usec : Long_Integer; - end record; - pragma Convention (C, timeval); - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access Long_Long_Integer; - usec : not null access Long_Integer); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased Long_Long_Integer; - usec : aliased Long_Integer; - TV : aliased timeval; + TV : aliased C_Time.timeval; Result : Integer; pragma Unreferenced (Result); function gettimeofday - (Tv : access timeval; + (Tv : access C_Time.timeval; Tz : System.Address := System.Null_Address) return Integer; pragma Import (C, gettimeofday, "gettimeofday"); @@ -91,37 +68,9 @@ package body System.OS_Primitives is -- value is never checked. Result := gettimeofday (TV'Access, System.Null_Address); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - return Duration (sec) + Duration (usec) / Micro; + return C_Time.To_Duration (TV); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- @@ -130,8 +79,8 @@ package body System.OS_Primitives is (Time : Duration; Mode : Integer) is - Request : aliased timespec; - Remaind : aliased timespec; + Request : aliased C_Time.timespec; + Remaind : aliased C_Time.timespec; Rel_Time : Duration; Abs_Time : Duration; Base_Time : constant Duration := Clock; @@ -151,7 +100,7 @@ package body System.OS_Primitives is if Rel_Time > 0.0 then loop - Request := To_Timespec (Rel_Time); + Request := C_Time.To_Timespec (Rel_Time); Result := nanosleep (Request'Access, Remaind'Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-osprim__solaris.adb b/gcc/ada/libgnat/s-osprim__solaris.adb deleted file mode 100644 index a08feb5f666f..000000000000 --- a/gcc/ada/libgnat/s-osprim__solaris.adb +++ /dev/null @@ -1,126 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . O S _ P R I M I T I V E S -- --- -- --- B o d y -- --- -- --- Copyright (C) 1998-2025, Free Software Foundation, Inc. -- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- . -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- This version uses gettimeofday and select --- This file is suitable for Solaris (32 and 64 bits). - -package body System.OS_Primitives is - - -- ??? These definitions are duplicated from System.OS_Interface - -- because we don't want to depend on any package. Consider removing - -- these declarations in System.OS_Interface and move these ones in - -- the spec. - - type struct_timeval is record - tv_sec : Long_Integer; - tv_usec : Long_Integer; - end record; - pragma Convention (C, struct_timeval); - - procedure gettimeofday - (tv : not null access struct_timeval; - tz : Address := Null_Address); - pragma Import (C, gettimeofday, "gettimeofday"); - - procedure C_select - (n : Integer := 0; - readfds, - writefds, - exceptfds : Address := Null_Address; - timeout : not null access struct_timeval); - pragma Import (C, C_select, "select"); - - ----------- - -- Clock -- - ----------- - - function Clock return Duration is - TV : aliased struct_timeval; - - begin - gettimeofday (TV'Access); - return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; - end Clock; - - ----------------- - -- Timed_Delay -- - ----------------- - - procedure Timed_Delay - (Time : Duration; - Mode : Integer) - is - Rel_Time : Duration; - Abs_Time : Duration; - Base_Time : constant Duration := Clock; - Check_Time : Duration := Base_Time; - timeval : aliased struct_timeval; - - begin - if Mode = Relative then - Rel_Time := Time; - Abs_Time := Time + Check_Time; - else - Rel_Time := Time - Check_Time; - Abs_Time := Time; - end if; - - if Rel_Time > 0.0 then - loop - timeval.tv_sec := Long_Integer (Rel_Time); - - if Duration (timeval.tv_sec) > Rel_Time then - timeval.tv_sec := timeval.tv_sec - 1; - end if; - - timeval.tv_usec := - Long_Integer ((Rel_Time - Duration (timeval.tv_sec)) * 10#1#E6); - - C_select (timeout => timeval'Unchecked_Access); - Check_Time := Clock; - - exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; - - Rel_Time := Abs_Time - Check_Time; - end loop; - end if; - end Timed_Delay; - - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize is - begin - null; - end Initialize; - -end System.OS_Primitives; diff --git a/gcc/ada/libgnat/s-osprim__unix.adb b/gcc/ada/libgnat/s-osprim__unix.adb index 5848df6f63fc..c48fbe1001f0 100644 --- a/gcc/ada/libgnat/s-osprim__unix.adb +++ b/gcc/ada/libgnat/s-osprim__unix.adb @@ -30,7 +30,9 @@ ------------------------------------------------------------------------------ -- This version uses gettimeofday and select --- This file is suitable for OpenNT, Dec Unix and SCO UnixWare. +-- This file is suitable for Dec Unix, SCO UnixWare and Sun Solaris. + +with System.C_Time; package body System.OS_Primitives is @@ -39,14 +41,8 @@ package body System.OS_Primitives is -- these declarations in System.OS_Interface and move these ones in -- the spec. - type struct_timeval is record - tv_sec : Integer; - tv_usec : Integer; - end record; - pragma Convention (C, struct_timeval); - procedure gettimeofday - (tv : not null access struct_timeval; + (tv : not null access C_Time.timeval; tz : Address := Null_Address); pragma Import (C, gettimeofday, "gettimeofday"); @@ -55,7 +51,7 @@ package body System.OS_Primitives is readfds, writefds, exceptfds : Address := Null_Address; - timeout : not null access struct_timeval); + timeout : not null access C_Time.timeval); pragma Import (C, C_select, "select"); ----------- @@ -63,11 +59,11 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - TV : aliased struct_timeval; + TV : aliased C_Time.timeval; begin gettimeofday (TV'Access); - return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; + return C_Time.To_Duration (TV); end Clock; ----------------- @@ -82,7 +78,7 @@ package body System.OS_Primitives is Abs_Time : Duration; Base_Time : constant Duration := Clock; Check_Time : Duration := Base_Time; - timeval : aliased struct_timeval; + timeval : aliased C_Time.timeval; begin if Mode = Relative then @@ -95,14 +91,7 @@ package body System.OS_Primitives is if Rel_Time > 0.0 then loop - timeval.tv_sec := Integer (Rel_Time); - - if Duration (timeval.tv_sec) > Rel_Time then - timeval.tv_sec := timeval.tv_sec - 1; - end if; - - timeval.tv_usec := - Integer ((Rel_Time - Duration (timeval.tv_sec)) * 10#1#E6); + timeval := C_Time.To_Timeval (Rel_Time); C_select (timeout => timeval'Unchecked_Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-osprim__x32.adb b/gcc/ada/libgnat/s-osprim__x32.adb deleted file mode 100644 index e127107aa57d..000000000000 --- a/gcc/ada/libgnat/s-osprim__x32.adb +++ /dev/null @@ -1,170 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . O S _ P R I M I T I V E S -- --- -- --- B o d y -- --- -- --- Copyright (C) 2013-2025, Free Software Foundation, Inc. -- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- . -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- This version is for Linux/x32 - -with System.Parameters; - -package body System.OS_Primitives is - - -- ??? These definitions are duplicated from System.OS_Interface - -- because we don't want to depend on any package. Consider removing - -- these declarations in System.OS_Interface and move these ones in - -- the spec. - - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; - pragma Import (C, nanosleep, "nanosleep"); - - ----------- - -- Clock -- - ----------- - - function Clock return Duration is - type timeval is array (1 .. 2) of Long_Long_Integer; - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access Long_Integer; - usec : not null access Long_Integer); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased Long_Integer; - usec : aliased Long_Integer; - TV : aliased timeval; - Result : Integer; - pragma Unreferenced (Result); - - function gettimeofday - (Tv : access timeval; - Tz : System.Address := System.Null_Address) return Integer; - pragma Import (C, gettimeofday, "gettimeofday"); - - begin - -- The return codes for gettimeofday are as follows (from man pages): - -- EPERM settimeofday is called by someone other than the superuser - -- EINVAL Timezone (or something else) is invalid - -- EFAULT One of tv or tz pointed outside accessible address space - - -- None of these codes signal a potential clock skew, hence the return - -- value is never checked. - - Result := gettimeofday (TV'Access, System.Null_Address); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - return Duration (sec) + Duration (usec) / Micro; - end Clock; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Long_Integer (F * 10#1#E9)); - end To_Timespec; - - ----------------- - -- Timed_Delay -- - ----------------- - - procedure Timed_Delay - (Time : Duration; - Mode : Integer) - is - Request : aliased timespec; - Remaind : aliased timespec; - Rel_Time : Duration; - Abs_Time : Duration; - Base_Time : constant Duration := Clock; - Check_Time : Duration := Base_Time; - - Result : Integer; - pragma Unreferenced (Result); - - begin - if Mode = Relative then - Rel_Time := Time; - Abs_Time := Time + Check_Time; - else - Rel_Time := Time - Check_Time; - Abs_Time := Time; - end if; - - if Rel_Time > 0.0 then - loop - Request := To_Timespec (Rel_Time); - Result := nanosleep (Request'Access, Remaind'Access); - Check_Time := Clock; - - exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; - - Rel_Time := Abs_Time - Check_Time; - end loop; - end if; - end Timed_Delay; - - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize is - begin - null; - end Initialize; - -end System.OS_Primitives; diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads index 98284a4d13ec..8587453c947e 100644 --- a/gcc/ada/libgnat/s-parame.ads +++ b/gcc/ada/libgnat/s-parame.ads @@ -97,13 +97,6 @@ package System.Parameters is -- Indicates if secondary stacks can grow and shrink at run-time. If False, -- the size of a secondary stack is fixed at the point of its creation. - ------------------------------------ - -- Characteristics of time_t type -- - ------------------------------------ - - time_t_bits : constant := Long_Integer'Size; - -- Number of bits in type time_t - ---------------------------------------------- -- Characteristics of types in Interfaces.C -- ---------------------------------------------- diff --git a/gcc/ada/libgnat/s-parame__hpux.ads b/gcc/ada/libgnat/s-parame__hpux.ads index a8a7b691802d..832f344a5927 100644 --- a/gcc/ada/libgnat/s-parame__hpux.ads +++ b/gcc/ada/libgnat/s-parame__hpux.ads @@ -96,13 +96,6 @@ package System.Parameters is -- Indicates if secondary stacks can grow and shrink at run-time. If False, -- the size of a secondary stack is fixed at the point of its creation. - ------------------------------------ - -- Characteristics of time_t type -- - ------------------------------------ - - time_t_bits : constant := Long_Integer'Size; - -- Number of bits in type time_t - ---------------------------------------------- -- Characteristics of Types in Interfaces.C -- ---------------------------------------------- diff --git a/gcc/ada/libgnat/s-parame__posix2008.ads b/gcc/ada/libgnat/s-parame__posix2008.ads deleted file mode 100644 index 1cf09c6e39f1..000000000000 --- a/gcc/ada/libgnat/s-parame__posix2008.ads +++ /dev/null @@ -1,189 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- S Y S T E M . P A R A M E T E R S -- --- -- --- S p e c -- --- -- --- Copyright (C) 1992-2025, Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- . -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the Posix 2008 version for 64 bit time_t. - --- This package defines some system dependent parameters for GNAT. These --- are values that are referenced by the runtime library and are therefore --- relevant to the target machine. - --- The parameters whose value is defined in the spec are not generally --- expected to be changed. If they are changed, it will be necessary to --- recompile the run-time library. - --- The parameters which are defined by functions can be changed by modifying --- the body of System.Parameters in file s-parame.adb. A change to this body --- requires only rebinding and relinking of the application. - --- Note: do not introduce any pragma Inline statements into this unit, since --- otherwise the relinking and rebinding capability would be deactivated. - -package System.Parameters is - pragma Pure; - - --------------------------------------- - -- Task And Stack Allocation Control -- - --------------------------------------- - - type Size_Type is range -Memory_Size / 2 .. Memory_Size / 2 - 1; - -- Type used to provide task stack sizes to the runtime. Sized to permit - -- stack sizes of up to half the total addressable memory space. This may - -- seem excessively large (even for 32-bit systems), however there are many - -- instances of users requiring large stack sizes (for example string - -- processing). - - Unspecified_Size : constant Size_Type := Size_Type'First; - -- Value used to indicate that no size type is set - - function Default_Stack_Size return Size_Type; - -- Default task stack size used if none is specified - - function Minimum_Stack_Size return Size_Type; - -- Minimum task stack size permitted - - function Adjust_Storage_Size (Size : Size_Type) return Size_Type; - -- Given the storage size stored in the TCB, return the Storage_Size - -- value required by the RM for the Storage_Size attribute. The - -- required adjustment is as follows: - -- - -- when Size = Unspecified_Size, return Default_Stack_Size - -- when Size < Minimum_Stack_Size, return Minimum_Stack_Size - -- otherwise return given Size - - Default_Env_Stack_Size : constant Size_Type := 8_192_000; - -- Assumed size of the environment task, if no other information is - -- available. This value is used when stack checking is enabled and - -- no GNAT_STACK_LIMIT environment variable is set. - - Stack_Grows_Down : constant Boolean := True; - -- This constant indicates whether the stack grows up (False) or - -- down (True) in memory as functions are called. It is used for - -- proper implementation of the stack overflow check. - - Runtime_Default_Sec_Stack_Size : constant Size_Type := 10 * 1024; - -- The run-time chosen default size for secondary stacks that may be - -- overridden by the user with the use of binder -D switch. - - Sec_Stack_Dynamic : constant Boolean := True; - -- Indicates if secondary stacks can grow and shrink at run-time. If False, - -- the size of a secondary stack is fixed at the point of its creation. - - ------------------------------------ - -- Characteristics of time_t type -- - ------------------------------------ - - time_t_bits : constant := Long_Long_Integer'Size; - -- Number of bits in type time_t. Use for targets that are Posix 2008 - -- compliant (fixes the year 2038 time_t overflow). - - ---------------------------------------------- - -- Characteristics of types in Interfaces.C -- - ---------------------------------------------- - - long_bits : constant := Long_Integer'Size; - -- Number of bits in type long and unsigned_long. The normal convention - -- is that this is the same as type Long_Integer, but this may not be true - -- of all targets. - - ptr_bits : constant := Standard'Address_Size; - subtype C_Address is System.Address; - -- Number of bits in Interfaces.C pointers, normally a standard address - - C_Malloc_Linkname : constant String := "__gnat_malloc"; - -- Name of runtime function used to allocate such a pointer - - ---------------------------------------------- - -- Behavior of Pragma Finalize_Storage_Only -- - ---------------------------------------------- - - -- Garbage_Collected is a Boolean constant whose value indicates the - -- effect of the pragma Finalize_Storage_Entry on a controlled type. - - -- Garbage_Collected = False - - -- The system releases all storage on program termination only, - -- but not other garbage collection occurs, so finalization calls - -- are omitted only for outer level objects can be omitted if - -- pragma Finalize_Storage_Only is used. - - -- Garbage_Collected = True - - -- The system provides full garbage collection, so it is never - -- necessary to release storage for controlled objects for which - -- a pragma Finalize_Storage_Only is used. - - Garbage_Collected : constant Boolean := False; - -- The storage mode for this system (release on program exit) - - --------------------- - -- Tasking Profile -- - --------------------- - - -- In the following sections, constant parameters are defined to - -- allow some optimizations and fine tuning within the tasking run time - -- based on restrictions on the tasking features. - - ------------------- - -- Task Abortion -- - ------------------- - - No_Abort : constant Boolean := False; - -- This constant indicates whether abort statements and asynchronous - -- transfer of control (ATC) are disallowed. If set to True, it is - -- assumed that neither construct is used, and the run time does not - -- need to defer/undefer abort and check for pending actions at - -- completion points. A value of True for No_Abort corresponds to: - -- pragma Restrictions (No_Abort_Statements); - -- pragma Restrictions (Max_Asynchronous_Select_Nesting => 0); - - --------------------- - -- Task Attributes -- - --------------------- - - Max_Attribute_Count : constant := 32; - -- Number of task attributes stored in the task control block - - ----------------------- - -- Task Image Length -- - ----------------------- - - Max_Task_Image_Length : constant := 256; - -- This constant specifies the maximum length of a task's image - - ------------------------------ - -- Exception Message Length -- - ------------------------------ - - Default_Exception_Msg_Max_Length : constant := 200; - -- This constant specifies the default number of characters to allow - -- in an exception message (200 is minimum required by RM 11.4.1(18)). - -end System.Parameters; diff --git a/gcc/ada/libgnat/s-parame__vxworks.ads b/gcc/ada/libgnat/s-parame__vxworks.ads index dbaadb404b75..de9afdbb0b2b 100644 --- a/gcc/ada/libgnat/s-parame__vxworks.ads +++ b/gcc/ada/libgnat/s-parame__vxworks.ads @@ -98,21 +98,6 @@ package System.Parameters is -- Indicates if secondary stacks can grow and shrink at run-time. If False, -- the size of a secondary stack is fixed at the point of its creation. - ------------------------------------ - -- Characteristics of time_t type -- - ------------------------------------ - - -- IMPORTANT NOTE: - -- Select the appropriate time_t_bits for the VSB in use, then rebuild - -- the runtime using instructions in adainclude/libada.gpr. - - -- time_t_bits : constant := Long_Integer'Size; - -- Number of bits in type time_t for SR0650 and before and SR0660 with - -- non-default configuration. - - time_t_bits : constant := Long_Long_Integer'Size; - -- Number of bits in type time_t for SR0660 with default configuration. - ---------------------------------------------- -- Characteristics of types in Interfaces.C -- ---------------------------------------------- diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c index 4f9ff2aac867..6b2190578071 100644 --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -1764,6 +1764,17 @@ CND(SIZEOF_tv_usec, "tv_usec") #endif CNS(MAX_tv_sec, "") } + +{ + struct timespec ts; +/* + -- Sizes (in bytes) of the components of struct timespec. + -- The tv_sec field is the same as in struct timeval. +*/ +#define SIZEOF_tv_nsec (sizeof (ts.tv_nsec)) +CND(SIZEOF_tv_nsec, "tv_nsec"); +} + /* -- Sizes of various data types -- 2.47.3