---
name: "fdescfs"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/fdescfs"
---

# fdescfs(4)

file-descriptor file system

## NAME

**fdescfs** – file-descriptor file system

## SYNOPSIS

```
fdescfs	/dev/fd	fdescfs rw 0 0
```

## DESCRIPTION

The file-descriptor file system, or **fdescfs**, provides access to the per-process file descriptor namespace in the global file system namespace. The conventional mount point is */dev/fd*.

The file system's contents appear as a list of numbered files which correspond to the open files of the process reading the directory. The files */dev/fd/0* through */dev/fd/#* refer to file descriptors which can be accessed through the file system.

The following mount options can be used when mounting **fdescfs** filesystem:

- **nodup**

  For file descriptors referencing vnodes, instead of the [dup(2)](/dup/2.md) semantic described above, implement re-opening of the referenced vnode. See below for more details.

- **linrdlnk**

  Report the type of the **fdescfs** vnode as VLNK instead of FreeBSD traditional VCHR. Path components following a directory descriptor entry are resolved relative to the referenced directory. A trailing slash also resolves to the referenced directory. Opening an entry as the last path component, without a trailing slash, retains the behavior described below. For [linux(4)](/linux/4.md) ABI compatibility mount **fdescfs** volume with the **linrdlnk** option.

- **rdlnk**

  Treat **fdescfs** vnodes as symbolic links consistently, in particular, follow the resolved name for the name lookups. This option is strictly stronger than the **linrdlnk** option, it changes not only the type returned by [stat(2)](/stat/2.md), but also causes the **fdescfs** files to behave as symlinks.

For **fdescfs** mounted without the **nodup** mount option, if the file descriptor is open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call:

```
fd = open("/dev/fd/0", mode);
```

and the call:

```
fd = fcntl(0, F_DUPFD, 0);
```

are equivalent. Flags to the [open(2)](/open/2.md) call other than O\_RDONLY, O\_WRONLY and O\_RDWR are ignored.

For **fdescfs** mounted with the **nodup** option, and file descriptor referencing a vnode, the call:

```
fd = open("/dev/fd/0", mode);
```

reopens the referenced vnode with the specified *mode*. In other words, the **open**() call above is equivalent to

```
fd = openat(0, "", O_EMPTY_PATH, mode);
```

In particular, if the file descriptor was opened with the O\_PATH flag, then either O\_EMPTY\_PATH or **open**() over **fdescfs** mount with **nodup** option allows one to convert it to a regularly opened file, assuming that the current permissions allow the requested *mode*.

*Note:* */dev/fd/0*, */dev/fd/1* and */dev/fd/2* files are created by default when devfs alone is mounted. **fdescfs** creates entries for all file descriptors opened by the process.

## FILES

- */dev/fd/#*

  ## EXAMPLES

To mount a **fdescfs** volume located on */dev/fd*:

```
mount -t fdescfs none /dev/fd
```

For [linux(4)](/linux/4.md) ABI compatibility:

```
mount -t fdescfs -o linrdlnk none /compat/linux/dev/fd
```

For substitute of O\_EMPTY\_PATH flag use:

```
mount -t fdescfs -o nodup none /dev/fdpath
```

## SEE ALSO

[devfs(4)](/devfs/4.md), [mount(8)](/mount/8.md)

## HISTORY

The **fdescfs** file system first appeared in 4.4BSD. The **fdescfs** manual page first appeared in FreeBSD 2.2.

## AUTHORS

The **fdescfs** manual page was written by Mike Pritchard ⟨*mpp@FreeBSD.org*⟩, and was based on the manual page written by Jan-Simon Pendry.
