tools/testing/selftests/timers/leapcrash.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/timers/leapcrash.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/timers/leapcrash.c
Extension
.c
Size
2274 bytes
Lines
109
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

if (settimeofday(&tv, NULL)) {
			printf("Error: You're likely not running with proper (ie: root) permissions\n");
			ksft_exit_fail();
		}
		tx.modes = 0;
		adjtimex(&tx);

		/* hammer on adjtime w/ STA_INS */
		while (tx.time.tv_sec < next_leap + 1) {
			/* Set the leap second insert flag */
			tx.modes = ADJ_STATUS;
			tx.status = STA_INS;
			adjtimex(&tx);
		}
		clear_time_state();
		printf(".");
		fflush(stdout);
	}
	printf("[OK]\n");
	ksft_exit_pass();
}

Annotation

Implementation Notes