xref: /kernel/linux/linux-6.6/tools/build/feature/test-timerfd.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-6.6/tools/build/feature/
162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * test for timerfd functions used by perf-kvm-stat-live
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci#include <sys/timerfd.h>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciint main(void)
862306a36Sopenharmony_ci{
962306a36Sopenharmony_ci	struct itimerspec new_value;
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci	int fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
1262306a36Sopenharmony_ci	if (fd < 0)
1362306a36Sopenharmony_ci		return 1;
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci	if (timerfd_settime(fd, 0, &new_value, NULL) != 0)
1662306a36Sopenharmony_ci		return 1;
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci	return 0;
1962306a36Sopenharmony_ci}
20

Indexes created Thu Nov 07 10:32:03 CST 2024