From owner-freebsd-questions@freebsd.org Sat Mar 6 17:11:06 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFA1456D1A7 for ; Sat, 6 Mar 2021 17:11:06 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from mailout.qeng-ho.org (mailout.qeng-ho.org [217.155.128.244]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtB2d670Yz4Zl7 for ; Sat, 6 Mar 2021 17:11:05 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (unknown [IPv6:2a02:8010:64c9:1::2]) by mailout.qeng-ho.org (Postfix) with ESMTP id D1D27553ED for ; Sat, 6 Mar 2021 17:10:49 +0000 (GMT) Subject: Re: which is "better" - /dev/fd or FIFO To: freebsd-questions@freebsd.org References: <7CEBCD10-90CA-4194-823C-8F87659706BC@kreme.com> From: Arthur Chance Message-ID: <79db2b71-5758-431d-4654-fc3c42700c68@qeng-ho.org> Date: Sat, 6 Mar 2021 17:10:45 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DtB2d670Yz4Zl7 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@qeng-ho.org designates 217.155.128.244 as permitted sender) smtp.mailfrom=freebsd@qeng-ho.org X-Spamd-Result: default: False [-3.28 / 15.00]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[217.155.128.244:from]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.155.128.240/29]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[217.155.128.244:from:127.0.2.255]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.981]; DMARC_NA(0.00)[qeng-ho.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13037, ipnet:217.155.0.0/16, country:GB]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 17:11:06 -0000 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 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.