1 .TH llapi_param_get_value 3 "2020 Feb 24" "Lustre User API"
3 llapi_param_get_value \- read parameter files for Lustre to a buffer
6 .B #include <lustre/lustreapi.h>
8 .BI "int llapi_param_get_value(const char " "*path" ", char " "**buf" \
9 ", size_t " "*buflen" ");"
13 .B llapi_param_get_value()
14 function reads the contents of files in procfs, sysfs, etc. into a buffer.
15 If the buffer is preallocated, it will have a fixed size.
16 If the buffer is not preallocated, it will be automatically sized to fit
17 the contents of the file. There is also an option to query the size of a file.
20 .B llapi_param_get_value()
21 depends on the value of
25 is NULL, then the contents of
27 will not be saved into
29 but the number of bytes needed to hold the file will be stored in
31 This size will include the space needed for the NUL terminating byte.
32 However, the size of the file can change because it is dynamically generated.
33 This means that it's possible for the file size to increase which will cause
36 to still not be large enough when used in a subsequent call.
44 will point to an automatically allocated buffer that will hold the contents of
46 and buflen will hold the number of bytes written excluding the NUL terminating
55 is assumed to be a pre-allocated buffer of
57 size. The files contents will be put into
59 and the number of bytes written to
61 excluding the NUL terminating byte. In the case that
63 is too small to hold the NUL-terminated contents of the file,
65 will contain a suggested size for
67 This suggested size includes the NUL terminating byte, just as in the case where
77 error code on failure and sets errno appropriately.
93 are not NULL, and the pre-allocated buffer is too small.
98 is not NULL, but the buffer allocation failed
101 .BR llapi_get_param_paths (3),
103 .BR lctl-get_param (8)