Whamcloud - gitweb
LU-15833 llapi: don't use realpath in llapi_search_fsname()
[fs/lustre-release.git] / lustre / doc / llapi_search_rootpath.3
1 .TH llapi_search_rootpath 3 "2022 May 23" "Lustre User API"
2 .SH NAME
3 llapi_search_rootpath, llapi_search_rootpath_by_dev \-
4 retrieve the path of a lustre mount point
5 .SH SYNOPSIS
6 .nf
7 .B #include <lustre/lustreapi.h>
8 .PP
9 .BI "int llapi_search_rootpath( char *" pathname " ,const char *" fsname ")
10 .PP
11 .BI "int llapi_search_rootpath_by_dev( char *" pathname ", dev_t " dev ")
12 .fi
13 .SH DESCRIPTION
14 .PP
15 .BR llapi_search_rootpath()
16 and
17 .BR llapi_search_rootpath_by_dev()
18 find the first Lustre mount point by matching the filesystem name \fIfsname\fP or the filesystem device \fIdev\fP.
19 .PP
20 The path of the mount point found is stored into \fIpathname\fP. This buffer should be sufficient to store the path.
21 .PP
22 .BR e.g:
23 char pathname[PATH_MAX];
24 .PP
25 The filesystem device can be retrieved from a file with
26 .BR stat()
27 (field \fIst_dev\fP) or
28 .BR statx()
29 (fields \fIstx_dev_major\fP and \fIstx_dev_minor\fP).
30 .SH RETURN VALUES
31 .TP
32 .B 0
33 on success, or
34 .TP
35 -ve
36 error code on failure and sets errno appropriately.
37 .SH ERRORS
38 .TP 15
39 .SM EINVAL
40 \fIpathname\fP pointer is NULL.
41 .TP
42 .SM ENODEV
43 The Lustre mount point was not found.
44 .SH SEE ALSO
45 .ad l
46 .nh
47 .BR lustreapi (7),
48 .BR stat (2),
49 .BR statx (2)