/* Demo leapsecond deadlock * by: John Stultz (john.stultz@linaro.org) * (C) Copyright IBM 2012 * (C) Copyright 2013, 2015 Linaro Limited * Licensed under the GPL * * This test demonstrates leapsecond deadlock that is possibe * on kernels from 2.6.26 to 3.3. * * WARNING: THIS WILL LIKELY HARDHANG SYSTEMS AND MAY LOSE DATA * RUN AT YOUR OWN RISK! * To build: * $ gcc leapcrash.c -o leapcrash -lrt */ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/time.h> #include <sys/timex.h> #include <string.h> #include <signal.h> #include "../kselftest.h" /* clear NTP time_status & time_state */
int clear_time_state(void) { struct timex tx; int ret; /* * We have to call adjtime twice here, as kernels * prior to 6b1859dba01c7 (included in 3.5 and * -stable), had an issue with the state machine * and wouldn't clear the STA_INS/DEL flag directly. */ tx.modes = ADJ_STATUS; tx.status = STA_PLL; ret = adjtimex(&tx); tx.modes = ADJ_STATUS; tx.status = 0; ret = adjtimex(&tx); return ret; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 58 | 100.00% | 1 | 100.00% |
Total | 58 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 196 | 100.00% | 1 | 100.00% |
Total | 196 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 297 | 100.00% | 1 | 100.00% |
Total | 297 | 100.00% | 1 | 100.00% |