Hi Eli,

    I've pulled the sources to the Cygnus library to investigate this 
problem a little further, and the buffer accessibility check is not 
occurring in the Cygnus implementation of "read" as I had thought.  
Instead, it is the Win32 API call "ReadFile" that is doing the check and 
returning the error.  Specifically, ReadFile is returning error 998, 
"Invalid access to memory location."  The Cygnus library is simply mapping 
this to an errno number (EACCES in this case).  So the check is occurring 
within Windows NT and not within the Cygnus library.

    I haven't tried this under Windows 98, but under Windows NT at least, 
it appears thatn one must specify a valid buffer when reading a file, even 
if, by some magic, the programmer knows that the inaccessible part of the 
buffer won't be used.

                                      -- Dave Bryan

Reply via email to