1*62895Sbostic.\" Copyright (c) 1989, 1991, 1993 2*62895Sbostic.\" The Regents of the University of California. All rights reserved. 338391Smckusick.\" 450487Scael.\" %sccs.include.redist.roff% 538391Smckusick.\" 6*62895Sbostic.\" @(#)getfh.2 8.1 (Berkeley) 06/09/93 738391Smckusick.\" 847208Scael.Dd 947208Scael.Dt GETFH 2 1050487Scael.Os 1147208Scael.Sh NAME 1247208Scael.Nm getfh 1347208Scael.Nd get file handle 1447208Scael.Sh SYNOPSIS 1547208Scael.Fd #include <sys/types.h> 1647208Scael.Fd #include <sys/mount.h> 1747208Scael.Ft int 1851815Sbostic.Fn getfh "char *path" "fhandle_t *fhp" 1947208Scael.Sh DESCRIPTION 2047208Scael.Fn Getfh 2138391Smckusickreturns a file handle for the specified file or directory 2238391Smckusickin the file handle pointed to by 2347208Scael.Fa fhp . 2438391SmckusickThis system call is restricted to the superuser. 2547208Scael.Sh RETURN VALUES 2638391SmckusickUpon successful completion, a value of 0 is returned. 2747208ScaelOtherwise, -1 is returned and the global variable 2847208Scael.Va errno 2938391Smckusickis set to indicate the error. 3047208Scael.Sh ERRORS 3147208Scael.Fn Getfh 3238391Smckusickfails if one or more of the following are true: 3347208Scael.Bl -tag -width Er 3447208Scael.It Bq ENOTDIR 3538391SmckusickA component of the path prefix of 3647208Scael.Fa path 3738391Smckusickis not a directory. 3847208Scael.It Bq EINVAL 3947208Scael.Fa path 4038391Smckusickcontains a character with the high-order bit set. 4147208Scael.It Bq ENAMETOOLONG 4238391SmckusickThe length of a component of 4347208Scael.Fa path 4438391Smckusickexceeds 255 characters, 4538391Smckusickor the length of 4647208Scael.Fa path 4738391Smckusickexceeds 1023 characters. 4847208Scael.It Bq ENOENT 4938391SmckusickThe file referred to by 5047208Scael.Fa path 5138391Smckusickdoes not exist. 5247208Scael.It Bq EACCES 5338391SmckusickSearch permission is denied for a component of the path prefix of 5447208Scael.Fa path . 5547208Scael.It Bq ELOOP 5638391SmckusickToo many symbolic links were encountered in translating 5747208Scael.Fa path . 5847208Scael.It Bq EFAULT 5947208Scael.Fa Fhp 6038391Smckusickpoints to an invalid address. 6147208Scael.It Bq EIO 6250487ScaelAn 6350487Scael.Tn I/O 6450487Scaelerror occurred while reading from or writing to the file system. 6547208Scael.El 6647208Scael.Sh HISTORY 6747208ScaelThe 6850487Scael.Nm getfh 6962894Sbosticfunction 7062894Sbosticfirst appeared in 4.4BSD. 71