Whamcloud - gitweb
LU-16284 utils: lfs getstripe follows symlink
[fs/lustre-release.git] / lustre / doc / llapi_open_by_fid.3
1 .TH llapi_open_by_fid 3 "2022-11-08" "Lustre User API"
2 .SH NAME
3 llapi_open_by_fid \- open a file descriptor from a File Identifier
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .PP
8 .BI "int llapi_open_by_fid(const char *" mntpath ", struct lu_fid *" fid ", int " oflag ");"
9 .BI "int llapi_open_by_fid_at(int " dir_fd ", struct lu_fid *" fid ", int " oflag ");"
10 .fi
11 .SH DESCRIPTION
12 .PP
13 .BR llapi_open_by_fid()
14 opens a file descriptor in the filesystem mountpoint referenced by
15 .I path
16 for the file identified by
17 .IR fid  ,
18 using the open file flags in
19 .IR oflag
20 (as with the normal
21 .BR open (2)
22 call).
23 .PP
24 .BR llapi_open_by_fid_at()
25 opens a file descriptor on
26 .I fid
27 in the filesystem referenced by the open file descriptor
28 .IR dir_fd .
29 This is similar to the
30 .IR open_by_handle_at (3)
31 system call that can open files by their NFS file handle.  If
32 .I dir_fd
33 is
34 .B AT_CWD
35 then the open is performed against the local working directory.
36 .SH RETURN VALUES
37 .LP
38 returns file descriptor number or a negative errno value on failure.
39 .SH ERRORS
40 .TP 15
41 .SM -EINVAL
42 An invalid argument was specified.
43 .TP 15
44 .SM -ENOMEM
45 No memory was available during operation.
46 .SH SEE ALSO
47 .BR llapi_fid_parse (3),
48 .BR llapi_fid2path (3),
49 .BR llapi_path2fid (3),
50 .BR lustreapi (7),
51 .BR open_by_handle_at (3)