fix copyright and condition notice for new sccs include
[unix-history] / usr / src / lib / libc / sys / getfh.2
.\" Copyright (c) 1989 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted
.\" provided that the above copyright notice and this paragraph are
.\" duplicated in all such forms and that any documentation,
.\" advertising materials, and other materials related to such
.\" distribution and use acknowledge that the software was developed
.\" by the University of California, Berkeley. The name of the
.\" University may not be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\" @(#)getfh.2 6.1 (Berkeley) %G%
.\"
.TH GETFH 2 ""
.UC 7
.SH NAME
getfh \- get file handle
.SH SYNOPSIS
.nf
.ft B
#include <sys/types.h>
#include <sys/mount.h>
.LP
.ft B
getfh(path, fhp)
char *path;
struct fhandle_t *fhp;
.fi
.ft R
.SH DESCRIPTION
.I Getfh
returns a file handle for the specified file or directory
in the file handle pointed to by
.I fhp .
This system call is restricted to the superuser.
.SH RETURN VALUE
Upon successful completion, a value of 0 is returned.
Otherwise, \-1 is returned and the global variable
.I errno
is set to indicate the error.
.SH ERRORS
.I Getfh
fails if one or more of the following are true:
.TP 15
ENOTDIR
A component of the path prefix of
.I path
is not a directory.
.TP 15
EINVAL
.I path
contains a character with the high-order bit set.
.TP 15
ENAMETOOLONG
The length of a component of
.I path
exceeds 255 characters,
or the length of
.I path
exceeds 1023 characters.
.TP 15
ENOENT
The file referred to by
.I path
does not exist.
.TP 15
EACCES
Search permission is denied for a component of the path prefix of
.IR path .
.TP 15
ELOOP
Too many symbolic links were encountered in translating
.IR path .
.TP 15
EFAULT
.I Fhp
points to an invalid address.
.TP 15
EIO
An I/O error occurred while reading from or writing to the file system.