Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Question about perror Keywords: perror(), ansi C, posix Message-ID: <14617@smoke.brl.mil> Date: 30 Nov 90 10:08:55 GMT References: <1990Nov28.152146.19560@ssd.kodak.com> <14603@smoke.brl.mil> <4573@oasys.dt.navy.mil> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article <4573@oasys.dt.navy.mil> stuart@oasys.dt.navy.mil (Stuart Pearlman) writes: >Is perror() specified in the ansi C standard? I avoid using perror() >after library routines such as fopen() because they can fail for other >reasons besides the system calls they make failing. Are any of the >library functions specified in the standard guaranteed to set errno? >(Is errno even guaranteed to exist?) What about posix 1003.1? Does >it specify what functions you can call perror() after? perror() is required for ANSI C conformance. errno is required, but only a few of the standard functions (mainly math functions) are required to set errno (upon certain conditions). IEEE Std 1003.1 specifies that errno is to be set for error returns from a large number of functions (mainly those normally implemented on UNIX as genuine system calls). The allowable values of errno ( macros) are specified for each function.