31 lines
		
	
	
		
			662 B
		
	
	
	
		
			C
		
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			662 B
		
	
	
	
		
			C
		
	
	
	
| // SPDX-License-Identifier: GPL-2.0-or-later
 | |
| /*
 | |
|  * Copyright (c) Crackerjack Project., 2007
 | |
|  * Ported from Crackerjack to LTP by Masatake YAMATO <yamato@redhat.com>
 | |
|  * Copyright (c) 2011 Cyril Hrubis <chrubis@suse.cz>
 | |
|  */
 | |
| 
 | |
| /*\
 | |
|  * [Description]
 | |
|  *
 | |
|  * Calls io_cancel() with one of the data structures points to invalid data and
 | |
|  * expects it to return EFAULT.
 | |
|  */
 | |
| 
 | |
| #include <linux/aio_abi.h>
 | |
| 
 | |
| #include "config.h"
 | |
| #include "tst_test.h"
 | |
| #include "lapi/syscalls.h"
 | |
| 
 | |
| static void run(void)
 | |
| {
 | |
| 	aio_context_t ctx;
 | |
| 	memset(&ctx, 0, sizeof(ctx));
 | |
| 	TST_EXP_FAIL(tst_syscall(__NR_io_cancel, ctx, NULL, NULL), EFAULT);
 | |
| }
 | |
| 
 | |
| static struct tst_test test = {
 | |
| 	.test_all = run,
 | |
| };
 |