Commit 4491f0ae by Arnaud Charlet

Minor editing.

Update constants.
Update copyright notice.

From-SVN: r125479
parent a99ada67
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 1992-2007 Free Software Foundation, Inc. * * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * 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- * * terms of the GNU General Public License as published by the Free Soft- *
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. -- -- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -178,4 +178,17 @@ package GNAT.Sockets.Constants is ...@@ -178,4 +178,17 @@ package GNAT.Sockets.Constants is
SIZEOF_tv_sec : constant := 8; -- tv_sec SIZEOF_tv_sec : constant := 8; -- tv_sec
SIZEOF_tv_usec : constant := 8; -- tv_usec SIZEOF_tv_usec : constant := 8; -- tv_usec
----------------------------------------
-- Properties of supported interfaces --
----------------------------------------
Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
----------------------
-- Additional flags --
----------------------
Thread_Blocking_IO : constant Boolean := True;
-- Set False for contexts where socket i/o are process blocking
end GNAT.Sockets.Constants; end GNAT.Sockets.Constants;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. -- -- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -178,4 +178,17 @@ package GNAT.Sockets.Constants is ...@@ -178,4 +178,17 @@ package GNAT.Sockets.Constants is
SIZEOF_tv_sec : constant := 4; -- tv_sec SIZEOF_tv_sec : constant := 4; -- tv_sec
SIZEOF_tv_usec : constant := 4; -- tv_usec SIZEOF_tv_usec : constant := 4; -- tv_usec
----------------------------------------
-- Properties of supported interfaces --
----------------------------------------
Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
----------------------
-- Additional flags --
----------------------
Thread_Blocking_IO : constant Boolean := True;
-- Set False for contexts where socket i/o are process blocking
end GNAT.Sockets.Constants; end GNAT.Sockets.Constants;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. -- -- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -178,4 +178,17 @@ package GNAT.Sockets.Constants is ...@@ -178,4 +178,17 @@ package GNAT.Sockets.Constants is
SIZEOF_tv_sec : constant := 4; -- tv_sec SIZEOF_tv_sec : constant := 4; -- tv_sec
SIZEOF_tv_usec : constant := 4; -- tv_usec SIZEOF_tv_usec : constant := 4; -- tv_usec
----------------------------------------
-- Properties of supported interfaces --
----------------------------------------
Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
----------------------
-- Additional flags --
----------------------
Thread_Blocking_IO : constant Boolean := True;
-- Set False for contexts where socket i/o are process blocking
end GNAT.Sockets.Constants; end GNAT.Sockets.Constants;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . S O C K E T S . C O N S T A N T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2007, 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 2, 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. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides target dependent definitions of constant for use
-- by the GNAT.Sockets package (g-socket.ads). This package should not be
-- directly with'ed by an applications program.
-- This is the version for i386-elf-lynxos
-- This file is generated automatically, do not modify it by hand! Instead,
-- make changes to gen-soccon.c and re-run it on each target.
package GNAT.Sockets.Constants is
--------------
-- Families --
--------------
AF_INET : constant := 2; -- IPv4 address family
AF_INET6 : constant := 28; -- IPv6 address family
-----------
-- Modes --
-----------
SOCK_STREAM : constant := 1; -- Stream socket
SOCK_DGRAM : constant := 2; -- Datagram socket
-------------------
-- Socket errors --
-------------------
EACCES : constant := 13; -- Permission denied
EADDRINUSE : constant := 98; -- Address already in use
EADDRNOTAVAIL : constant := 99; -- Cannot assign address
EAFNOSUPPORT : constant := 97; -- Addr family not supported
EALREADY : constant := 114; -- Operation in progress
EBADF : constant := 9; -- Bad file descriptor
ECONNABORTED : constant := 103; -- Connection aborted
ECONNREFUSED : constant := 111; -- Connection refused
ECONNRESET : constant := 104; -- Connection reset by peer
EDESTADDRREQ : constant := 89; -- Destination addr required
EFAULT : constant := 14; -- Bad address
EHOSTDOWN : constant := 112; -- Host is down
EHOSTUNREACH : constant := 113; -- No route to host
EINPROGRESS : constant := 115; -- Operation now in progress
EINTR : constant := 4; -- Interrupted system call
EINVAL : constant := 22; -- Invalid argument
EIO : constant := 5; -- Input output error
EISCONN : constant := 106; -- Socket already connected
ELOOP : constant := 40; -- Too many symbolic lynks
EMFILE : constant := 24; -- Too many open files
EMSGSIZE : constant := 90; -- Message too long
ENAMETOOLONG : constant := 36; -- Name too long
ENETDOWN : constant := 100; -- Network is down
ENETRESET : constant := 102; -- Disconn. on network reset
ENETUNREACH : constant := 101; -- Network is unreachable
ENOBUFS : constant := 105; -- No buffer space available
ENOPROTOOPT : constant := 92; -- Protocol not available
ENOTCONN : constant := 107; -- Socket not connected
ENOTSOCK : constant := 88; -- Operation on non socket
EOPNOTSUPP : constant := 95; -- Operation not supported
EPFNOSUPPORT : constant := 96; -- Unknown protocol family
EPROTONOSUPPORT : constant := 93; -- Unknown protocol
EPROTOTYPE : constant := 91; -- Unknown protocol type
ESHUTDOWN : constant := 108; -- Cannot send once shutdown
ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
ETIMEDOUT : constant := 110; -- Connection timed out
ETOOMANYREFS : constant := 109; -- Too many references
EWOULDBLOCK : constant := 11; -- Operation would block
-----------------
-- Host errors --
-----------------
HOST_NOT_FOUND : constant := 1; -- Unknown host
TRY_AGAIN : constant := 2; -- Host name lookup failure
NO_DATA : constant := 4; -- No data record for name
NO_RECOVERY : constant := 3; -- Non recoverable errors
-------------------
-- Control flags --
-------------------
FIONBIO : constant := 21537; -- Set/clear non-blocking io
FIONREAD : constant := 21531; -- How many bytes to read
--------------------
-- Shutdown modes --
--------------------
SHUT_RD : constant := 0; -- No more recv
SHUT_WR : constant := 1; -- No more send
SHUT_RDWR : constant := 2; -- No more recv/send
---------------------
-- Protocol levels --
---------------------
SOL_SOCKET : constant := 65535; -- Options for socket level
IPPROTO_IP : constant := 0; -- Dummy protocol for IP
IPPROTO_UDP : constant := 17; -- UDP
IPPROTO_TCP : constant := 6; -- TCP
-------------------
-- Request flags --
-------------------
MSG_OOB : constant := 1; -- Process out-of-band data
MSG_PEEK : constant := 2; -- Peek at incoming data
MSG_EOR : constant := 128; -- Send end of record
MSG_WAITALL : constant := 256; -- Wait for full reception
MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
MSG_Forced_Flags : constant := 0;
-- Flags set on all send(2) calls
--------------------
-- Socket options --
--------------------
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
SO_SNDBUF : constant := 4097; -- Set/get send buffer size
SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
SO_SNDTIMEO : constant := 4101; -- Emission timeout
SO_RCVTIMEO : constant := 4102; -- Reception timeout
SO_ERROR : constant := 4103; -- Get/clear error status
IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
-------------------
-- System limits --
-------------------
IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
----------------------
-- Type definitions --
----------------------
-- Sizes (in bytes) of the components of struct timeval
SIZEOF_tv_sec : constant := 4; -- tv_sec
SIZEOF_tv_usec : constant := 4; -- tv_usec
----------------------------------------
-- Properties of supported interfaces --
----------------------------------------
Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
----------------------
-- Additional flags --
----------------------
Thread_Blocking_IO : constant Boolean := True;
-- Set False for contexts where socket i/o are process blocking
end GNAT.Sockets.Constants;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2006, AdaCore -- -- Copyright (C) 2001-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -37,10 +37,8 @@ ...@@ -37,10 +37,8 @@
-- This version is for NT -- This version is for NT
with GNAT.Sockets.Constants; use GNAT.Sockets.Constants; with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C.Strings; use Interfaces.C.Strings; with System; use System;
with System; use System;
package body GNAT.Sockets.Thin is package body GNAT.Sockets.Thin is
...@@ -51,11 +49,6 @@ package body GNAT.Sockets.Thin is ...@@ -51,11 +49,6 @@ package body GNAT.Sockets.Thin is
WS_Version : constant := 16#0202#; WS_Version : constant := 16#0202#;
Initialized : Boolean := False; Initialized : Boolean := False;
SYSNOTREADY : constant := 10091;
VERNOTSUPPORTED : constant := 10092;
NOTINITIALISED : constant := 10093;
EDISCON : constant := 10101;
function Standard_Connect function Standard_Connect
(S : C.int; (S : C.int;
Name : System.Address; Name : System.Address;
...@@ -108,10 +101,10 @@ package body GNAT.Sockets.Thin is ...@@ -108,10 +101,10 @@ package body GNAT.Sockets.Thin is
N_ENAMETOOLONG, N_ENAMETOOLONG,
N_EHOSTDOWN, N_EHOSTDOWN,
N_EHOSTUNREACH, N_EHOSTUNREACH,
N_SYSNOTREADY, N_WSASYSNOTREADY,
N_VERNOTSUPPORTED, N_WSAVERNOTSUPPORTED,
N_NOTINITIALISED, N_WSANOTINITIALISED,
N_EDISCON, N_WSAEDISCON,
N_HOST_NOT_FOUND, N_HOST_NOT_FOUND,
N_TRY_AGAIN, N_TRY_AGAIN,
N_NO_RECOVERY, N_NO_RECOVERY,
...@@ -199,20 +192,20 @@ package body GNAT.Sockets.Thin is ...@@ -199,20 +192,20 @@ package body GNAT.Sockets.Thin is
New_String ("Host is down"), New_String ("Host is down"),
N_EHOSTUNREACH => N_EHOSTUNREACH =>
New_String ("No route to host"), New_String ("No route to host"),
N_SYSNOTREADY => N_WSASYSNOTREADY =>
New_String ("Returned by WSAStartup(), indicating that " New_String ("Returned by WSAStartup(), indicating that "
& "the network subsystem is unusable"), & "the network subsystem is unusable"),
N_VERNOTSUPPORTED => N_WSAVERNOTSUPPORTED =>
New_String ("Returned by WSAStartup(), indicating that " New_String ("Returned by WSAStartup(), indicating that "
& "the Windows Sockets DLL cannot support " & "the Windows Sockets DLL cannot support "
& "this application"), & "this application"),
N_NOTINITIALISED => N_WSANOTINITIALISED =>
New_String ("Winsock not initialized. This message is " New_String ("Winsock not initialized. This message is "
& "returned by any function except WSAStartup(), " & "returned by any function except WSAStartup(), "
& "indicating that a successful WSAStartup() has " & "indicating that a successful WSAStartup() has "
& "not yet been performed"), & "not yet been performed"),
N_EDISCON => N_WSAEDISCON =>
New_String ("Disconnect"), New_String ("Disconnected"),
N_HOST_NOT_FOUND => N_HOST_NOT_FOUND =>
New_String ("Host not found. This message indicates " New_String ("Host not found. This message indicates "
& "that the key (name, address, and so on) was not found"), & "that the key (name, address, and so on) was not found"),
...@@ -245,8 +238,8 @@ package body GNAT.Sockets.Thin is ...@@ -245,8 +238,8 @@ package body GNAT.Sockets.Thin is
Res := Standard_Connect (S, Name, Namelen); Res := Standard_Connect (S, Name, Namelen);
if Res = -1 then if Res = -1 then
if Socket_Errno = EWOULDBLOCK then if Socket_Errno = Constants.EWOULDBLOCK then
Set_Socket_Errno (EINPROGRESS); Set_Socket_Errno (Constants.EINPROGRESS);
end if; end if;
end if; end if;
...@@ -347,7 +340,7 @@ package body GNAT.Sockets.Thin is ...@@ -347,7 +340,7 @@ package body GNAT.Sockets.Thin is
if EFS /= No_Fd_Set then if EFS /= No_Fd_Set then
declare declare
EFSC : constant Fd_Set_Access := New_Socket_Set (EFS); EFSC : constant Fd_Set_Access := New_Socket_Set (EFS);
Flag : constant C.int := MSG_PEEK + MSG_OOB; Flag : constant C.int := Constants.MSG_PEEK + Constants.MSG_OOB;
Buffer : Character; Buffer : Character;
Length : C.int; Length : C.int;
Fromlen : aliased C.int; Fromlen : aliased C.int;
...@@ -404,31 +397,6 @@ package body GNAT.Sockets.Thin is ...@@ -404,31 +397,6 @@ package body GNAT.Sockets.Thin is
return Res; return Res;
end C_Select; end C_Select;
-----------------
-- C_Inet_Addr --
-----------------
function C_Inet_Addr
(Cp : C.Strings.chars_ptr) return C.int
is
use type C.unsigned_long;
function Internal_Inet_Addr
(Cp : C.Strings.chars_ptr) return C.unsigned_long;
pragma Import (Stdcall, Internal_Inet_Addr, "inet_addr");
Res : C.unsigned_long;
begin
Res := Internal_Inet_Addr (Cp);
if Res = C.unsigned_long'Last then
-- This value is returned in case of error
return -1;
else
return C.int (Internal_Inet_Addr (Cp));
end if;
end C_Inet_Addr;
-------------- --------------
-- C_Writev -- -- C_Writev --
-------------- --------------
...@@ -474,19 +442,34 @@ package body GNAT.Sockets.Thin is ...@@ -474,19 +442,34 @@ package body GNAT.Sockets.Thin is
end if; end if;
end Finalize; end Finalize;
-------------------------
-- Host_Error_Messages --
-------------------------
package body Host_Error_Messages is
-- On Windows, socket and host errors share the same code space, and
-- error messages are provided by Socket_Error_Message. The default
-- separate body for Host_Error_Messages is therefore not used in
-- this case.
function Host_Error_Message
(H_Errno : Integer) return C.Strings.chars_ptr
renames Socket_Error_Message;
end Host_Error_Messages;
---------------- ----------------
-- Initialize -- -- Initialize --
---------------- ----------------
procedure Initialize (Process_Blocking_IO : Boolean) is procedure Initialize is
pragma Unreferenced (Process_Blocking_IO); use type Interfaces.C.int;
Return_Value : Interfaces.C.int; Return_Value : Interfaces.C.int;
begin begin
if not Initialized then if not Initialized then
Return_Value := WSAStartup (WS_Version, WSAData_Dummy'Address); Return_Value := WSAStartup (WS_Version, WSAData_Dummy'Address);
pragma Assert (Interfaces.C."=" (Return_Value, 0)); pragma Assert (Return_Value = 0);
Initialized := True; Initialized := True;
end if; end if;
end Initialize; end Initialize;
...@@ -555,6 +538,7 @@ package body GNAT.Sockets.Thin is ...@@ -555,6 +538,7 @@ package body GNAT.Sockets.Thin is
function Socket_Error_Message function Socket_Error_Message
(Errno : Integer) return C.Strings.chars_ptr (Errno : Integer) return C.Strings.chars_ptr
is is
use GNAT.Sockets.Constants;
begin begin
case Errno is case Errno is
when EINTR => return Error_Messages (N_EINTR); when EINTR => return Error_Messages (N_EINTR);
...@@ -594,14 +578,23 @@ package body GNAT.Sockets.Thin is ...@@ -594,14 +578,23 @@ package body GNAT.Sockets.Thin is
when ENAMETOOLONG => return Error_Messages (N_ENAMETOOLONG); when ENAMETOOLONG => return Error_Messages (N_ENAMETOOLONG);
when EHOSTDOWN => return Error_Messages (N_EHOSTDOWN); when EHOSTDOWN => return Error_Messages (N_EHOSTDOWN);
when EHOSTUNREACH => return Error_Messages (N_EHOSTUNREACH); when EHOSTUNREACH => return Error_Messages (N_EHOSTUNREACH);
when SYSNOTREADY => return Error_Messages (N_SYSNOTREADY);
when VERNOTSUPPORTED => return Error_Messages (N_VERNOTSUPPORTED); -- Windows-specific error codes
when NOTINITIALISED => return Error_Messages (N_NOTINITIALISED);
when EDISCON => return Error_Messages (N_EDISCON); when WSASYSNOTREADY => return Error_Messages (N_WSASYSNOTREADY);
when WSAVERNOTSUPPORTED =>
return Error_Messages (N_WSAVERNOTSUPPORTED);
when WSANOTINITIALISED =>
return Error_Messages (N_WSANOTINITIALISED);
when WSAEDISCON => return Error_Messages (N_WSAEDISCON);
-- h_errno values
when HOST_NOT_FOUND => return Error_Messages (N_HOST_NOT_FOUND); when HOST_NOT_FOUND => return Error_Messages (N_HOST_NOT_FOUND);
when TRY_AGAIN => return Error_Messages (N_TRY_AGAIN); when TRY_AGAIN => return Error_Messages (N_TRY_AGAIN);
when NO_RECOVERY => return Error_Messages (N_NO_RECOVERY); when NO_RECOVERY => return Error_Messages (N_NO_RECOVERY);
when NO_DATA => return Error_Messages (N_NO_DATA); when NO_DATA => return Error_Messages (N_NO_DATA);
when others => return Error_Messages (N_OTHERS); when others => return Error_Messages (N_OTHERS);
end case; end case;
end Socket_Error_Message; end Socket_Error_Message;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2006, AdaCore -- -- Copyright (C) 2001-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -62,12 +62,21 @@ package GNAT.Sockets.Thin is ...@@ -62,12 +62,21 @@ package GNAT.Sockets.Thin is
function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr; function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr;
-- Returns the error message string for the error number Errno. If Errno is -- Returns the error message string for the error number Errno. If Errno is
-- not known it returns "Unknown system error". -- not known, returns "Unknown system error".
function Host_Errno return Integer; function Host_Errno return Integer;
pragma Import (C, Host_Errno, "__gnat_get_h_errno"); pragma Import (C, Host_Errno, "__gnat_get_h_errno");
-- Returns last host error number -- Returns last host error number
package Host_Error_Messages is
function Host_Error_Message
(H_Errno : Integer) return C.Strings.chars_ptr;
-- Returns the error message string for the host error number H_Errno.
-- If H_Errno is not known, returns "Unknown system error".
end Host_Error_Messages;
subtype Fd_Set_Access is System.Address; subtype Fd_Set_Access is System.Address;
No_Fd_Set : constant Fd_Set_Access := System.Null_Address; No_Fd_Set : constant Fd_Set_Access := System.Null_Address;
...@@ -109,8 +118,11 @@ package GNAT.Sockets.Thin is ...@@ -109,8 +118,11 @@ package GNAT.Sockets.Thin is
type In_Addr is record type In_Addr is record
S_B1, S_B2, S_B3, S_B4 : C.unsigned_char; S_B1, S_B2, S_B3, S_B4 : C.unsigned_char;
end record; end record;
for In_Addr'Alignment use C.int'Alignment;
pragma Convention (C, In_Addr); pragma Convention (C, In_Addr);
-- Internet address -- IPv4 address, represented as a network-order C.int. Note that the
-- underlying operating system may assume that values of this type have
-- C.int alignment, so we need to provide a suitable alignment clause here.
type In_Addr_Access is access all In_Addr; type In_Addr_Access is access all In_Addr;
pragma Convention (C, In_Addr_Access); pragma Convention (C, In_Addr_Access);
...@@ -217,6 +229,10 @@ package GNAT.Sockets.Thin is ...@@ -217,6 +229,10 @@ package GNAT.Sockets.Thin is
-- Indices into an Fd_Pair value providing access to each of the connected -- Indices into an Fd_Pair value providing access to each of the connected
-- file descriptors. -- file descriptors.
--------------------------------
-- Standard library functions --
--------------------------------
function C_Accept function C_Accept
(S : C.int; (S : C.int;
Addr : System.Address; Addr : System.Address;
...@@ -235,14 +251,6 @@ package GNAT.Sockets.Thin is ...@@ -235,14 +251,6 @@ package GNAT.Sockets.Thin is
Name : System.Address; Name : System.Address;
Namelen : C.int) return C.int; Namelen : C.int) return C.int;
function C_Gethostbyaddr
(Addr : System.Address;
Len : C.int;
Typ : C.int) return Hostent_Access;
function C_Gethostbyname
(Name : C.char_array) return Hostent_Access;
function C_Gethostname function C_Gethostname
(Name : System.Address; (Name : System.Address;
Namelen : C.int) return C.int; Namelen : C.int) return C.int;
...@@ -252,14 +260,6 @@ package GNAT.Sockets.Thin is ...@@ -252,14 +260,6 @@ package GNAT.Sockets.Thin is
Name : System.Address; Name : System.Address;
Namelen : not null access C.int) return C.int; Namelen : not null access C.int) return C.int;
function C_Getservbyname
(Name : C.char_array;
Proto : C.char_array) return Servent_Access;
function C_Getservbyport
(Port : C.int;
Proto : C.char_array) return Servent_Access;
function C_Getsockname function C_Getsockname
(S : C.int; (S : C.int;
Name : System.Address; Name : System.Address;
...@@ -355,6 +355,10 @@ package GNAT.Sockets.Thin is ...@@ -355,6 +355,10 @@ package GNAT.Sockets.Thin is
(WS_Version : Interfaces.C.int; (WS_Version : Interfaces.C.int;
WSADataAddress : System.Address) return Interfaces.C.int; WSADataAddress : System.Address) return Interfaces.C.int;
-------------------------------------------------------
-- Signalling file descriptors for selector abortion --
-------------------------------------------------------
package Signalling_Fds is package Signalling_Fds is
function Create (Fds : not null access Fd_Pair) return C.int; function Create (Fds : not null access Fd_Pair) return C.int;
...@@ -372,8 +376,16 @@ package GNAT.Sockets.Thin is ...@@ -372,8 +376,16 @@ package GNAT.Sockets.Thin is
-- Write one byte of data to wsig, the write end of a pair of signalling -- Write one byte of data to wsig, the write end of a pair of signalling
-- fds created by Create_Signalling_Fds. -- fds created by Create_Signalling_Fds.
procedure Close (Sig : C.int);
pragma Convention (C, Close);
-- Close one end of a pair of signalling fds (ignoring any error)
end Signalling_Fds; end Signalling_Fds;
----------------------------
-- Socket sets management --
----------------------------
procedure Free_Socket_Set procedure Free_Socket_Set
(Set : Fd_Set_Access); (Set : Fd_Set_Access);
-- Free system-dependent socket set -- Free system-dependent socket set
...@@ -382,11 +394,11 @@ package GNAT.Sockets.Thin is ...@@ -382,11 +394,11 @@ package GNAT.Sockets.Thin is
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
Socket : Int_Access; Socket : Int_Access;
Last : Int_Access); Last : Int_Access);
-- Get last socket in Socket and remove it from the socket -- Get last socket in Socket and remove it from the socket set. The
-- set. The parameter Last is a maximum value of the largest -- parameter Last is a maximum value of the largest socket. This hint is
-- socket. This hint is used to avoid scanning very large socket -- used to avoid scanning very large socket sets. After a call to
-- sets. After a call to Get_Socket_From_Set, Last is set back to -- Get_Socket_From_Set, Last is set back to the real largest socket in the
-- the real largest socket in the socket set. -- socket set.
procedure Insert_Socket_In_Set procedure Insert_Socket_In_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
...@@ -421,21 +433,18 @@ package GNAT.Sockets.Thin is ...@@ -421,21 +433,18 @@ package GNAT.Sockets.Thin is
procedure WSACleanup; procedure WSACleanup;
procedure Initialize;
procedure Finalize; procedure Finalize;
procedure Initialize (Process_Blocking_IO : Boolean);
private private
pragma Import (Stdcall, C_Accept, "accept"); pragma Import (Stdcall, C_Accept, "accept");
pragma Import (Stdcall, C_Bind, "bind"); pragma Import (Stdcall, C_Bind, "bind");
pragma Import (Stdcall, C_Close, "closesocket"); pragma Import (Stdcall, C_Close, "closesocket");
pragma Import (Stdcall, C_Gethostbyaddr, "gethostbyaddr");
pragma Import (Stdcall, C_Gethostbyname, "gethostbyname");
pragma Import (Stdcall, C_Gethostname, "gethostname"); pragma Import (Stdcall, C_Gethostname, "gethostname");
pragma Import (Stdcall, C_Getpeername, "getpeername"); pragma Import (Stdcall, C_Getpeername, "getpeername");
pragma Import (Stdcall, C_Getservbyname, "getservbyname");
pragma Import (Stdcall, C_Getservbyport, "getservbyport");
pragma Import (Stdcall, C_Getsockname, "getsockname"); pragma Import (Stdcall, C_Getsockname, "getsockname");
pragma Import (Stdcall, C_Getsockopt, "getsockopt"); pragma Import (Stdcall, C_Getsockopt, "getsockopt");
pragma Import (Stdcall, C_Inet_Addr, "inet_addr");
pragma Import (Stdcall, C_Ioctl, "ioctlsocket"); pragma Import (Stdcall, C_Ioctl, "ioctlsocket");
pragma Import (Stdcall, C_Listen, "listen"); pragma Import (Stdcall, C_Listen, "listen");
pragma Import (Stdcall, C_Recv, "recv"); pragma Import (Stdcall, C_Recv, "recv");
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1998-2005 AdaCore -- -- Copyright (C) 1998-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -133,7 +133,7 @@ package GNAT.Threads is ...@@ -133,7 +133,7 @@ package GNAT.Threads is
-- extern void __gnat_get_thread (void *id, pthread_t *thread); -- extern void __gnat_get_thread (void *id, pthread_t *thread);
function To_Task_Id function To_Task_Id
(Id : System.Address) (Id : System.Address)
return Ada.Task_Identification.Task_Id; return Ada.Task_Identification.Task_Id;
-- Ada interface only. -- Ada interface only.
-- Given a low level Id, as returned by Create_Thread, return a Task_Id, -- Given a low level Id, as returned by Create_Thread, return a Task_Id,
......
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- INTERFACES.FORTRAN.BLAS --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006, 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 2, 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. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Version for Mac OS X
package body Interfaces.Fortran.BLAS is
pragma Linker_Options ("-Wl,-framework,vecLib");
end Interfaces.Fortran.BLAS;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- I N T E R F A C E S . F O R T R A N . B L A S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006, 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 2, 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. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- For platforms without, or with unknown libraries, no libraries are linked
-- by default. The user has to specify the required BLAS and LAPACK libraries
-- explicitly on the command line.
package body Interfaces.Fortran.BLAS is
end Interfaces.Fortran.BLAS;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Header File * * C Header File *
* * * *
* Copyright (C) 2002-2006, Free Software Foundation, Inc. * * Copyright (C) 2002-2007, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * 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- * * terms of the GNU General Public License as published by the Free Soft- *
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -291,6 +291,9 @@ package Nlists is ...@@ -291,6 +291,9 @@ package Nlists is
procedure Lock; procedure Lock;
-- Called to lock tables before back end is called -- Called to lock tables before back end is called
procedure Unlock;
-- Unlock tables, in cases where the back end needs to modify them
procedure Tree_Read; procedure Tree_Read;
-- Initializes internal tables from current tree file using the relevant -- Initializes internal tables from current tree file using the relevant
-- Table.Tree_Read routines. Note that Initialize should not be called if -- Table.Tree_Read routines. Note that Initialize should not be called if
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment