Date: Thu, 23 May 1996 07:01:12 -0700 Message-Id: <199605231401.HAA06630@sayre.sysc.pdx.edu> From: Marcus Daniels To: Eli Zaretskii Cc: djgpp AT delorie DOT com Subject: Re: EACCES on read In-Reply-To: References: Reply-To: marcus AT sysc DOT pdx DOT edu >>>>> "EZ" == Eli Zaretskii 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!