Re: 2.6.21.5 june 30th to july 1st date hang?

Chris Friesen
2007-07-03T19:28:58Z

Arne Georg Gleditsch wrote:

> An interesting exercise might be to
> code up a small program to call adjtimex with timex.status |= STA_INS,
> to see if this can trigger the problem.

Setting the date to just before midnight June 30 UTC and then running the
following as root triggered the crash on a modified 2.6.10. Anyone see anything
wrong with the code below, or is this a valid indication of a bug in the leap
second code?

Chris

#include <sys/timex.h>
#include <stdio.h>
#include <errno.h>

struct timex buf;
int main(void)
{
int rc = adjtimex(&buf);
printf("initial status: 0x%x\n", buf.status);
buf.status |= STA_INS;
buf.modes = ADJ_STATUS;
rc = adjtimex(&buf);
if (rc == -1) {
printf("unable to set status: %m\n");
return -1;
} else
printf("rc: %d\n", rc);
printf("final status: 0x%x\n", buf.status);
return 0;
}