xref: /original-bsd/lib/libc/sys/getfh.2 (revision 1e14295c)
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) 07/02/89

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.