2023-08-21 19:13:24 +00:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public
|
|
|
|
* License v2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 021110-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __COMMON_SYSFS_UTILS__
|
|
|
|
#define __COMMON_SYSFS_UTILS__
|
|
|
|
|
2023-08-28 20:12:13 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2023-08-21 19:13:24 +00:00
|
|
|
int sysfs_open_file(const char *name);
|
2023-12-08 21:43:59 +00:00
|
|
|
int sysfs_open_file_rw(const char *name);
|
2023-08-21 19:13:24 +00:00
|
|
|
int sysfs_open_fsid_file(int fd, const char *filename);
|
2023-12-08 21:43:59 +00:00
|
|
|
int sysfs_open_fsid_file_rw(int fd, const char *filename);
|
2023-08-21 19:13:24 +00:00
|
|
|
int sysfs_open_fsid_dir(int fd, const char *dirname);
|
2023-08-21 19:26:31 +00:00
|
|
|
int sysfs_read_fsid_file_u64(int fd, const char *name, u64 *value);
|
2023-12-08 21:43:59 +00:00
|
|
|
int sysfs_write_fsid_file_u64(int fd, const char *name, u64 value);
|
2023-08-21 19:26:31 +00:00
|
|
|
int sysfs_read_file(int fd, char *buf, size_t size);
|
2023-12-08 21:43:59 +00:00
|
|
|
int sysfs_write_file(int fd, const char *buf, size_t size);
|
2023-08-21 19:26:31 +00:00
|
|
|
int sysfs_read_file_u64(const char *name, u64 *value);
|
2023-12-08 21:43:59 +00:00
|
|
|
int sysfs_write_file_u64(const char *name, u64 value);
|
2023-08-21 19:13:24 +00:00
|
|
|
|
|
|
|
#endif
|