🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #1079

Re: 'what' doesn't use perror to print open errors, Sys V/3.0

#1079
From: Dave Decot
Date: Mon, 01 May 1989 22:12
21 lines
1344 bytes
> > (1) "what" uses fopen() to open the file.  perror() is inappropriate
> > except when a system call reports failure.  fopen() is not a system call.
> 
> I regularly use perror() to report the failure of an fopen().  It works on
> all the systems I've used because, of course, the fopen() doesn't make any
> other system calls after the open().  Is this really a bad thing to do?

It's not bad on an X/Open system.

X/Open recognized the widespread use of perror() after library routines
that can experience underlying system errors, and gave this practice
its blessing.

Therefore, systems that claim compliance to Issue III of the X/Open
Portability Guide will set errno for these functions as documented.
Note that IEEE Standard 1003.1 (POSIX) also appears to require this
behavior for systems implementing the Standard C Language Binding.

Dave Decot
Past Chair
X/Open System Interface Working Group
Technical Details
Message-ID: <4910004@hpisod2.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ig!bionet!agate!ucbvax!hplabs!hpda!hpcupt1!hpisod2!decot
References: <3759@sugar.hackercorp.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ig!bionet!agate!ucbvax!hplabs!hpda!hpcupt1!hpisod2!decot
From: decot@hpisod2.HP.COM (Dave Decot)
Newsgroups: comp.bugs.sys5
Subject: Re: 'what' doesn't use perror to print open errors, Sys V/3.0
Message-ID: <4910004@hpisod2.HP.COM>
Date: 1 May 89 22:12:39 GMT
References: <3759@sugar.hackercorp.com>
Organization: Hewlett Packard, Cupertino
Lines: 21