commit - b879254714ca5a54cb1fcabe7ee60802f4c7e9e2
commit + 4e457e622a3cc784da56111553ff67082014d33b
blob - fa4099bf92dcb65c227a7b617dbe12ae355cf7ce
blob + 26f15a0acdb7fca63a4345efbd1163deb204f9ba
--- compats.c
+++ compats.c
#endif /* HAVE_MEMSET_S */
#endif /* !HAVE_EXPLICIT_BZERO */
+#if !HAVE_GETDTABLESIZE
+/* public domain */
+#include <unistd.h>
+
+int
+getdtablesize(void)
+{
+ return sysconf(_SC_OPEN_MAX);
+}
+#endif /* !HAVE_GETDTABLESIZE */
#if !HAVE_GETPROGNAME
/*
* Copyright (c) 2016 Nicholas Marriott <nicholas.marriott@gmail.com>
blob - 42ff903a52b524754def669f90dfb577a765914e
blob + fc890e034e60584ffbbdb798b8235be8ad3af3dc
--- configure
+++ configure
HAVE_FLOCK=
HAVE_FREEZERO=
HAVE_GETDTABLECOUNT=
+HAVE_GETDTABLESIZE=
HAVE_GETEXECNAME=
HAVE_GETPROGNAME=
HAVE_INFTIM=
runtest flock FLOCK || true
runtest freezero FREEZERO || true
runtest getdtablecount GETDTABLECOUNT || true
+runtest getdtablesize GETDTABLESIZE || true
runtest getexecname GETEXECNAME || true
runtest getprogname GETPROGNAME || true
runtest INFTIM INFTIM || true
#define HAVE_FLOCK ${HAVE_FLOCK}
#define HAVE_FREEZERO ${HAVE_FREEZERO}
#define HAVE_GETDTABLECOUNT ${HAVE_GETDTABLECOUNT}
+#define HAVE_GETDTABLESIZE ${HAVE_GETDTABLESIZE}
#define HAVE_GETEXECNAME ${HAVE_GETEXECNAME}
#define HAVE_GETPROGNAME ${HAVE_GETPROGNAME}
#define HAVE_LIB_IMSG ${HAVE_LIB_IMSG}
#define getdtablecount() (0)
#endif
+#if !HAVE_GETDTABLESIZE
+int getdtablesize(void);
+#endif
+
#if !HAVE_OPTRESET
/* replace host' getopt with OpenBSD' one */
#define opterr BSDopterr
blob - 59b7b979f157153849d4d0dcd1db44b73979514d
blob + e4bbd7417e0dbdd9846f1afe0dfffed92d2a7fca
--- tests.c
+++ tests.c
return getdtablecount();
}
#endif /* TEST_GETDTABLECOUNT */
+#if TEST_GETDTABLESIZE
+#include <unistd.h>
+
+int
+main(void)
+{
+ return getdtablesize();
+}
+#endif /* TEST_GETDTABLESIZE */
#if TEST_GETEXECNAME
#include <stdlib.h>