LLAPI_OPEN_BY_FID(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

✨ NAME ✨

llapi_open_by_fid, llapi_open_by_fid_at β€” okay so these two cuties open a file descriptor from a File Identifier πŸŽ€ no path-walking drama, we're going straight to the fid periodt

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <lustre/lustreapi.h>

int llapi_open_by_fid(const char *mntpath, struct lu_fid *fid, int oflag);
int llapi_open_by_fid_at(int dir_fd, struct lu_fid *fid, int oflag);

🌸 DESCRIPTION 🌸

So llapi_open_by_fid() opens a file descriptor in the filesystem mountpoint that path points at, and it does it for the file identified by fid, using the open file flags you hand it in oflag β€” literally exactly like your normal open(2) call does, same energy.

And llapi_open_by_fid_at()? She's the ✨ _at() variant ✨ β€” she opens a file descriptor on fid in the filesystem referenced by the open file descriptor dir_fd. Think of it like open_by_handle_at(3), that system call that opens files by their NFS file handle (iykyk). Oh and if dir_fd is AT_CWD, then the open happens against the local working directory. iconic. πŸ’…

πŸ‘‘ RETURN VALUES πŸ‘‘

She returns a file descriptor number when she's slaying πŸ’– or a negative errno value if it flopped. 😭

πŸ’€ ERRORS πŸ’€

  • -EINVAL β€” bestie you passed an invalid argument πŸ™ˆ
  • -ENOMEM β€” no memory available during the operation, she's running on empty 🫠

πŸŽ€ AVAILABILITY πŸŽ€

llapi_open_by_fid() and llapi_open_by_fid_at() are part of the lustre(7) user application interface library, and they've been in the group chat since release 2.4.0. long-running friendship fr fr 🫢

πŸ”₯ SEE ALSO πŸ”₯

llapi_fd2fid(3), llapi_fid_parse(3), llapi_fid2path(3), llapi_path2fid(3), open_by_handle_at(3), lustreapi(7)


okay that's the whole page, no skips, no edits, everything's still there πŸ’œ and just so we're keeping receipts: this one's from the Lustre User API, dated 2024-08-27. mwah, go open some fids bestie πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from