www.delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=1.4 required=5.0 tests=AWL,BAYES_50,T_RP_MATCHES_RCVD |
X-Spam-Check-By: | sourceware.org |
MIME-Version: | 1.0 |
Date: | Thu, 22 Jul 2010 17:42:50 -0400 |
Message-ID: | <AANLkTinoCTcs_bndrSDZ-ixE1PTCIp6_lwA5mvI7k1Be@mail.gmail.com> |
Subject: | 1.7.5+: Bug in write() handling of 'disk full' condition? (XP) |
From: | Catalin Patulea <cat AT vv DOT carleton DOT ca> |
To: | cygwin AT cygwin DOT com |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Hi, I'm running a Windows XP SP3 with NTFS drives and woefully little disk space.. I have ~200MB free on my D:\ drive. When I use write() with a buffer larger than my available disk space, the return value is bogus and sometimes larger than the buffer size I pass in (!). errno is not set. I believe this is due to incorrect STATUS_DISK_FULL handling in winsup/cygwin/fhandler.cc: if (!NT_SUCCESS (status)) { if (status == STATUS_DISK_FULL && io.Information > 0) goto written; [...] written: return io.Information; } io.Information is only filled in if status is STATUS_SUCCESS. Here is what the Wine project has to say on the topic: http://source.winehq.org/WineAPI/NtWriteFile.html See also the small utility in attachment, which uses NtWriteFile directly and dumps status and io.Information out to the screen. Here is what it does on my system with 200 MB available: $ ./testwrite.exe 256 writing 256 MB... bytes: 10000000 status: c000007f (STATUS_DISK_FULL) iosb.info: 6116ce83 iosb.info looks a lot like the garbage values write() was returning. I would be happy to submit a patch but I just wanted to get discussion started on this topic first, especially since changes in this area of the code are potentially very far-reaching. Catalin -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |