endif
LIBGNAT_TARGET_PAIRS += \
a-dirval.adb<libgnat/a-dirval__mingw.adb \
+ s-crtl.adb<libgnat/s-crtl__mingw.adb \
s-gloloc.adb<libgnat/s-gloloc__mingw.adb \
s-inmaop.adb<libgnarl/s-inmaop__dummy.adb \
s-taspri.ads<libgnarl/s-taspri__mingw.ads \
ada/libgnat/s-carun8.o \
ada/libgnat/s-casuti.o \
ada/libgnat/s-cautns.o \
- ada/libgnat/s-crtl.o \
ada/libgnat/s-conca2.o \
ada/libgnat/s-conca3.o \
ada/libgnat/s-conca4.o \
ada/libgnat/s-conca8.o \
ada/libgnat/s-conca9.o \
ada/libgnat/s-crc32.o \
+ ada/libgnat/s-crtl.o \
ada/libgnat/s-excdeb.o \
ada/libgnat/s-except.o \
ada/libgnat/s-excmac.o \
ada/libgnat/g-cstyin.o \
ada/libgnat/g-hesora.o \
ada/libgnat/g-htable.o \
- ada/libgnat/i-c.o \
+ ada/libgnat/i-c.o \
ada/libgnat/i-cstrin.o \
ada/libgnat/interfac.o \
ada/libgnat/s-addope.o \
ada/libgnat/s-conca8.o \
ada/libgnat/s-conca9.o \
ada/libgnat/s-crc32.o \
+ ada/libgnat/s-crtl.o \
ada/libgnat/s-excdeb.o \
ada/libgnat/s-except.o \
ada/libgnat/s-excmac.o \
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M . C R T L --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2003-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 --
+-- <http://www.gnu.org/licenses/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package body System.CRTL is
+
+ ----------
+ -- read --
+ ----------
+
+ function read (fd : int; buffer : chars; count : size_t) return ssize_t
+ is
+ function read_raw
+ (fd : int; buffer : chars; count : size_t) return ssize_t;
+ pragma Import (C, read_raw, "read");
+ begin
+ return read_raw (fd, buffer, count);
+ end read;
+
+ -----------
+ -- write --
+ -----------
+
+ function write (fd : int; buffer : chars; count : size_t) return ssize_t
+ is
+ function write_raw
+ (fd : int; buffer : chars; count : size_t) return ssize_t;
+ pragma Import (C, write_raw, "write");
+ begin
+ return write_raw (fd, buffer, count);
+ end write;
+
+end System.CRTL;
pragma Import (C, close, "close");
function read (fd : int; buffer : chars; count : size_t) return ssize_t;
- pragma Import (C, read, "read");
+ pragma Inline (read);
+ -- Different return types on Windows and Posix, requires body
function write (fd : int; buffer : chars; count : size_t) return ssize_t;
- pragma Import (C, write, "write");
+ pragma Inline (write);
+ -- Different return types on Windows and Posix, requires body
end System.CRTL;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M . C R T L --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2003-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 --
+-- <http://www.gnu.org/licenses/>. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the Windows specific version of the System.CRTL
+
+package body System.CRTL is
+
+ ----------
+ -- read --
+ ----------
+
+ function read (fd : int; buffer : chars; count : size_t) return ssize_t
+ is
+ function read_raw
+ (fd : int; buffer : chars; count : size_t) return int;
+ pragma Import (C, read_raw, "read");
+ begin
+ return ssize_t (read_raw (fd, buffer, count));
+ end read;
+
+ -----------
+ -- write --
+ -----------
+
+ function write (fd : int; buffer : chars; count : size_t) return ssize_t
+ is
+ function write_raw
+ (fd : int; buffer : chars; count : size_t) return int;
+ pragma Import (C, write_raw, "write");
+ begin
+ return ssize_t (write_raw (fd, buffer, count));
+ end write;
+
+end System.CRTL;