xref: /aosp_15_r20/external/ltp/testcases/kernel/syscalls/sysfs/sysfs04.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-only
2*49cdfc7eSAndroid Build Coastguard Worker /*
3*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
4*49cdfc7eSAndroid Build Coastguard Worker  */
5*49cdfc7eSAndroid Build Coastguard Worker 
6*49cdfc7eSAndroid Build Coastguard Worker /*\
7*49cdfc7eSAndroid Build Coastguard Worker  * [Description]
8*49cdfc7eSAndroid Build Coastguard Worker  *
9*49cdfc7eSAndroid Build Coastguard Worker  * This test case checks whether sysfs(2) system call returns
10*49cdfc7eSAndroid Build Coastguard Worker  * appropriate error number for invalid option.
11*49cdfc7eSAndroid Build Coastguard Worker  */
12*49cdfc7eSAndroid Build Coastguard Worker 
13*49cdfc7eSAndroid Build Coastguard Worker #include <errno.h>
14*49cdfc7eSAndroid Build Coastguard Worker #include <sys/syscall.h>
15*49cdfc7eSAndroid Build Coastguard Worker #include "tst_test.h"
16*49cdfc7eSAndroid Build Coastguard Worker #include "lapi/syscalls.h"
17*49cdfc7eSAndroid Build Coastguard Worker 
18*49cdfc7eSAndroid Build Coastguard Worker #define INVALID_OPTION 100
19*49cdfc7eSAndroid Build Coastguard Worker 
verify_sysfs04(void)20*49cdfc7eSAndroid Build Coastguard Worker static void verify_sysfs04(void)
21*49cdfc7eSAndroid Build Coastguard Worker {
22*49cdfc7eSAndroid Build Coastguard Worker 	TST_EXP_FAIL(tst_syscall(__NR_sysfs, INVALID_OPTION),
23*49cdfc7eSAndroid Build Coastguard Worker 				EINVAL, "sysfs(INVALID_OPTION)");
24*49cdfc7eSAndroid Build Coastguard Worker }
25*49cdfc7eSAndroid Build Coastguard Worker 
26*49cdfc7eSAndroid Build Coastguard Worker static struct tst_test test = {
27*49cdfc7eSAndroid Build Coastguard Worker 	.test_all = verify_sysfs04,
28*49cdfc7eSAndroid Build Coastguard Worker };
29