Date: Tue, 1 Aug 2017 06:43:40 +0300 From: Chagin Dmitry <dchagin@freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321839 - in head: share/man/man4 share/man/man5 sys/fs/fdescfs sys/kern sys/sys Message-ID: <20170801034340.GA36494@mordor.heemeyer.club> In-Reply-To: <201708010340.v713eJVp002477@repo.freebsd.org> References: <201708010340.v713eJVp002477@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 01, 2017 at 03:40:19AM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Tue Aug 1 03:40:19 2017 > New Revision: 321839 > URL: https://svnweb.freebsd.org/changeset/base/321839 > > Log: > 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 Differential Revision: https://reviews.freebsd.org/D11452
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170801034340.GA36494>