LLAPI_UNLINK_FOREIGN(3)
π LLAPI_UNLINK_FOREIGN π
okay bestie, gather round, because today we're talking about a lil function from the Lustre Library Functions lineup β llapi_unlink_foreign(3). it's giving "delete this thing that normal delete can't touch." iconic behavior honestly.
β¨ NAME β¨
llapi_unlink_foreign β unlink a file/dir that has a foreign layout on a Lustre filesystem π
πΈ SYNOPSIS πΈ
#include <lustre/lustreapi.h>
int llapi_unlink_foreign(char *name);
π¦ DESCRIPTION π¦
so like. llapi_unlink_foreign() lets you unlink a file or dir named name when it's rockin' a foreign LOV/LMV β the exact kind of file/dir that the regular unlink/rmdir command or syscall would straight up refuse to touch. no cap.
and the plot twist? it also just works fine on a regular file/dir too. versatile queen. π
π« RETURN VALUES π«
llapi_unlink_foreign() be returning:
=0β slay, success β¨<0β oh no, failure. the absolute value of that number is an error code, so take the positivity out of it and go look it up.
π ERRORS π
ENOENTβnamedoes not exist. it's not there bestie, it never was πENOTTYβnamemay not point to a Lustre filesystem. wrong vibes, wrong filesystem fr fr.
π EXAMPLES π
here's the whole vibe in code, copy it, love it, compile it:
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <lustre/lustreapi.h>
int main(int argc, char **argv)
{
char *foreign = NULL;
int c, rc;
while ((c = getopt(argc, argv, "hf:")) != -1) {
switch (c) {
case 'f':
foreign = optarg;
break;
case 'h':
default:
fprintf(stderr,
"Usage: %s [-f <foreign file/dir pathname>]0,
argv[0]);
exit(0);
break;
}
}
if (foreign == NULL) {
fprintf(stderr, "a foreign file/dir pathname must be provided0);
exit(0);
}
rc = llapi_unlink_foreign(foreign);
if (rc < 0)
fprintf(stderr, "llapi_unlink_foreign() error: %d0, rc);
return rc;
}
π AVAILABILITY π
llapi_unlink_foreign() is part of the lustre(7) user application interface library, and it's been serving looks since release 2.9.0. so yeah, it's not new new, it's a seasoned icon.
π SEE ALSO π
little reminder bestie: if you're getting a negative return, don't just vibe past it β that absolute value is a real error code and it wants your attention π«Ά
and that's the whole page, fr fr. this lil slice of lore comes to you from the Lustre User API, dated 2024-08-28, and it'll be right here every time you need it. periodt. πβ¨π
π¦ 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