tests: don't assume getdtablesize () <= 10000000
[gnulib.git] / tests / test-posix_spawn_file_actions_addclose.c
index ae14924..47b12d0 100644 (file)
@@ -23,6 +23,7 @@ SIGNATURE_CHECK (posix_spawn_file_actions_addclose, int,
                  (posix_spawn_file_actions_t *, int));
 
 #include <errno.h>
+#include <unistd.h>
 
 #include "macros.h"
 
@@ -40,7 +41,8 @@ main (void)
   }
   {
     errno = 0;
-    ASSERT (posix_spawn_file_actions_addclose (&actions, 10000000) == EBADF);
+    ASSERT (posix_spawn_file_actions_addclose (&actions, getdtablesize ())
+            == EBADF);
   }
 
   return 0;