1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) Crackerjack Project., 2007
4 * Copyright (c) Manas Kumar Nayak maknayak@in.ibm.com>
5 * Copyright (C) 2021 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
6 */
7
8/*\
9 * [Description]
10 *
11 * Tests if waitid() syscall returns ECHILD when the calling process has no
12 * child processes.
13 */
14
15#include <sys/wait.h>
16#include "tst_test.h"
17
18static siginfo_t *infop;
19
20static void run(void)
21{
22	TST_EXP_FAIL(waitid(P_ALL, 0, infop, WNOHANG | WEXITED), ECHILD);
23}
24
25static struct tst_test test = {
26	.test_all = run,
27	.bufs = (struct tst_buffers[]) {
28		{&infop, .size = sizeof(*infop)},
29		{}
30	}
31};
32