LLAPI\_OPEN\_BY\_FID(3) Lustre Library Functions LLAPI\_OPEN\_BY\_FID(3)

# [NAME](#NAME)

llapi\_open\_by\_fid, llapi\_open\_by\_fid\_at - open a file descriptor from a File Identifier

# [SYNOPSIS](#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](#DESCRIPTION)

**llapi\_open\_by\_fid()** opens a file descriptor in the filesystem mountpoint referenced by *path* for the file identified by *fid*, using the open file flags in *oflag* (as with the normal [**open**(2)](/man/enterprise-packages/lustre/open.2) call).

**llapi\_open\_by\_fid\_at()** opens a file descriptor on *fid* in the filesystem referenced by the open file descriptor *dir\_fd*. This is similar to the [*open\_by\_handle\_at*(3)](/man/enterprise-packages/lustre/open_by_handle_at.3) system call that can open files by their NFS file handle. If *dir\_fd* is **AT\_CWD** then the open is performed against the local working directory.

# [RETURN VALUES](#RETURN_VALUES)

returns file descriptor number or a negative errno value on failure.

# [ERRORS](#ERRORS)

[**-EINVAL**](#EINVAL)

An invalid argument was specified.

[**-ENOMEM**](#ENOMEM)

No memory was available during operation.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_open\_by\_fid()** and **llapi\_open\_by\_fid\_at()** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.4.0

# [SEE ALSO](#SEE_ALSO)

[**llapi\_fd2fid**(3)](/man/enterprise-packages/lustre/llapi_fd2fid.3), [**llapi\_fid\_parse**(3)](/man/enterprise-packages/lustre/llapi_fid_parse.3), [**llapi\_fid2path**(3)](/man/enterprise-packages/lustre/llapi_fid2path.3), [**llapi\_path2fid**(3)](/man/enterprise-packages/lustre/llapi_path2fid.3), [**open\_by\_handle\_at**(3)](/man/enterprise-packages/lustre/open_by_handle_at.3), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-27 Lustre User API

---

Document: llapi_open_by_fid(3) from lustre 2.17.60-r0 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
