getmountid(2) getmountid(2)
getmountid - get filesystem mount identifier
#include <sys/mount.h>
int getmountid (const char *path, mountid_t *buf);
getmountid returns an identifier for the filesystem containing the file
named by path. Read, write, or execute permission for the named file is
not required, but all directories listed in the path name leading to the
file must be searchable. buf is a pointer to a mountid structure that is
filled by the system call.
The identifier returned is guaranteed to be unique for the mounted
filesystem within the running system, except for autofs's lofs
filesystems. The identifier is not guaranteed to be unique across
systems, and it is not guaranteed to persist across reboots or even
across mounts of the given filesystem. The identifier returned by lofs
filesystems is that of the mounted filesystem that lofs is providing
access to via a loopback mount. Therefore, for lofs filesystems the
combination of getmountid and lstat's st_rdev must be used to identify
uniqueness.
getmountid fails if one or more of the following are true:
EACCES Search permission is denied on a component of the path
prefix.
EFAULT path or buf points outside the process's allocated address
space.
EINTR A signal was caught during getmountid execution.
EIO An I/O error occurred while reading the file system.
ELOOP Too many symbolic links were encountered in translating
path.
ENAMETOOLONG The length of a path component exceeds {NAME_MAX}
characters, or the length of path exceeds {PATH_MAX}
characters.
ENOENT Either a component of the path prefix or the file referred
to by path does not exist.
ENOLINK path points to a remote machine and the link to that
machine is no longer active.
Page 1
getmountid(2) getmountid(2)
ENOTDIR A component of the path prefix of path is not a directory.
Upon successful completion a value of 0 is returned. Otherwise, a value
of -1 is returned and errno is set to indicate the error.
statvfs(2)
PPPPaaaaggggeeee 2222 [ Back ]
|