-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2008, AdaCore --
+-- Copyright (C) 2001-2009, 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- --
package C renames Interfaces.C;
+ use type C.size_t;
+ type ssize_t is range -(2 ** (C.size_t'Size - 1))
+ .. +(2 ** (C.size_t'Size - 1) - 1);
+ -- Signed type of the same size as size_t
+
function Socket_Errno return Integer renames GNAT.OS_Lib.Errno;
-- Returns last socket error number
Optval : System.Address;
Optlen : not null access C.int) return C.int;
- function C_Inet_Addr
- (Cp : C.Strings.chars_ptr) return C.int;
-
- function C_Ioctl
- (S : C.int;
- Req : C.int;
- Arg : access C.int) return C.int;
+ function Socket_Ioctl
+ (S : C.int;
+ Req : C.int;
+ Arg : access C.int) return C.int;
function C_Listen
(S : C.int;
Backlog : C.int) return C.int;
- function C_Readv
- (Fd : C.int;
- Iov : System.Address;
- Iovcnt : C.int) return C.int;
-
function C_Recv
(S : C.int;
Msg : System.Address;
Msg : System.Address;
Len : C.int;
Flags : C.int;
- From : Sockaddr_In_Access;
+ From : System.Address;
Fromlen : not null access C.int) return C.int;
+ function C_Recvmsg
+ (S : C.int;
+ Msg : System.Address;
+ Flags : C.int) return ssize_t;
+
function C_Select
(Nfds : C.int;
Readfds : access Fd_Set;
Exceptfds : access Fd_Set;
Timeout : Timeval_Access) return C.int;
- function C_Send
+ function C_Sendmsg
(S : C.int;
Msg : System.Address;
- Len : C.int;
- Flags : C.int) return C.int;
+ Flags : C.int) return ssize_t;
function C_Sendto
(S : C.int;
Msg : System.Address;
Len : C.int;
Flags : C.int;
- To : Sockaddr_In_Access;
+ To : System.Address;
Tolen : C.int) return C.int;
function C_Setsockopt
Typ : C.int;
Protocol : C.int) return C.int;
- function C_Strerror
- (Errnum : C.int) return C.Strings.chars_ptr;
-
function C_System
(Command : System.Address) return C.int;
- function C_Writev
- (Fd : C.int;
- Iov : System.Address;
- Iovcnt : C.int) return C.int;
-
-------------------------------------------------------
-- Signalling file descriptors for selector abortion --
-------------------------------------------------------
pragma Import (C, C_Getpeername, "getpeername");
pragma Import (C, C_Getsockname, "getsockname");
pragma Import (C, C_Getsockopt, "getsockopt");
- pragma Import (C, C_Inet_Addr, "inet_addr");
pragma Import (C, C_Listen, "listen");
- pragma Import (C, C_Readv, "readv");
pragma Import (C, C_Select, "select");
pragma Import (C, C_Setsockopt, "setsockopt");
pragma Import (C, C_Shutdown, "shutdown");
- pragma Import (C, C_Strerror, "strerror");
pragma Import (C, C_System, "system");
- pragma Import (C, C_Writev, "writev");
pragma Import (C, Nonreentrant_Gethostbyname, "gethostbyname");
pragma Import (C, Nonreentrant_Gethostbyaddr, "gethostbyaddr");