1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 2f08c3bdfSopenharmony_ci/* 3f08c3bdfSopenharmony_ci * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. 4f08c3bdfSopenharmony_ci */ 5f08c3bdfSopenharmony_ci 6f08c3bdfSopenharmony_ci/*\ 7f08c3bdfSopenharmony_ci * [Description] 8f08c3bdfSopenharmony_ci * 9f08c3bdfSopenharmony_ci * This test is run for option 2 for sysfs(2). 10f08c3bdfSopenharmony_ci * Translate the filesystem type index fs_index into a null-terminated filesystem 11f08c3bdfSopenharmony_ci * identifier string. This string will be written to the buffer pointed to by buf. 12f08c3bdfSopenharmony_ci * Make sure that buf has enough space to accept the string. 13f08c3bdfSopenharmony_ci */ 14f08c3bdfSopenharmony_ci 15f08c3bdfSopenharmony_ci#include <errno.h> 16f08c3bdfSopenharmony_ci#include <unistd.h> 17f08c3bdfSopenharmony_ci#include <sys/syscall.h> 18f08c3bdfSopenharmony_ci#include "tst_test.h" 19f08c3bdfSopenharmony_ci#include "lapi/syscalls.h" 20f08c3bdfSopenharmony_ci 21f08c3bdfSopenharmony_cistatic void verify_sysfs02(void) 22f08c3bdfSopenharmony_ci{ 23f08c3bdfSopenharmony_ci char buf[40]; 24f08c3bdfSopenharmony_ci 25f08c3bdfSopenharmony_ci TST_EXP_PASS(tst_syscall(__NR_sysfs, 2, 0, buf), "sysfs(2,0,buf)"); 26f08c3bdfSopenharmony_ci} 27f08c3bdfSopenharmony_ci 28f08c3bdfSopenharmony_cistatic struct tst_test test = { 29f08c3bdfSopenharmony_ci .test_all = verify_sysfs02, 30f08c3bdfSopenharmony_ci}; 31