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

Re: [Xen-devel] [PATCH] libxen-3.0 (libxc rewrite)



Christian Limpach wrote:

On Mon, 21 Mar 2005 15:25:09 -0600, Anthony Liguori <aliguori@xxxxxxxxxx> 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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.