Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!att!ucbvax!agate!violet.berkeley.edu!ilan343 From: ilan343@violet.berkeley.edu (Geraldo Veiga) Newsgroups: comp.unix.programmer Subject: Re: sscanf always generates error condition Message-ID: <1991May3.202851.13525@agate.berkeley.edu> Date: 3 May 91 20:28:51 GMT References: <1991May1.193252.16232@agate.berkeley.edu> <1991May2.134354.9719@dg-rtp.dg.com> <1991May3.095541.21439@athena.mit.edu> Sender: root@agate.berkeley.edu (Charlie Root) Distribution: usa Organization: University of California, Berkeley Lines: 19 In article <1991May3.095541.21439@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes: > There are quite a few system calls in the kernel that set errno to a value, >then try the operation which would cause that error value if it failed, and >then return immediately it it fails, signalling an error. They're allowed to >do that. > This seems to be the final word on this question. From now on I'll have two separate error handling routines: syserr(message) invoked only when a system call returns an error condition. This function prints "message", calls perror() and exits. usrerr(message) invoked for non-system errors, same as above without the call to perror(). Thanks for everybody's help.