92 lines
2.5 KiB
Groff
92 lines
2.5 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g2.getmountid @(#)getmountid 1.1 of 6/20/95
|
|
.\" Copyright 1991 UNIX System Laboratories, Inc.
|
|
.\" Copyright 1989, 1990 AT&T
|
|
.nr X
|
|
.if \nX=0 .ds x} getmountid 2 "" "\&"
|
|
.if \nX=1 .ds x} getmountid 2 ""
|
|
.if \nX=2 .ds x} getmountid 2 "" "\&"
|
|
.if \nX=3 .ds x} getmountid "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4getmountid\f1 \- get filesystem mount identifier
|
|
.SH SYNOPSIS
|
|
\f4#include <sys/mount.h>\f1
|
|
.PP
|
|
\f4int getmountid (const char *path, mountid_t *buf);\f1
|
|
.SH DESCRIPTION
|
|
\f4getmountid\fP
|
|
returns an identifier for the filesystem containing the file named
|
|
by
|
|
\f4path\fP.
|
|
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.
|
|
\f4buf\fP
|
|
is a pointer to a mountid structure that is filled by
|
|
the system call.
|
|
.PP
|
|
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.
|
|
.PP
|
|
\f4getmountid\fP
|
|
fails if one or more of the following are true:
|
|
.TP 15
|
|
\f4EACCES\fP
|
|
Search permission is denied on a component of the path prefix.
|
|
.TP 15
|
|
\f4EFAULT\fP
|
|
.I path
|
|
or
|
|
.I buf
|
|
points outside the process's allocated address space.
|
|
.TP 15
|
|
\f4EINTR\fP
|
|
A signal was caught during \f4getmountid\f1 execution.
|
|
.TP 15
|
|
\f4EIO\fP
|
|
An I/O error occurred while reading the file system.
|
|
.TP 15
|
|
\f4ELOOP\fP
|
|
Too many symbolic links were encountered in translating
|
|
.IR path .
|
|
.TP 15
|
|
\f4ENAMETOOLONG\fP
|
|
The length of a \f2path\f1 component
|
|
exceeds {\f4NAME_MAX\f1} characters,
|
|
or the length of
|
|
.I path\^
|
|
exceeds {\f4PATH_MAX\f1} characters.
|
|
.TP 15
|
|
\f4ENOENT\fP
|
|
Either a component of the path prefix or the file referred to by
|
|
.I path\^
|
|
does not exist.
|
|
.TP 15
|
|
\f4ENOLINK\fP
|
|
.I path\^
|
|
points to a remote machine and the link to that machine is no longer
|
|
active.
|
|
.TP 15
|
|
\f4ENOTDIR\fP
|
|
A component of the path prefix of
|
|
.I path\^
|
|
is not a directory.
|
|
.PP
|
|
.SH "DIAGNOSTICS"
|
|
Upon successful completion a value of 0 is returned.
|
|
Otherwise, a value of \-1 is returned and
|
|
\f4errno\fP
|
|
is set to indicate the error.
|
|
.SH "SEE ALSO"
|
|
\f4statvfs\fP(2)
|