1 .\" Copyright (c) 2021 The FreeBSD Foundation, Inc.
4 .\" Mike Pritchard <mpp@FreeBSD.org>. All rights reserved.
6 .\" Copyright (c) 1992, 1993, 1994
7 .\" The Regents of the University of California. All rights reserved.
8 .\" All rights reserved.
10 .\" This code is derived from software donated to Berkeley by
13 .\" Parts of this documentation was written by
14 .\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
15 .\" from the FreeBSD Foundation.
17 .\" Redistribution and use in source and binary forms, with or without
18 .\" modification, are permitted provided that the following conditions
20 .\" 1. Redistributions of source code must retain the above copyright
21 .\" notice, this list of conditions and the following disclaimer.
22 .\" 2. Redistributions in binary form must reproduce the above copyright
23 .\" notice, this list of conditions and the following disclaimer in the
24 .\" documentation and/or other materials provided with the distribution.
25 .\" 3. Neither the name of the University nor the names of its contributors
26 .\" may be used to endorse or promote products derived from this software
27 .\" without specific prior written permission.
29 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 .Nd file-descriptor file system
51 fdescfs /dev/fd fdescfs rw 0 0
54 The file-descriptor file system, or
56 provides access to the per-process file descriptor
57 namespace in the global file system namespace.
58 The conventional mount point is
61 The file system's contents
62 appear as a list of numbered files
63 which correspond to the open files of the process reading the
69 refer to file descriptors which can be accessed through the file
72 The following mount options can be used when mounting
75 .Bl -tag -width linrdlnk
77 For file descriptors referencing vnodes, instead of the
79 semantic described above, implement re-opening of the referenced vnode.
80 See below for more details.
82 Report the type of the
92 ABI compatibility mount
100 vnodes as symbolic links consistently, in particular, follow
101 the resolved name for the name lookups.
102 This option is strictly stronger than the
104 option, it changes not only the type returned by
108 files to behave as symlinks.
116 if the file descriptor is open and the mode the file is being opened
117 with is a subset of the mode of the existing descriptor, the call:
118 .Bd -literal -offset indent
119 fd = open("/dev/fd/0", mode);
123 .Bd -literal -offset indent
124 fd = fcntl(0, F_DUPFD, 0);
141 option, and file descriptor referencing a vnode, the call:
142 .Bd -literal -offset indent
143 fd = open("/dev/fd/0", mode);
146 reopens the referenced vnode with the specified
150 call above is equivalent to
151 .Bd -literal -offset indent
152 fd = openat(0, "", O_EMPTY_PATH, mode);
155 In particular, if the file descriptor was opened with the
165 option allows one to convert it to a regularly opened file,
166 assuming that the current permissions allow the requested
174 files are created by default when devfs alone is mounted.
176 creates entries for all file descriptors opened by the process.
178 .Bl -tag -width /dev/stderr -compact
187 .Dl "mount -t fdescfs none /dev/fd"
193 .Dl "mount -t fdescfs -o linrdlnk none /compat/linux/dev/fd"
199 .Dl "mount -t fdescfs -o nodup none /dev/fdpath"
206 file system first appeared in
210 manual page first appeared in
216 manual page was written by
217 .An Mike Pritchard Aq Mt mpp@FreeBSD.org ,
219 manual page written by
220 .An Jan-Simon Pendry .