www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/23/10:05:51

Date: Thu, 23 May 1996 07:01:12 -0700
Message-Id: <199605231401.HAA06630@sayre.sysc.pdx.edu>
From: Marcus Daniels <marcus AT sysc DOT pdx DOT edu>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp AT delorie DOT com
Subject: Re: EACCES on read
In-Reply-To: <Pine.SUN.3.91.960523074744.3216D-100000@is>
References: <rfi689on61j DOT fsf AT sayre DOT sysc DOT pdx DOT edu>
<Pine DOT SUN DOT 3 DOT 91 DOT 960523074744 DOT 3216D-100000 AT is>
Reply-To: marcus AT sysc DOT pdx DOT edu

>>>>> "EZ" == Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> writes:

me> I'm using DJGPP2 with the `heapfix' patched CWSDPMI DPMI server.
me> From time to time, I get a failed `read' and errno of EACCES.

EZ> Please tell more about this, it's very hard to help you based on
EZ> the info you provided.  Why do you think the `heapfix' patch is
EZ> relevant? 

Just avoiding the "go get it" dance...

EZ>  Can you post a small test program that exhibits the errors?  Did you try
EZ> to see whether your disk drive is failing sometimes?

Now I can describe the problem with precision:

If there is a pre-existing file, which you then try to overwrite
using `creat', the first read from the file will return a -1 with
errno==EACCESS, instead of a zero-length read.

The two workarounds are: 
  1) Wrap `read' with another function that checks for the -1/EACCES
     combination.
  1) Delete the file before you recreate it.

Thanks!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019