Viewing: llapi_param_get_paths.3

.TH LLAPI_PARAM_GET_PATHS 3 2026-09-23 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_param_get_paths, llapi_param_get_paths_flags \- get a list of Lustre parameter file paths that match the given pattern
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.PP
.BI "int llapi_param_get_paths(const char *" pattern ", glob_t *" paths );
.PP
.BI "int llapi_param_get_paths_flags(const char *" pattern ", glob_t *" paths ,
.BI "                                enum llapi_param_flags " flags );
.fi
.SH DESCRIPTION
The
.B llapi_param_get_paths(\|)
function searches the locations in the filesystem that expose
Lustre parameters.
All file names that match
.I pattern
and are in
the correct locations in the file system are returned.
The paths should be freed with
.BR llapi_param_paths_free(\|) .
.PP
The
.B llapi_param_get_paths_flags(\|)
function is the same, but
.I flags
selects additional locations to search:
.TP
.B LLAPI_PARAM_MODULES
Also match
.I pattern
as
.IR MODULE / PARAM
against the kernel module parameters in
.BI /sys/module/ MODULE /parameters/ PARAM .
A wildcard
.I MODULE
only matches the Lustre and LNet modules.
.TP
.B LLAPI_PARAM_ALL
Search all of the above locations.
.PP
.B llapi_param_get_paths(\|)
is the same as
.B llapi_param_get_paths_flags(\|)
with
.I flags
of 0.
.SH RETURN VALUES
.TP
.B 0
on success with the parameter paths stored in
.IR paths .
.TP
-ve
error code on failure and sets errno appropriately.
.SH EXAMPLES
List the parameters matching lnet/*, including the LNet module
parameters.  The pattern uses the
.IR MODULE / PARAM
path form, not the
.IR MODULE . PARAM
form used by
.BR lctl (8):
.EX
        glob_t paths;
        int rc;
        int i;
\&
        rc = llapi_param_get_paths_flags("lnet/*", &paths,
                                         LLAPI_PARAM_MODULES);
        if (rc == 0) {
                for (i = 0; i < paths.gl_pathc; i++)
                        printf("%s\en", paths.gl_pathv[i]);
                llapi_param_paths_free(&paths);
        }
.EE
.SH AVAILABILITY
.B llapi_param_get_paths()
is part of the
.BR lustre (7)
user application interface library since release 2.14.0.
.\" Added in commit v2_13_53-8-g9b44cf70a9
.B llapi_param_get_paths_flags()
is available since release 2.18.0.
.SH SEE ALSO
.BR llapi_param_get_value (3),
.BR lustreapi (7),
.BR lctl-get_param (8)