[Previous]
[Contents]
[Next]

fsys_get_mount_pt()

find the file system mount point for a device

Synopsis:

#include <sys/fsys.h>
int fsys_get_mount_pt( const char *device,
                       char *directory );

Description:

The fsys_get_mount_pt() function finds and returns the file system mount point (directory) associated with the named device. For instance, if you have a device /dev/hd0t77 mounted as your root, you could use the name to find that directory name (/).

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Errors:

EACCES
Search permission is denied on component of device path.
ENAMETOOLONG
The length of the device string exceeds PATH_MAX, or a pathname component is longer than NAME_MAX.
ENODEV
The named device does not exist.
ENOENT
The named device has no mount entry.
ENOSYS
This function is not supported for this device path.
ENOTBLK
The named device is not a block special file.
ENOTDIR
A component of the device path is not a directory.

Examples:

#include <limits.h>
#include <sys/fsys.h>

void main(int argc, char **argv)
  {
    char buf[_POSIX_PATH_MAX];

    fsys_get_mount_pt( argv[1], buf );

    printf( "device '%s' mounted as: %s\n",
        argv[1], buf );
  }

Classification:

QNX

Safety:
Interrupt handler No
Signal handler Yes, but modifies errno
Thread Yes

See also:

errno, fsys_get_mount_dev()


[Previous]
[Contents]
[Next]