🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #145

AT&T system V fdopen mode checking

#145
From: Hae Hirdler
Date: Fri, 01 Dec 1989 02:56
15 lines
988 bytes
The man page on the fdopen states that "the type of the stream must 
agree with the mode of the open file."  But, when a file is open()'ed
( fd= open (filename, oflag) ), and fdopen()'ed for a stream 
( fptr= fdopen (fd, mode) ), it allows this open file to be opened for 
any type of a stream regardless of the type of oflag already open()'ed. 
For example, fd= open(filename, O_RDONLY); fptr= fdopen(filename, "w")
will return a NON_NULL fptr value instead of NULL.  

The semantics of the man page on the fdopen seems to indicate that 
this should not be allowed. (return NULL)  

Is this a known bug?  or what?
      
	 - Hae Hirdler  
	  
Technical Details
Message-ID: <713@mbf.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!texbell!texsun!letni!lawnet!mbf!hae

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!texbell!texsun!letni!lawnet!mbf!hae
From: hae@mbf.UUCP (Hae Hirdler)
Newsgroups: comp.bugs.sys5
Subject: AT&T system V fdopen mode checking
Message-ID: <713@mbf.UUCP>
Date: 1 Dec 89 02:56:26 GMT
Organization: MAI Basic Four, Inc.,  Tustin, CA
Lines: 15