BSD 4_3_Reno release
[unix-history] / usr / src / lib / libc / sys / getfh.2
CommitLineData
f124e718
KM
1.\" Copyright (c) 1989 The Regents of the University of California.
2.\" All rights reserved.
3.\"
1c15e888
C
4.\" Redistribution and use in source and binary forms are permitted provided
5.\" that: (1) source distributions retain this entire copyright notice and
6.\" comment, and (2) distributions including binaries display the following
7.\" acknowledgement: ``This product includes software developed by the
8.\" University of California, Berkeley and its contributors'' in the
9.\" documentation or other materials provided with the distribution and in
10.\" all advertising materials mentioning features or use of this software.
11.\" Neither the name of the University nor the names of its contributors may
12.\" be used to endorse or promote products derived from this software without
13.\" specific prior written permission.
14.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
15.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
16.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
f124e718 17.\"
1c15e888 18.\" @(#)getfh.2 6.2 (Berkeley) 6/23/90
f124e718 19.\"
1c15e888 20.TH GETFH 2 "June 23, 1990"
f124e718
KM
21.UC 7
22.SH NAME
23getfh \- get file handle
24.SH SYNOPSIS
25.nf
26.ft B
27#include <sys/types.h>
28#include <sys/mount.h>
29.LP
30.ft B
31getfh(path, fhp)
32char *path;
33struct fhandle_t *fhp;
34.fi
35.ft R
36.SH DESCRIPTION
37.I Getfh
38returns a file handle for the specified file or directory
39in the file handle pointed to by
40.I fhp .
41This system call is restricted to the superuser.
42.SH RETURN VALUE
43Upon successful completion, a value of 0 is returned.
44Otherwise, \-1 is returned and the global variable
45.I errno
46is set to indicate the error.
47.SH ERRORS
48.I Getfh
49fails if one or more of the following are true:
50.TP 15
51ENOTDIR
52A component of the path prefix of
53.I path
54is not a directory.
55.TP 15
56EINVAL
57.I path
58contains a character with the high-order bit set.
59.TP 15
60ENAMETOOLONG
61The length of a component of
62.I path
63exceeds 255 characters,
64or the length of
65.I path
66exceeds 1023 characters.
67.TP 15
68ENOENT
69The file referred to by
70.I path
71does not exist.
72.TP 15
73EACCES
74Search permission is denied for a component of the path prefix of
75.IR path .
76.TP 15
77ELOOP
78Too many symbolic links were encountered in translating
79.IR path .
80.TP 15
81EFAULT
82.I Fhp
83points to an invalid address.
84.TP 15
85EIO
86An I/O error occurred while reading from or writing to the file system.