tools/testing/selftests/timers/mqueue-lat.c

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/timers/mqueue-lat.c
Extension
.c
Size
2623 bytes
Lines
115
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 (ret < 0 && errno != ETIMEDOUT) {
			perror("mq_timedreceive");
			return -1;
		}
	}
	clock_gettime(CLOCK_MONOTONIC, &end);

	mq_close(q);

	if ((timespec_sub(start, end)/count) > TARGET_TIMEOUT + UNRESONABLE_LATENCY)
		return -1;

	return 0;
}

int main(int argc, char **argv)
{
	int ret;

	printf("Mqueue latency :                          ");
	fflush(stdout);

	ret = mqueue_lat_test();
	if (ret < 0) {
		printf("[FAILED]\n");
		ksft_exit_fail();
	}
	printf("[OK]\n");
	ksft_exit_pass();
}

Annotation

Implementation Notes