Call for testing: OpenSSH-6.3

Darren Tucker dtucker at
Sat Aug 3 18:41:58 EST 2013

On Sat, Aug 3, 2013 at 5:58 PM, Damien Miller <djm at> wrote:
>>       Looking at failure logs - this is what's killing it:
>>       clock_gettime: Invalid argument
> Maybe these platforms lack CLOCK_MONOTONIC? Darren, perhaps we should
> wrap clock_gettime and have a fallback for platforms that lack this?

I thought we did.  We check for clock_gettime in configure, and misc.c has:

        [...] clock_getttime [...]
        return time(NULL);

So the fact that it compiled means that CLOCK_MONOTONIC is in the
headers, but the fact that it failed at runtime indicates that it's
not actually implemented.

Kevin, could you please try this test program on the problem system?
You'll probably need to compile it with -lrt.

#include <errno.h>
#include <stdio.h>
#include <time.h>
int main(void)
	struct timespec ts;
	int r = clock_gettime(CLOCK_MONOTONIC, &ts);
	printf("%d %d %ld\n", r, errno, (long)ts.tv_sec);

We could add a runtime fallback in misc.c:monotime() but it'd be kinda ugly.

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

More information about the openssh-unix-dev mailing list