xref: /aosp_15_r20/external/ltp/lib/newlib_tests/test19.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) 2018, Linux Test Project
4  */
5 
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include "tst_test.h"
9 #include "tst_sys_conf.h"
10 
setup(void)11 static void setup(void)
12 {
13 	SAFE_FILE_PRINTF("/proc/sys/kernel/core_pattern", "changed");
14 	tst_sys_conf_dump();
15 }
16 
run(void)17 static void run(void)
18 {
19 	tst_res(TPASS, "OK");
20 }
21 
22 static struct tst_test test = {
23 	.needs_root = 1,
24 	.test_all = run,
25 	.setup = setup,
26 	.save_restore = (const struct tst_path_val[]) {
27 		{"/proc/nonexistent", NULL, TST_SR_SKIP},
28 		{"/proc/sys/kernel/numa_balancing", NULL, TST_SR_TBROK},
29 		{"/proc/sys/kernel/core_pattern", NULL, TST_SR_TCONF},
30 		{}
31 	},
32 };
33