xref: /third_party/musl/libc-test/src/functional/clock_gettime.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/libc-test/src/functional/
1570af302Sopenharmony_ci#include <time.h>
2570af302Sopenharmony_ci#include <errno.h>
3570af302Sopenharmony_ci#include <string.h>
4570af302Sopenharmony_ci#include "test.h"
5570af302Sopenharmony_ci
6570af302Sopenharmony_ci#define TEST(c, ...) \
7570af302Sopenharmony_ci	( (c) || (t_error(#c " failed: " __VA_ARGS__),0) )
8570af302Sopenharmony_ci
9570af302Sopenharmony_ciextern int __clock_gettime64(clockid_t, struct timespec *);
10570af302Sopenharmony_ci
11570af302Sopenharmony_ciint main()
12570af302Sopenharmony_ci{
13570af302Sopenharmony_ci	struct timespec ts;
14570af302Sopenharmony_ci	TEST(clock_gettime(CLOCK_REALTIME, &ts) == 0 && errno == 0, "%s\n", strerror(errno));
15570af302Sopenharmony_ci	TEST(__clock_gettime64(CLOCK_REALTIME, &ts) == 0 && errno == 0, "%s\n", strerror(errno));
16570af302Sopenharmony_ci	return t_status;
17570af302Sopenharmony_ci}
18

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