• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) Crackerjack Project., 2007
4  * Ported from Crackerjack to LTP by Masatake YAMATO <yamato@redhat.com>
5  * Copyright (c) 2011 Cyril Hrubis <chrubis@suse.cz>
6  */
7 
8 /*\
9  * [Description]
10  *
11  * Test io_getevents invoked via syscall(2) with invalid ctx and expects it to
12  * return EINVAL.
13  */
14 
15 #include <linux/aio_abi.h>
16 
17 #include "config.h"
18 #include "tst_test.h"
19 #include "lapi/syscalls.h"
20 
run(void)21 static void run(void)
22 {
23 	aio_context_t ctx;
24 
25 	memset(&ctx, 0, sizeof(ctx));
26 	TST_EXP_FAIL2(tst_syscall(__NR_io_getevents, ctx, 0, 0, NULL, NULL), EINVAL,
27 		"io_getevents syscall with invalid ctx");
28 }
29 
30 static struct tst_test test = {
31 	.needs_kconfigs = (const char *[]) {
32 		"CONFIG_AIO=y",
33 		NULL
34 	},
35 	.test_all = run,
36 };
37