OpenSSH 10.2p1 on OS X 10.3 (darwin 7)

Darren Tucker dtucker at dtucker.net
Thu Oct 16 22:02:53 AEDT 2025


On Thu, Oct 16, 2025 at 09:24:24PM +1100, Darren Tucker wrote:
[...]
> or have configure try to figure out which it is and use that.

I think this should do it.  Note that you will need to run "autoreconf"
to rebuild configure before running it.

diff --git a/configure.ac b/configure.ac
index db5211013..0c237ac78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3773,6 +3773,24 @@ AC_CHECK_TYPES([nfds_t], , , [
 #endif
 ])
 
+if test "x$ac_cv_type_nfds_t" != "xyes"; then
+	AC_MSG_CHECKING([if poll nfds_t is unsigned long])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#endif
+#ifdef HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#endif
+	    int poll(struct pollfd *, unsigned long, int timeout);
+	    ]], [[return poll(0, 0, 0);]])],
+	    AC_MSG_RESULT([yes]),
+	    [AC_DEFINE(POLL_NFDS_T_ULONG, 1, [Define if poll 2nd arg is ulong])
+	     AC_MSG_RESULT([no])]
+	)
+fi
+
 # Decide which sandbox style to use
 sandbox_arg=""
 AC_ARG_WITH([sandbox],
diff --git a/openbsd-compat/bsd-poll.h b/openbsd-compat/bsd-poll.h
index 67fd8c66f..bebd5d87d 100644
--- a/openbsd-compat/bsd-poll.h
+++ b/openbsd-compat/bsd-poll.h
@@ -72,7 +72,11 @@ typedef struct pollfd {
 #endif /* !HAVE_STRUCT_POLLFD_FD */
 
 #ifndef HAVE_NFDS_T
+# ifdef POLL_NFDS_T_ULONG
+typedef unsigned long	nfds_t;
+# else
 typedef unsigned int	nfds_t;
+# endif
 #endif
 
 #ifndef HAVE_POLL

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list