1.\" Copyright (c) 1989, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)getfh.2 6.4 (Berkeley) 07/23/91 7.\" 8.Dd 9.Dt GETFH 2 10.Os 11.Sh NAME 12.Nm getfh 13.Nd get file handle 14.Sh SYNOPSIS 15.Fd #include <sys/types.h> 16.Fd #include <sys/mount.h> 17.Ft int 18.Fn getfh "char *path" "struct fhandle_t *fhp" 19.Sh DESCRIPTION 20.Fn Getfh 21returns a file handle for the specified file or directory 22in the file handle pointed to by 23.Fa fhp . 24This system call is restricted to the superuser. 25.Sh RETURN VALUES 26Upon successful completion, a value of 0 is returned. 27Otherwise, -1 is returned and the global variable 28.Va errno 29is set to indicate the error. 30.Sh ERRORS 31.Fn Getfh 32fails if one or more of the following are true: 33.Bl -tag -width Er 34.It Bq ENOTDIR 35A component of the path prefix of 36.Fa path 37is not a directory. 38.It Bq EINVAL 39.Fa path 40contains a character with the high-order bit set. 41.It Bq ENAMETOOLONG 42The length of a component of 43.Fa path 44exceeds 255 characters, 45or the length of 46.Fa path 47exceeds 1023 characters. 48.It Bq ENOENT 49The file referred to by 50.Fa path 51does not exist. 52.It Bq EACCES 53Search permission is denied for a component of the path prefix of 54.Fa path . 55.It Bq ELOOP 56Too many symbolic links were encountered in translating 57.Fa path . 58.It Bq EFAULT 59.Fa Fhp 60points to an invalid address. 61.It Bq EIO 62An 63.Tn I/O 64error occurred while reading from or writing to the file system. 65.El 66.Sh HISTORY 67The 68.Nm getfh 69function call is 70.Ud . 71