From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 360 invoked from network); 20 Apr 2020 17:59:46 -0000 Received-SPF: pass (minnie.tuhs.org: domain of minnie.tuhs.org designates 45.79.103.53 as permitted sender) receiver=inbox.vuxu.org; client-ip=45.79.103.53 envelope-from= Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 20 Apr 2020 17:59:46 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id C1BF09C8AB; Tue, 21 Apr 2020 03:59:44 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id E9D269B95E; Tue, 21 Apr 2020 03:59:07 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=planet.nl header.i=@planet.nl header.b="h6CPPqcL"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id BB45D9B934; Tue, 21 Apr 2020 03:59:04 +1000 (AEST) Received: from cpsmtpb-ews10.kpnxchange.com (cpsmtpb-ews10.kpnxchange.com [213.75.39.15]) by minnie.tuhs.org (Postfix) with ESMTP id 4CA809B931 for ; Tue, 21 Apr 2020 03:59:02 +1000 (AEST) Received: from cpsps-ews28.kpnxchange.com ([10.94.84.194]) by cpsmtpb-ews10.kpnxchange.com with Microsoft SMTPSVC(8.5.9600.16384); Mon, 20 Apr 2020 19:59:00 +0200 X-Brand: 7abm2Q== X-KPN-SpamVerdict: e1=0;e2=0;e3=0;e4=(e1=10;e3=10;e2=11;e4=10);EVW:Whi te;BM:NotScanned;FinalVerdict:Clean X-CMAE-Analysis: v=2.3 cv=eZemg4MH c=1 sm=1 tr=0 cx=a_idp_e a=LO2mTXPAMClkaqVt2RTykg==:117 a=soxbC+bCkqwFbqeW/W/r+Q==:17 a=x1i13A_MHe4A:10 a=cl8xLZFz6L8A:10 a=AoeSMSUmAAAA:8 a=p8hWPCrPAAAA:8 a=MrCl_uNiAAAA:8 a=HNVTiTzpAAAA:8 a=u72O05gKAAAA:8 a=0sP5lE4sSOzdHSG0Ho4A:9 a=QEXdDO2ut3YA:10 a=OzC5TSNYCcQA:10 a=lVEnoaUTKgsA:10 a=S6Ulni6E_K6W4c1jKB8A:9 a=m-k6JtPMz6yzuijy:21 a=_W_S_7VecoQA:10 a=2UY7SMgi64q-0UtCmZ5F:22 a=hdUzUiK6lsseaELp4_5Y:22 a=HG9TltYLi78LN387oQwV:22 a=cPCxIqq1RTcWAI6fvWHn:22 a=N9M9Gv0imjkMJp2kB0A3:22 X-CM-AcctID: kpn@feedback.cloudmark.com Received: from smtp.kpnmail.nl ([195.121.84.12]) by cpsps-ews28.kpnxchange.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384); Mon, 20 Apr 2020 19:59:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=planet.nl; s=planet01; h=to:date:subject:mime-version:content-type:message-id:from; bh=5LQ/Mzcb591CwESAzv14/bY/PH62Uq8Sexb1iJPEZCE=; b=h6CPPqcLVVD6QxPUycX+vwriQqjOdv2r4zgDLSdlVB0ICvCNnWrpS0iRwgB1JHfy13Bq9dikyZDso pffSYV1K3b/xUBdEGizXZvW4DXjK5VWzxoO/HRhNVh4ndrMxgGB211EEvw0ny8Jw/iqbpBagpjr9gn CkFPwlHMP8fKU78w= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|br/QOHfsmEcAK0brp3RROvocLD8sj2yQXRJ4epuRVF1cPbgPMFiUocz+r5CoBjZ KFo93s4+ccPQcOX+maU1isw== X-Originating-IP: 80.101.112.122 Received: from mba1.fritz.box (sqlite.xs4all.nl [80.101.112.122]) by smtp.kpnmail.nl (Halon) with ESMTPSA id 9cdbfdab-8330-11ea-aa6d-00505699772e; Mon, 20 Apr 2020 19:59:00 +0200 (CEST) From: Paul Ruizendaal Message-Id: <86CC0B00-8BDA-4896-B288-D987E2D0AB59@planet.nl> Content-Type: multipart/alternative; boundary="Apple-Mail=_EF27346D-8677-4C77-A8D5-64B64EA2805F" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Date: Mon, 20 Apr 2020 19:58:59 +0200 In-Reply-To: <202004201516.03KFGhPd001645@freefriends.org> To: arnold@skeeve.com References: <46EFF8FB-86D2-407A-87A7-B7A58D47C2D9@planet.nl> <202004201428.03KESrgI032002@freefriends.org> <202004201516.03KFGhPd001645@freefriends.org> X-Mailer: Apple Mail (2.3445.9.1) X-OriginalArrivalTime: 20 Apr 2020 17:59:00.0592 (UTC) FILETIME=[5EDBDF00:01D6173D] X-RcptDomain: minnie.tuhs.org Subject: Re: [TUHS] 8th Edition and /dev/stdio X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs@minnie.tuhs.org Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --Apple-Mail=_EF27346D-8677-4C77-A8D5-64B64EA2805F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I looked through the later Editions. 9th is the same as 8th. In the 10th edition the hack is replaced by an equally small, slightly = naughty, but otherwise normal device driver: https://minnie.tuhs.org/cgi-bin/utree.pl?file=3DV10/sys/io/fd.c = This approach, too, would have worked as early as 4th edition. > On Apr 20, 2020, at 5:16 PM, arnold@skeeve.com wrote: >=20 > Glad to have helped. Maybe later systems did the symlink. I'm pretty = sure SVR4 and later Linux did > it with symlinks. >=20 > SVR4 went overboard - /dev/fd was a separate file system type! >=20 > Arnold >=20 > Paul Ruizendaal wrote: >=20 >> Thanks for that! >>=20 >> Indeed they are on the /dev/fd man page of 8th Edition. >>=20 >> I=E2=80=99m thrilled that https://unix50.org is back up and could = quickly check. They are not symlinks, but character special files (with = the same major/minor, of course). In the /dev/fd directory all 128 = possible device entries were added. >>=20 >> It certainly suggests that a virtual /dev directory (like /proc) = would have been useful. >>=20 >>>> Who added this neat little innovation? >>=20 >> Googling for /dev/fd also answered my other question: = http://poincare.matf.bg.ac.rs/~ivana/courses/ps/sistemi_knjige/pomocno/apu= e/APUE/0201433079/ch03lev1sec16.html >>=20 >> "The /dev/fd feature was developed by Tom Duff and appeared in the = 8th Edition of the Research UNIX System.=E2=80=9D >>=20 >>=20 >>=20 >>> On 20 Apr 2020, at 16:28, arnold@skeeve.com wrote: >>>=20 >>> See if there are man pages for /dev/fd/XXX. IIRC /dev/stdin was >>> a symlink to /dev/fd/0, /dev/stdout to /dev/fd/1, /dev/stderr to = /dev/fd/2, >>> and, as a really nice generalization, /dev/tty to /dev/fd/4. For = the >>> latter, init(1) simply dup'ed the opened tty file descriptor one = more >>> time before exec-ing login. >>>=20 >>> HTH, >>>=20 >>> Arnold >>>=20 >>> Paul Ruizendaal wrote: >>>=20 >>>> Whilst spelunking in the V8 source code I came across this dozen = lines: >>>> = http://chiselapp.com/user/pnr/repository/v8unix/artifact/2782d26fa2930724?= ln=3D174,187 >>>>=20 >>>> It implements the /dev/stdin, /dev/stdout and /dev/stderr devices = (the variable =E2=80=98file_no=E2=80=99 in above code snippet is the = constant 40, which is the major number of these devices). It would seem = that this handful of lines could have been in Unix as early as 4th = Edition =E2=80=94 but they weren=E2=80=99t. Maybe it was not seen as = useful. >>>>=20 >>>> As far as I can tell this bit of code originates in 8th Edition, = with no earlier precursors. It does not seem to be in its man pages. >>>>=20 >>>> Who added this neat little innovation? >>>>=20 >>>>=20 >>=20 --Apple-Mail=_EF27346D-8677-4C77-A8D5-64B64EA2805F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I = looked through the later Editions. 9th is the same as 8th.

