LLAPI_FIND_PARAM_ALLOC(3)
π LLAPI_FIND_PARAM_ALLOC π
okay bestie, welcome to the Lustre Library Functions section of the manual β yes this is a section 3 page, yes it's iconic, let's get into it π
llapi_find_param_alloc,llapi_find_param_freeβ allocate and freestruct find_paramobjects π
β¨ SYNOPSIS β¨
#include <lustre/lustreapi.h>
struct find_param *llapi_find_param_alloc(void);
void llapi_find_param_free(struct find_param *param);
πΈ DESCRIPTION πΈ
okay so first up: llapi_find_param_alloc() hands you back a pointer to a freshly-allocated struct find_param. and what is a struct find_param, you ask? it's the whole vibe-setter β it holds the parameters that decide which files match a search and how the matching files get displayed. you're gonna pass it into later calls to llapi_find(3), llapi_getstripe(3), and all the other functions declared in <lustre/lustreapi.h> that take a struct find_param argument π¦
the returned struct find_param object comes back zero-filled, and then you β the caller β set the fields describing the search you want before handing it off to one of those functions up there. and bestie, listen: applications should get their struct find_param from llapi_find_param_alloc() rather than just declaring one directly, so the allocation always matches the size of the struct find_param used by the running library β even if your app was built against an older <lustre/lustreapi.h> header. no mismatched sizes, no chaos, periodt. and when you're done with that pointer, free it with llapi_find_param_free() π
now, llapi_find_param_free() frees the memory associated with param, which must have come from an earlier call to llapi_find_param_alloc(). if param is NULL, nothing happens, no action taken, we move on gracefully π. heads up though: memory referenced by fields of the structure is not freed, and it stays owned by the caller. and pls use this instead of free(3) β like, actually β because that keeps your application compatible with future versions of the library that might do extra cleanup π§
π₯ RETURN VALUES π₯
llapi_find_param_alloc()β returns a valid pointer on success, orNULLon failure witherrnoset to an appropriate error code πllapi_find_param_free()β returns no value. it's giving void.
π ERRORS π
ENOMEMβ insufficient storage space is available.
π EXAMPLES π
list all regular files below path:
#include <lustre/lustreapi.h>
int find_regular_files(char *path)
{
struct find_param *param;
int rc;
param = llapi_find_param_alloc();
if (!param)
return -errno;
param->fp_max_depth = -1;
param->fp_type = S_IFREG;
rc = llapi_find(path, param);
llapi_find_param_free(param);
return rc;
}
look at her go, main character energy fr fr π
π AVAILABILITY π
llapi_find_param_alloc() and llapi_find_param_free() are part of the lustre(7) user application interface library since release 2.18.0 β
π«Ά SEE ALSO π«Ά
lfs-find(1), llapi_find(3), llapi_getstripe(3), lustreapi(7)
ok that's the whole page bestie, you ate that π β¨
bye!! this was Lustre User API, dated 2026-08-13, filed under LLAPI_FIND_PARAM_ALLOC(3) β go forth and allocate responsibly πππΈ
π¦ where this page comes from
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms