rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  rc and signals
@ 1993-04-16 15:30 rsalz
  1993-04-20  1:29 ` John Mackin
  0 siblings, 1 reply; 4+ messages in thread
From: rsalz @ 1993-04-16 15:30 UTC (permalink / raw)
  To: arnold, rc

> 	#ifdef SIGFOO
> 		{ SIGFOO, "sigfoo", "murphy came to town"},
> 	#endif /* SIGFOO */

Yes, of course, this is the right way to do it.

>Then, at startup, sort the table, eliminate duplicates, and voila, the
>signal can be used an index again.

No it can't; suppose I have a machine that leaves some signal numbers unused?

>  DGK is one smart guy

I remain mildly convinced that this is not true.
	/r$


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rc and signals
  1993-04-16 15:30 rc and signals rsalz
@ 1993-04-20  1:29 ` John Mackin
  0 siblings, 0 replies; 4+ messages in thread
From: John Mackin @ 1993-04-20  1:29 UTC (permalink / raw)
  To: The rc Mailing List

    >  DGK is one smart guy

    I remain mildly convinced that this is not true.

I'm with Rich.  Read some of his code and then see if you still believe that.

OK,
John.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re:  rc and signals
@ 1993-04-16 16:02 Arnold Robbins
  0 siblings, 0 replies; 4+ messages in thread
From: Arnold Robbins @ 1993-04-16 16:02 UTC (permalink / raw)
  To: rsalz, arnold, rc

> >Then, at startup, sort the table, eliminate duplicates, and voila, the
> >signal can be used an index again.
> 
> No it can't; suppose I have a machine that leaves some signal numbers unused?

It's a Simple Matter Of Programming to fill in the blank spots with
an entry that says "invalid signal" or "signal 17 (noname)".  I don't *think*
there are too many systems where the signal numbers are non-contiguous.

> >  DGK is one smart guy
> 
> I remain mildly convinced that this is not true.

Let me rephrase this then.  He's a pretty good programmer.  I also think he's
too quick to add features, but that's a different issue from "is ksh well
written code or not".  In my experience, ksh comes up and runs > 95% of the
time on almost any kind of Unix system out there. Ksh is generally the first
thing I bring up on a new system that doesn't have it (long habit, sorry :-).
Probably soon that will no longer be true for me, it'll be es (+ or - readline).

Arnold


^ permalink raw reply	[flat|nested] 4+ messages in thread

* rc and signals
@ 1993-04-16 15:00 Arnold Robbins
  0 siblings, 0 replies; 4+ messages in thread
From: Arnold Robbins @ 1993-04-16 15:00 UTC (permalink / raw)
  To: rc

> The more I think about it, the more I don't like the way rc uses signals
> as indicies.  I would rather see it extend sigmsgs to contain rows like
> 	{SIGTERM, "sigterm", "terminated"}
> Then, rather then using a signal as an index, it looped through the table
> to find the matching SIGxxx, and then used the table subscript as the
> index.  It might be possible to generate this table automatically.

Another way to do it would be to generate the table

	#ifdef SIGFOO
		{ SIGFOO, "sigfoo", "murphy came to town"},
	#endif /* SIGFOO */

Then, at startup, sort the table, eliminate duplicates, and voila, the
signal can be used an index again.

The "standard" signals don't need the ifdefs, but there are lots of other
signals that are not universal, and also signals that are often aliased
to each other (e.g. SIGPOLL <-> SIGIO, SIGCLD <-> SIGCHLD. Aren't merged
Unixes wondeful?)

I believe ksh does something along these lines.  For all that ksh may be
bloated as a language, DGK is one smart guy and there's no reason not to
borrow implementation tricks.

Arnold


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1993-04-20  1:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-16 15:30 rc and signals rsalz
1993-04-20  1:29 ` John Mackin
  -- strict thread matches above, loose matches on Subject: below --
1993-04-16 16:02 Arnold Robbins
1993-04-16 15:00 Arnold Robbins

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).