Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Mar 2021 17:10:45 +0000
From:      Arthur Chance <freebsd@qeng-ho.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: which is "better" - /dev/fd or FIFO
Message-ID:  <79db2b71-5758-431d-4654-fc3c42700c68@qeng-ho.org>
In-Reply-To: <YEO0gfiytP6n5%2BCD@ceres.local>
References:  <YEOMzXyvchUkMmdH@ceres.local> <7CEBCD10-90CA-4194-823C-8F87659706BC@kreme.com> <YEO0gfiytP6n5%2BCD@ceres.local>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/03/2021 16:57, tech-lists wrote:
> On Sat, Mar 06, 2021 at 09:37:49AM -0700, @lbutlr wrote:
>> On 06 Mar 2021, at 07:08, tech-lists <tech-lists@zyxst.net> wrote:
>>> Some ports, notably shells/bash, have a makeoptions config where you can
>>> select "enable use of /dev/fd". But there's no explanation given why
>>> this is advantageous or not, or if there's some kind of risk, in a
>>> freebsd context [1]. It's not enabled by default. Please can anyone
>>> explain?
>>
>> Do you have a floppy drive?
> 
> no. I admit i'd not thought of floppy drive at all. In 2021, who does?

Nope, /dev/fd isn't anything to do with floppy disks, that's /dev/fd0 IIRC.

> But the context in which this option is in, is confusing. The option is
> for fdescfs with "enable use of /dev/fd". I don't know what fdescfs
> truly is, apart from something to do with file descriptords, and not
> floppy drives.
> 
> Look here to see what I mean:
> 
> https://cloud.zyxst.net/~john/FreeBSD/ports/bashc/bashc.png
> 
> I think "enable use of /dev/fd" might be a bug; maybe it should say
> "enable use of /dev/fdescfs" ?
> 
> In which case my question should be "which is best - /dev/fdescfs or fifo?"
> 

If you read the manual entry for fdescfs it says it should be mounted via

mount -t fdescfs null /dev/fd

Opening /dev/fd/N gives you an alternate access path to file descriptor
N in your program. I.e. opening /dev/fd/0 gives you access to stdin but
on a different fd.

-- 
The number of people predicting the demise of Moore's Law doubles
every 18 months.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?79db2b71-5758-431d-4654-fc3c42700c68>