LLAPI\_SEARCH\_ROOTPATH(3) Lustre Library Functions LLAPI\_SEARCH\_ROOTPATH(3)

# [NAME](#NAME)

llapi\_search\_rootpath, llapi\_search\_rootpath\_by\_dev - retrieve the path of a lustre mount point

# [SYNOPSIS](#SYNOPSIS)

```
#include <lustre/lustreapi.h>
```

```
int llapi_search_rootpath( char *pathname ,const char *fsname)
```

```
int llapi_search_rootpath_by_dev( char *pathname, dev_t dev)
```

# [DESCRIPTION](#DESCRIPTION)

**llapi\_search\_rootpath()** and **llapi\_search\_rootpath\_by\_dev()** find the first Lustre mount point by matching the filesystem name *fsname* or the filesystem device *dev*.

The path of the mount point found is stored into *pathname*. This buffer should be sufficient to store the path.

**e.g:** char pathname\[PATH\_MAX];

The filesystem device can be retrieved from a file with **stat()** (field *st\_dev*) or **statx()** (fields *stx\_dev\_major* and *stx\_dev\_minor*).

# [RETURN VALUES](#RETURN_VALUES)

**0**

on success, or

[-ve](#ve)

error code on failure and sets errno appropriately.

# [ERRORS](#ERRORS)

[**EINVAL**](#EINVAL)

*pathname* pointer is NULL.

[**ENODEV**](#ENODEV)

The Lustre mount point was not found.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_search\_rootpath()** and **llapi\_search\_rootpath\_by\_dev()** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library. **llapi\_search\_rootpath** was added in release 2.4.0. **llapi\_search\_rootpath\_by\_dev** was added in release 2.16.0.

# [SEE ALSO](#SEE_ALSO)

[**stat**(2)](/man/enterprise-packages/lustre/stat.2), [**statx**(2)](/man/enterprise-packages/lustre/statx.2), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-28 Lustre User API

---

Document: llapi_search_rootpath_by_dev(3) from lustre 2.17.59-r1 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
