BUG: alternatives

Charles Wilson cygwin@cwilson.fastmail.fm
Sun Nov 6 18:54:00 GMT 2005


It would help if I actually attached the patch.

Charles Wilson wrote:
> Christopher Faylor wrote:
> 
>> A signal shouldn't cause a truncated read when retrieving data from
>> disk on cygwin or linux.
> 
> 
> ACK.
> 
>> I think the only sane way to handle this is to put the read in a loop
>> and realloc the buffer as needed as long as the read continues to return
>> '>0'.
> 
> 
> Ok.
> 
>> It's obviously pretty racy to get the size of the file and then expect 
>> that
>> you'll be able to read in exactly that many bytes.
> 
> 
> ACK.
> 
> Revised patch attached.  I'm wondering, tho, about the advisability of 
> using alloca'ed (rather than malloc'ed) memory to hold the contents of a 
> file of unrestricted size.  Aren't there limits on the available space 
> within a single stack frame?  Does it make sense (is it legal) to alloca 
> 40k or 50k or 500k? of memory?
> 
> Granted, most /var/lib/alternatives files are going to be fairly small 
> (< 1k) but there's no guarantee of that...
> 
> -- 
> Chuck
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: alternatives-textmode-2.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20051106/8596e477/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list