From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] libxen-3.0 (libxc rewrite) Date: Tue, 22 Mar 2005 09:04:47 -0600 Message-ID: <4240340F.8080600@us.ibm.com> References: <423F3BB5.3020600@us.ibm.com> <3d8eece2050322030245ed31b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <3d8eece2050322030245ed31b@mail.gmail.com> Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Christian.Limpach@cl.cam.ac.uk Cc: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org Christian Limpach wrote: >On Mon, 21 Mar 2005 15:25:09 -0600, Anthony Liguori wrote: > > >>o Provide consistent error semantics for all functions (-errno is >>returned on error). >> >> > >Why -errno? What's wrong with regular errno, like used everywhere >else in userspace? > > errno's a global variable and it's way to easy to lose it's value. For instance: if (read(fd, buffer, sizeof(buffer)) == -1) { close(fd); perror("read"); } Doesn't do what you'd expect. It gets particularly hairy when you're not sure what functions modify errno and which functions don't. Regards, Anthony Liguori > christian > > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click