This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Initialize IO_STATUS_BLOCK for pread, pwrite


Mark Geisert wrote:
---
 winsup/cygwin/fhandler_disk_file.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 5dfcae4d9..2ead9948c 100644
[...]

Oops, I neglected to include an explanatory comment. Issuing simultaneous pwrite(s) on one file descriptor from multiple threads, as one might do in a forthcoming POSIX aio implementation, sometimes results in garbage status in the IO_STATUS_BLOCK on return from NtWriteFile(). Zeroing beforehand made the issue go away.

This is mildly concerning to me because there are many other uses of IO_STATUS_BLOCK in the Cygwin DLL that haven't seemed to have needed initialization.

Puzzledly,

..mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]