The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Warner Losh <imp@bsdimp.com>
To: Dave Horsfall <dave@horsfall.org>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] V6 networking & alarm syscall
Date: Fri, 11 Jan 2019 19:33:10 -0700	[thread overview]
Message-ID: <CANCZdfqdX5MdXWxWGkvsJD9zZwkPg7wLTbWrYNcNH65tQw0W_Q@mail.gmail.com> (raw)
In-Reply-To: <alpine.BSF.2.21.9999.1901121237300.90857@aneurin.horsfall.org>

[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]

On Fri, Jan 11, 2019 at 6:59 PM Dave Horsfall <dave@horsfall.org> wrote:

> On Fri, 11 Jan 2019, Noel Chiappa wrote:
>
> [ ... ]
>
> >         ioctl (0, FIONREAD, &nch);
> >                        if (nch == 0) {
> >                                tk_yield ();
> >                                continue;
> >                        }
> >                }
> >                if ((c = getchar()) == EOF) {
> >
> > so that ioctl() must look to see if there is any data waiting in the
> > terminal input buffer (I'm too lazy to go see what FIONREAD does, right
> > at the moment).
>
> As I dimly recall (because I'm too sick/lazy to look it up), it returns
> the number of characters in the input queue (at that time) so that you
> won't block (and time out, if you wrote it thus).
>
> It was quite useful, if you didn't like the horrible semantics of
> select(), or, for that matter, SysV poll() (?) which was only slightly
> better.
>
> Of course, FIONREAD wasn't always reliable, because by the time you got to
> using it the keyboard (l)user could have deleted some characters etc, and
> you *could* be left there hanging on a timeout (with signals, which for
> some reason I hate with a passion, as I've posted here before, as they
> are just too brutal).
>

This is why RAW mode was born, but then you're duplicating the kernel
cooking code in your ap :(


> No doubt someone here will tell me that Plan9 did it right :-)  I really
> must run it up some time, before I finally kark it (I'm in my late 60s).
>

No doubt...

Warner

[-- Attachment #2: Type: text/html, Size: 2287 bytes --]

  reply	other threads:[~2019-01-12  2:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-12  1:24 Noel Chiappa
2019-01-12  1:58 ` Dave Horsfall
2019-01-12  2:33   ` Warner Losh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-13 10:52 Paul Ruizendaal
2019-01-13 15:39 ` Warner Losh
     [not found] <mailman.1.1547258402.6716.tuhs@minnie.tuhs.org>
2019-01-12 11:13 ` Paul Ruizendaal
2019-01-12  4:14 Noel Chiappa
2019-01-11 23:27 Paul Ruizendaal
2019-01-10 23:12 Paul Ruizendaal
2019-01-11  0:17 ` Clem cole
2019-01-11 15:33 ` ron
2019-01-11 18:45   ` Clem Cole
2019-01-11 19:06     ` David
2019-01-11 22:08     ` reed
2019-01-11 22:18       ` Larry McVoy
2019-01-12 12:04         ` reed
2019-01-12 17:20           ` Clem Cole
2019-01-12 18:16             ` Eric Allman
2019-01-13  1:16               ` Madeline Autumn-Rose
2019-01-11 22:47       ` Clem Cole
2019-01-11 22:55         ` Eric Allman
2019-01-11 23:32         ` Warner Losh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANCZdfqdX5MdXWxWGkvsJD9zZwkPg7wLTbWrYNcNH65tQw0W_Q@mail.gmail.com \
    --to=imp@bsdimp.com \
    --cc=dave@horsfall.org \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).