OpenSSH 10.2p1 on OS X 10.3 (darwin 7)

Sevan Janiyan venture37+openssh at geeklan.co.uk
Thu Oct 16 20:32:56 AEDT 2025


Hi,
Managed to get OpenSSH 10.2p1 built on OS X 10.3 with OpenSSL 3.2.x, 
pretty much built out of the box with just one change needed for poll(2).

cc -std=gnu99 -g -O2 -pipe -Wall -Wpointer-arith -Wuninitialized 
-Wsign-compare -Wformat-security -Wno-unused-parameter 
-Wimplicit-fallthrough -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv 
-fno-builtin-memset   -fPIC -I. -I.. -I. -I./.. 
-I"/Users/sme/Downloads/openssh-10.2p1/openbsd-compat/include" 
-I/opt/tools/include  -DOPENSSL_API_COMPAT=0x10100000L -DHAVE_CONFIG_H 
-c bsd-poll.c
bsd-poll.c:101: error: conflicting types for `poll'
/usr/include/poll.h:96: error: previous declaration of `poll'

/usr/include/poll.h:
95 #if (__STDC__ > 0) || defined(__cplusplus)
96 extern int poll (struct pollfd *pArray, unsigned long n_fds, int 
timeout);
97 #else
98 extern int poll();
99 #endif

bsd-poll.c:
#if !defined(HAVE_POLL) || defined(BROKEN_POLL)
int
poll(struct pollfd *fds, nfds_t nfds, int timeout)
{
         struct timespec ts, *tsp = NULL;

         /* poll timeout is msec, ppoll is timespec (sec + nsec) */
         if (timeout >= 0) {
                 ts.tv_sec = timeout / 1000;
                 ts.tv_nsec = (timeout % 1000) * 1000000;
                 tsp = &ts;
         }

         return ppoll(fds, nfds, tsp, NULL);
}
#endif /* !HAVE_POLL || BROKEN_POLL */

OS doesn't come with nfds_t defined.
I changed  the signature in bsd-poll.c so nfds is unsigned long instead 
of nfds_t to match system header (bsd-poll.h, typedefs it to unsigned 
int if nfds_t is not available) and the build succeeded without issue.
All tests passed.
Submitted the survey from the system.


Sincerely,


Sevan


More information about the openssh-unix-dev mailing list