In the 10th edition the = hack is replaced by an equally small, slightly naughty, but otherwise = normal device driver:

This = approach, too, would have worked as early as 4th edition.

On Apr 20, 2020, at 5:16 PM, arnold@skeeve.com = wrote:

Glad to have helped. Maybe later systems did the symlink. =  I'm pretty sure SVR4 and later Linux did
it with = symlinks.

SVR4 went overboard - /dev/fd was = a separate file system type!

Arnold

Paul Ruizendaal <pnr@planet.nl> wrote:

Thanks = for that!

Indeed they are on the /dev/fd = man page of 8th Edition.

I=E2=80=99m = thrilled that https://unix50.org is back up and could quickly check. = They are not symlinks, but character special files (with the same = major/minor, of course). In the /dev/fd directory all 128 possible = device entries were added.

It certainly = suggests that a virtual /dev directory (like /proc) would have been = useful.

Who added this neat = little innovation?

Googling for /dev/fd also answered my other question: http://poincare.matf.bg.ac.rs/~ivana/courses/ps/sistemi_knjige/= pomocno/apue/APUE/0201433079/ch03lev1sec16.html

"The /dev/fd feature was developed by Tom Duff and appeared = in the 8th Edition of the Research UNIX System.=E2=80=9D


On 20 Apr 2020, at 16:28, arnold@skeeve.com wrote:

See = if there are man pages for /dev/fd/XXX.  IIRC /dev/stdin was
a symlink to /dev/fd/0, /dev/stdout to /dev/fd/1, /dev/stderr = to /dev/fd/2,
and, as a really nice generalization, = /dev/tty to /dev/fd/4.  For the
latter, init(1) = simply dup'ed the opened tty file descriptor one more
time = before exec-ing login.

HTH,
Arnold

Paul Ruizendaal <pnr@planet.nl> wrote:

Whilst = spelunking in the V8 source code I came across this dozen lines:
http://chiselapp.com/user/pnr/repository/v8unix/artifact/2782d2= 6fa2930724?ln=3D174,187

It implements = the /dev/stdin, /dev/stdout and /dev/stderr devices (the variable = =E2=80=98file_no=E2=80=99 in above code snippet is the constant 40, = which is the major number of these devices). It would seem that this = handful of lines could have been in Unix as early as 4th Edition =E2=80=94= but they weren=E2=80=99t. Maybe it was not seen as useful.

As far as I can tell this bit of code = originates in 8th Edition, with no earlier precursors. It does not seem = to be in its man pages.

Who added this neat = little innovation?




= --Apple-Mail=_EF27346D-8677-4C77-A8D5-64B64EA2805F--