diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2017-08-01 03:40:19 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2017-08-01 03:40:19 +0000 |
commit | 77d3337c9f2e72cf8c85b0ed8cfa440c459a6bab (patch) | |
tree | 2b348035ac1e30ee3671edd13eec403cdb132a32 /share/man/man5/fdescfs.5 | |
parent | d2ffc7af304d3e8505006d89239cc9936bd71720 (diff) | |
download | src-77d3337c9f2e72cf8c85b0ed8cfa440c459a6bab.tar.gz src-77d3337c9f2e72cf8c85b0ed8cfa440c459a6bab.zip |
Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
Linux specific things to the native fdescfs file system.
Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
links to the actual files, which the process has open.
A readlink(2) call on this file returns a full path in case of regular file
or a string in a special format (type:[inode], anon_inode:<file-type>, etc..).
As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
equivalent to duplicating the corresponding file descriptor.
Here we have mutually exclusive requirements:
- in case of readlink(2) call fdescfs lookup() method should return VLNK
vnode otherwise our kern_readlink() fail with EINVAL error;
- in the other calls fdescfs lookup() method should return non VLNK vnode.
For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed
mounted with linrdlnk option an modified kern_readlinkat() to properly handle it.
For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:
mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd
Reviewed by: kib@
MFC after: 1 week
Relnotes: yes
Notes
Notes:
svn path=/head/; revision=321839
Diffstat (limited to 'share/man/man5/fdescfs.5')
-rw-r--r-- | share/man/man5/fdescfs.5 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/share/man/man5/fdescfs.5 b/share/man/man5/fdescfs.5 index 30e72a5f3b1c..3f16104c0ac8 100644 --- a/share/man/man5/fdescfs.5 +++ b/share/man/man5/fdescfs.5 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2010 +.Dd August 1, 2017 .Dt FDESCFS 5 .Os .Sh NAME @@ -92,6 +92,14 @@ and files are created by default when devfs alone is mounted. .Nm creates entries for all file descriptors opened by the process. +.Pp +For +.Xr linux 4 +ABI compatibility mount +.Nm +volume with +.Cm linrdlnk +option. .Sh FILES .Bl -tag -width /dev/stderr -compact .It Pa /dev/fd/# @@ -103,6 +111,12 @@ volume located on .Pa /dev/fd : .Pp .Dl "mount -t fdescfs null /dev/fd" +.Pp +For +.Xr linux 4 +ABI compatibility: +.Pp +.Dl "mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd" .Sh SEE ALSO .Xr devfs 5 , .Xr mount 8 |