NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: logout delay

    Date:        Tue, 21 Apr 2020 09:57:51 -0400
    From:        Greg Troxel <>
    Message-ID:  <>

  | I have a very dim memory of somewhere between init and getty there being
  | a small delay, so that if getty failed, there wouldn't be a rapid loop.

I doubt that is the delay that is being observed.

Before getty opens the terminal it does a sleep(2) - that is to guarantee
that the terminal remains closed for a detectable time, so that DTR would
remain unasserted, and a connected modem would hangup.

When getty was written, sleep(2) was the smallest sleep that was guaranteed
to actually cause a real delay - sleep(1) simply sleeps (or did) until the
clock ticked to the next second, which might be a nanosecond from now.
sleep(2) guarantees a dead time of between 1 and 2 seconds.

These days we probably don't often care all that much about hanging up
modems, and if we did, we could use nanosleep() or usleep() and make a
100ms or so delay more reliably.

  | Is there an actual problem?

Exactly.   Who cares?


Home | Main Index | Thread Index | Old Index