auparse_interpret_realpath - Linux


Overview

The auparse_interpret_realpath() function is used for parsing a real path that has been returned by getrealpath().

Syntax

#include <linux/mount.h>
#include <linux/namei.h>
const struct path * auparse_interpret_realpath(const char *realpath, const struct path *mnt_root);

The following arguments are supported:

  • realpath: The real path to parse.
  • mnt_root: The mount root for the real path.

Options/Flags

None.

Examples

The following example shows how to parse a real path:

#include <linux/mount.h>
#include <linux/namei.h>

int main(void) {
    const char *realpath = "/tmp/foo";
    struct path mnt_root;

    mnt_root.mnt = lookup_mnt_root(mnt_root.mnt, realpath);
    const struct path *result = auparse_interpret_realpath(realpath, &mnt_root);

    // Do something with the parsed path...

    return 0;
}

Common Issues

None.

Integration

This function can be used in conjunction with other functions in the linux/namei.h header file to parse real paths.

Related Commands

  • getrealpath()
  • lookup_mnt_root()