From: kevin lyda (kevin at domain suberic.net)
Date: Thu 02 Aug 2001 - 15:15:09 IST
On Thu, Aug 02, 2001 at 02:11:31PM +0100, Paul Jakma wrote:
> On Thu, 2 Aug 2001, Waider wrote:
> > errno is /the/ global error variable. If something messes up in a
> > system call, errno is supposed to be set to indicate what went wrong.
> aye, i know. but what error handling within the application itself?
global vars aren't the best. functions that return "success" or "why
failed" are nicer, imho. you can return more complex things via pass
by reference params.
another idea is an error stack, libxml uses it, but that can suffer the
same issues as the errno one.
> unless applications are allowed to assign errno for their own
> purposes?
well, under ansi c i think that's frowned on. errno can be a macro that
calls a function. the main reason for this is threads. another issue
with global error vars is signals, but that's usually minor.
kevin
-- kevin at domain suberic.net simple four line sigs - fork()'ed on 37058400 bandwidth friendly; nice to do. meatspace place: home some admins clueless. http://suberic.net/~kevin --netiquette haiku 2001
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:27 GMT