1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
2f08c3bdfSopenharmony_ci/*
3f08c3bdfSopenharmony_ci * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
4f08c3bdfSopenharmony_ci */
5f08c3bdfSopenharmony_ci/*\
6f08c3bdfSopenharmony_ci * [Description]
7f08c3bdfSopenharmony_ci *
8f08c3bdfSopenharmony_ci * This is a Phase I test for the times(2) system call.  It is intended to
9f08c3bdfSopenharmony_ci * provide a limited exposure of the system call.
10f08c3bdfSopenharmony_ci */
11f08c3bdfSopenharmony_ci
12f08c3bdfSopenharmony_ci#include <sys/times.h>
13f08c3bdfSopenharmony_ci#include <errno.h>
14f08c3bdfSopenharmony_ci#include "tst_test.h"
15f08c3bdfSopenharmony_ci
16f08c3bdfSopenharmony_cistatic void verify_times(void)
17f08c3bdfSopenharmony_ci{
18f08c3bdfSopenharmony_ci	struct tms mytimes;
19f08c3bdfSopenharmony_ci
20f08c3bdfSopenharmony_ci	TEST(times(&mytimes));
21f08c3bdfSopenharmony_ci
22f08c3bdfSopenharmony_ci	if (TST_RET == -1)
23f08c3bdfSopenharmony_ci		tst_res(TFAIL | TTERRNO, "times failed");
24f08c3bdfSopenharmony_ci	else
25f08c3bdfSopenharmony_ci		tst_res(TPASS, "times(&mytimes) returned %ld", TST_RET);
26f08c3bdfSopenharmony_ci}
27f08c3bdfSopenharmony_ci
28f08c3bdfSopenharmony_cistatic struct tst_test test = {
29f08c3bdfSopenharmony_ci	.test_all = verify_times,
30f08c3bdfSopenharmony_ci};
31