qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] Permit zero-sized qemu_malloc() & friends


From: Avi Kivity
Subject: Re: [Qemu-devel] Re: [PATCH] Permit zero-sized qemu_malloc() & friends
Date: Mon, 07 Dec 2009 15:28:46 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091203 Fedora/3.0-3.13.rc2.fc12 Thunderbird/3.0

On 12/07/2009 11:55 AM, Paolo Bonzini wrote:
OTOH, If all it does it log it to a file, theres a fair chance it might
succeed.


Not necessarily, for example fprintf may fail. There _may_ be a fair chance to succeed if you use write(2) directly, but that's it basically, and ENOMEM is always there waiting for you...

Right, if malloc() failed write(2) is likely to fail as well. More likely, in fact, since malloc() may have unused process memory to draw upon whereas write(2) can only allocate kernel memory.

--
error compiling committee.c: too many arguments to function





reply via email to

[Prev in Thread] Current Thread [Next in Thread]