]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: add BACKLOG_MAX OS constant
authorMarc Poulhiès <poulhies@adacore.com>
Mon, 8 Sep 2025 14:42:48 +0000 (16:42 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 11 Sep 2025 09:10:50 +0000 (11:10 +0200)
BACKLOG_MAX represents the number of outstanding connections in the
socket's listen queue.

gcc/ada/ChangeLog:

* libgnat/g-socket.adb (Listen_Socket): Change default value.
* libgnat/g-socket.ads (Listen_Socket): Likewise.
* s-oscons-tmplt.c (BACKLOG_MAX): New.

gcc/ada/libgnat/g-socket.adb
gcc/ada/libgnat/g-socket.ads
gcc/ada/s-oscons-tmplt.c

index 0fed79177544d69c7dd9ed5f94445fa54c92f5af..303640f7fcca147ba108aa769a7156037deef0cd 100644 (file)
@@ -1958,7 +1958,7 @@ package body GNAT.Sockets is
 
    procedure Listen_Socket
      (Socket : Socket_Type;
-      Length : Natural := 15)
+      Length : Natural := SOSC.BACKLOG_MAX)
    is
       Res : constant C.int := C_Listen (C.int (Socket), C.int (Length));
    begin
index 1fe8a74ef11ed8cbeded3ee93a51f1207f903306..7c6534cd71c988d1075aa7658cd01521148a5d18 100644 (file)
@@ -1219,7 +1219,7 @@ package GNAT.Sockets is
 
    procedure Listen_Socket
      (Socket : Socket_Type;
-      Length : Natural := 15);
+      Length : Natural := SOSC.BACKLOG_MAX);
    --  To accept connections, a socket is first created with Create_Socket,
    --  a willingness to accept incoming connections and a queue Length for
    --  incoming connections are specified. Raise Socket_Error on error.
index 7a5e987cefc41629c3eb5778e190759215d60af4..4f9ff2aac867a527af0c8d88132524914e51c6a0 100644 (file)
@@ -1791,6 +1791,9 @@ struct sockaddr_un {
 #define SIZEOF_sockaddr_un (sizeof (struct sockaddr_un))
 CND(SIZEOF_sockaddr_un, "struct sockaddr_un")
 
+#define BACKLOG_MAX 15
+CND(BACKLOG_MAX, "number of outstanding connections in the socket's listen queue")
+
 #define SIZEOF_fd_set (sizeof (fd_set))
 CND(SIZEOF_fd_set, "fd_set")
 CND(FD_SETSIZE, "Max fd value")