From: Christian Limpach Subject: Re: [PATCH] libxen-3.0 (libxc rewrite) Date: Tue, 22 Mar 2005 16:41:54 +0000 Message-ID: <20050322164154.GS31328@cl.cam.ac.uk> References: <423F3BB5.3020600@us.ibm.com> <3d8eece2050322030245ed31b@mail.gmail.com> <4240340F.8080600@us.ibm.com> <20050322160146.GQ31328@cl.cam.ac.uk> <42404294.6000101@us.ibm.com> <20050322161350.GR31328@cl.cam.ac.uk> <424045FF.5000908@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <424045FF.5000908@us.ibm.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: Anthony Liguori Cc: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org On Tue, Mar 22, 2005 at 10:21:19AM -0600, Anthony Liguori wrote: > Christian Limpach wrote: > > >>You're right. Some of the interfaces are a little awkward (especially > >>the memory mapping ones). It seemed like a reasonable trade-off to make > >>though. > >> > >> > > > >What about perror, warn, err and the likes, I really like to use those. > >It seems very illogical having to stick the returned value into errno to be > >able to use those... > > > > > You're not going to like this answer but I don't think I would use any > of those functions in a real management application. Management tools > should be using standard logging suites (like syslog). You mean like using `%m' in your format string to syslog(3)? > strerror() still works with these return codes btw. My test code > usually likes like this: > > domid_t domid; > int ret = dom_create_domain(3000, 0, &domid); > > if (ret < 0) error("dom_create_domain: failed %s", strerror(-ret)); While most other people's test code would look like this: domid = dom_create_domain(3000, 0); if (domid < 0) err(1, "dom_create_domain"); I claim that this is what more people are used to since most libraries support this interface, i.e. return _value_ with documented specific error values, failure condition in errno and error reporting using one of the various standard functions. christian ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click