9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] panic(?) and error(?)
@ 2002-08-25 14:43 presotto
  2002-08-25 15:14 ` Lucio De Re
  2002-08-25 15:27 ` Lucio De Re
  0 siblings, 2 replies; 6+ messages in thread
From: presotto @ 2002-08-25 14:43 UTC (permalink / raw)
  To: 9fans

Error() in upas/fs.c just exits the process after printing a message.
I didn't use sysfatal() because I want to kill off the entire process
group on error and sysfatal doesn't.  If I'ld used the thread package
I wouldn't have needed to do it that way.

It is totally unrelated to the error() in the kernel nor
error() in 9660srv.  They implements an exception
stack so that they can cleanly back out of errors without
crashing.

The similarity in name implies nothing about similarity in
function.


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

* Re: [9fans] panic(?) and error(?)
  2002-08-25 14:43 [9fans] panic(?) and error(?) presotto
@ 2002-08-25 15:14 ` Lucio De Re
  2002-08-25 15:27 ` Lucio De Re
  1 sibling, 0 replies; 6+ messages in thread
From: Lucio De Re @ 2002-08-25 15:14 UTC (permalink / raw)
  To: 9fans

On Sun, Aug 25, 2002 at 10:43:27AM -0400, presotto@plan9.bell-labs.com wrote:
>
> Error() in upas/fs.c just exits the process after printing a message.
> I didn't use sysfatal() because I want to kill off the entire process
> group on error and sysfatal doesn't.  If I'ld used the thread package
> I wouldn't have needed to do it that way.
>
Did I perhaps miss a definition of error() local to upas/fs?  I could
easily have.

> It is totally unrelated to the error() in the kernel nor
> error() in 9660srv.  They implements an exception
> stack so that they can cleanly back out of errors without
> crashing.
>
9660srv uses panic() - again, I didn't think of looking for a local
definition - which takes a first argument that resembles an fd that
ought to be redirected to /dev/null.  That bit of logic baffles me.

> The similarity in name implies nothing about similarity in
> function.

I would make myself very unpopular if I mentioned that in studying
9p(2) and colleagues, I came to the conclusion that it would be
clearer in C++.  So I'll keep such thoughts to myself.  :-)  :-)

Namespace pollution caught me here, I'll go and do some additional
snooping.  Thanks for the clarification.

++L


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

* Re: [9fans] panic(?) and error(?)
  2002-08-25 14:43 [9fans] panic(?) and error(?) presotto
  2002-08-25 15:14 ` Lucio De Re
@ 2002-08-25 15:27 ` Lucio De Re
  1 sibling, 0 replies; 6+ messages in thread
From: Lucio De Re @ 2002-08-25 15:27 UTC (permalink / raw)
  To: 9fans

On Sun, Aug 25, 2002 at 10:43:27AM -0400, presotto@plan9.bell-labs.com wrote:
>
> Error() in upas/fs.c just exits the process after printing a message.

I note now that panic() in 9660srv actually uses the "rflag" as an
indicator of whether to print the syserror message or not.  I think
I'll be more methodical in my explorations in future.

++L


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

* Re: [9fans] panic(?) and error(?)
  2002-08-25 15:31 presotto
@ 2002-08-25 15:47 ` Lucio De Re
  0 siblings, 0 replies; 6+ messages in thread
From: Lucio De Re @ 2002-08-25 15:47 UTC (permalink / raw)
  To: 9fans

On Sun, Aug 25, 2002 at 11:31:15AM -0400, presotto@plan9.bell-labs.com wrote:
>
> Try using grep.  It's amazingly useful since we (bel labs

My brain may be a useful tool too, if only I could rely on it :-(

Sadly, it's hard to figure out what is a trivial question and what
is a legitimate one and I have a penchant to err on the side that
makes a fool of me :-)

++L


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

* Re: [9fans] panic(?) and error(?)
@ 2002-08-25 15:31 presotto
  2002-08-25 15:47 ` Lucio De Re
  0 siblings, 1 reply; 6+ messages in thread
From: presotto @ 2002-08-25 15:31 UTC (permalink / raw)
  To: 9fans

Try using grep.  It's amazingly useful since we (bel labs
crowd) use the convention of starting our routine defnitions
with the name on the left margin:

% cd /sys/src/cmd/9660srv
% grep -n '^(panic|error)' *.c
main.c:223: error(char *p)
main.c:558: panic(int rflag, char *fmt, ...)
% cd /sys/src/cmd/upas/fs
% grep -n '^(panic|error)' *.c
fs.c:1259: error(char *s)

Works well in the editor also.


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

* [9fans] panic(?) and error(?)
@ 2002-08-25 14:22 Lucio De Re
  0 siblings, 0 replies; 6+ messages in thread
From: Lucio De Re @ 2002-08-25 14:22 UTC (permalink / raw)
  To: 9fans mailing list

I'd like some descriptions for functions error() and panic() as used
in /sys/src/cmd/9660srv/main.c and /sys/src/cmd/upas/fs/fs.c
respectively - and elsewhere, no doubt.

The arguments are different and I'm having difficulty understanding
whether they are functionally similar but retained for historical
reasons (what would be the "modern" equivalent?) or whether in fact
the choice depends on the context.

I note that 9660srv closes fds 0 and 1 and reopens them in the most
harmless manner (/dev/null), which upas/fs does not do and I wonder
if these are influencing the choice of error reporting.

Of course, I do have the source to consult, but little guidance on
where to look, even.

++L


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

end of thread, other threads:[~2002-08-25 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-25 14:43 [9fans] panic(?) and error(?) presotto
2002-08-25 15:14 ` Lucio De Re
2002-08-25 15:27 ` Lucio De Re
  -- strict thread matches above, loose matches on Subject: below --
2002-08-25 15:31 presotto
2002-08-25 15:47 ` Lucio De Re
2002-08-25 14:22 Lucio De Re

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