file operation functions
More...
◆ spdk_posix_file_load()
void * spdk_posix_file_load |
( |
FILE * | file, |
|
|
size_t * | size ) |
Load the input file content into a data buffer.
- Parameters
-
file | File handle. |
size | Size of bytes read from the file. |
- Returns
- data contains the content on success, NULL on failure.
◆ spdk_posix_file_load_from_name()
void * spdk_posix_file_load_from_name |
( |
const char * | file_name, |
|
|
size_t * | size ) |
Load content of a given file name into a data buffer.
- Parameters
-
file_name | File name. |
size | Size of bytes read from the file. |
- Returns
- data containing the content on success, NULL on failure.
◆ spdk_read_sysfs_attribute()
int spdk_read_sysfs_attribute |
( |
char ** | attribute, |
|
|
const char * | path_format, |
|
|
| ... ) |
Get the string value for a given sysfs attribute path.
When successful, the returned string will be null-terminated, without a trailing newline.
- Parameters
-
attribute | output parameter for contents of the attribute; caller must free() the buffer pointed to by attribute at some point after a successful call |
path_format | format string for constructing patch to sysfs file |
- Returns
- 0 on success negative errno if unable to read the attribute
◆ spdk_read_sysfs_attribute_uint32()
int spdk_read_sysfs_attribute_uint32 |
( |
uint32_t * | attribute, |
|
|
const char * | path_format, |
|
|
| ... ) |
Get the uint32 value for a given sysfs attribute path.
- Parameters
-
attribute | output parameter for contents of the attribute |
path_format | format string for constructing patch to sysfs file |
- Returns
- 0 on success negative errno if unable to read the attribute or it is not a uint32