xref: /original-bsd/lib/libc/sys/getfh.2 (revision 21df4bd6)
Copyright (c) 1989 The Regents of the University of California.
All rights reserved.

%sccs.include.redist.man%

@(#)getfh.2 6.2 (Berkeley) 06/23/90

GETFH 2 ""
C 7
NAME
getfh - get file handle
SYNOPSIS
#include <sys/types.h>
#include <sys/mount.h>

getfh(path, fhp) char *path; struct fhandle_t *fhp;

DESCRIPTION
Getfh returns a file handle for the specified file or directory in the file handle pointed to by fhp . This system call is restricted to the superuser.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
ERRORS
Getfh fails if one or more of the following are true:

15 ENOTDIR A component of the path prefix of path is not a directory.

15 EINVAL path contains a character with the high-order bit set.

15 ENAMETOOLONG The length of a component of path exceeds 255 characters, or the length of path exceeds 1023 characters.

15 ENOENT The file referred to by path does not exist.

15 EACCES Search permission is denied for a component of the path prefix of path .

15 ELOOP Too many symbolic links were encountered in translating path .

15 EFAULT Fhp points to an invalid address.

15 EIO An I/O error occurred while reading from or writing to the file system.