From a mailing list I belong to, a back-and-forth is going on that I am
not involved in. The following sums it up nicely:
> It's really the implied equality that's the problem. For example:
>
> if (flags & DLADM_OPT_PERSIST) {
>
> would be better written as:
>
> if ((flags & DLADM_OPT_PERSIST) == 0) {
Seriously? What do (or would) "original C" programmers think of this? To me, anything non-zero is "true" so the first is perfectly acceptable.
The original assertion in the discussion was that the following is not "right" because of the mixing of bitwise and boolean.
> if ((flags & DLADM_OPT_PERSIST) && (link_flags & DLMGMT_PERSIST)) {
art k.
At the risk of stirring up another hornets nest...
I never accepted the Microsoft
“write functions for maximal indentation, with only one return”
and stick to
“get out if the function asap, try to have success at the bottom of the function”
style.
this means my code is usually fairly narrow.
-Steve
I found head on 3BSD and thought it might be as simple to compile as
cr3, unfortunately, it isn't. I did:
$ cc head.c
head.o?
$ cc -c head.c
head.o?
$ pcc head.c
head.c
head.o?
I thought the assembler, as, was cryptic, at least there you get a one
character error response. What is cc trying to say? Obviously head.o
won't exist unless cc succeeds...
Thanks,
Will
--
GPG Fingerprint: 68F4 B3BD 1730 555A 4462 7D45 3EAA 5B6D A982 BAAF
On 6 November 2017 at 19:36, Ron Natalie <ron(a)ronnatalie.com> wrote:
> It’s worse than that. “char” is defined as neither signed nor unsigned.
> The signedness is implementation defined. This was why we have the inane
> “signed” keyword.
What was that story about porting an early UNIX to a machine with
different char polarity? I dimly recall only a few problems.
N.
> In the meantime, how did folks page through text like man sh
Chuckle. "Text like man sh" wasn't very long back then.
.,.20p was quite an effective pager. It could go backward,
and it didn't wipe out the screen (which can destroy the
record of the problem that caused you to consult a reference).
I still do it from time to time.
Doug
>
> Regarding the links and old bsd's. The binary cr3 on 1bsd works in v7.
> Also, the book I'm reading has a c program that does paging. But, I'm
> always off down the rabbit hole... I tried to compile the cr3.c source
> and I get this error:
>
> # cc cr3.c
> Undefined:
> _fout
> _flush
> _getc
> _end
>
> My understanding is that cc includes libc by default, so these must not
> be in libc. But getc is standard lib, so what am I missing?
That source is for V6 not V7. V6 did not have the stdio lib yet, but a precursor to that.
The binary you are using has the older io routines statically linked in.
Paul
From: Ron Natalie
> We actually still had some real DEC DH's on our system.
> ...
> At least the DZ doesn't loop on the ready bit like the kernel printf
This reminds me of something I recall reading about John McNamara (designer of
the DH11) admitting that he'd screwed up a bit in the DH design; IIRC it was
that if you set the input silo alarm (interrupt) level to something greater
than 1 character, and someone types one character, and then nothing
else... you never get an input interrupt!
(Which is why some Unix DH driver which sets the silo alarm level > 1 - to get
more efficient processing by reducing the number of interrupts _if possible_ -
has to call a 'input characters ready from the DH' routine in the clock
interrupt code.)
IIRC McNamara said he should have included a timeout, so that if the silo
count was non-zero,and stayed that way for a while, it should have caused
a timeout, and an interrupt.
I was just looking for this, but couldn't find it. I thought it was here:
http://woffordwitch.com/McNamaraDH11.asp
but it doesn't seem to be. Does anyone recall seeing this anywhere, and if so,
where? Web search engines didn't turn anything up, alas...
Noel
> From: Clem Cole
> many (most) Unix sites used Able DHDM's which were cheaper than DEC DZ's
Oh, our DZ's weren't DEC, but some off-brand (I forget what). We were too poor
to afford DEC gear! :-) (Our machines, first a /40, and later a /45, were
hand-me-down's.)
Noel
> From: Will Senn
> how did folks page through text like man sh and such before more?
We wrote our own versions of more. Here is one from the roughly-PWB1 systems
at MIT:
http://ana-3.lcs.mit.edu/~jnc/tech/unix/s2/p.c
but on looking at it, I'm not 100% sure it's the one I used there (which is
documented in the MIT UPM).
Here's one I wrote for myself for use on V6:
http://mercury.lcs.mit.edu/~jnc/tech/V6Unix.html#UCmds
before I retrieved all the MIT sources (above), if you want somthing to
actually use on V6/V7.
Noel