> -----Original Message-----
> From: ext Mario Torrecillas Rodriguez
> [mailto:mario.torrecillasrodrig...@arm.com]
> Sent: Tuesday, January 20, 2015 5:08 PM
> To: Savolainen, Petri (NSN - FI/Espoo); lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCHv2] linux-generic: Add odp_errno and adapt
> packet_io and timer implementations to use it
> 
> Thanks for the review Petri. A short comment inlined.
> 
> On 20/01/2015 13:38, "Savolainen, Petri (NSN - FI/Espoo)"
> <petri.savolai...@nsn.com> wrote:
> 
> >
> >> --- /dev/null
> >> +++ b/platform/linux-generic/include/api/odp_errno.h
> >> @@ -0,0 +1,61 @@
> >> +/* Copyright (c) 2015, Linaro Limited
> >> + * All rights reserved.
> >> + *
> >> + * SPDX-License-Identifier: BSD-3-Clause
> >> + */
> >> +
> >> +/**
> >> + * @file
> >> + *
> >> + * ODP errno API
> >> + */
> >> +
> >> +#ifndef ODP_ERRNO_H_
> >> +#define ODP_ERRNO_H_
> >> +
> >> +#ifdef __cplusplus
> >> +extern "C" {
> >> +#endif
> >> +
> >> +#include <errno.h>
> >
> >This should be removed from API file (only implementation needs it).
> That¹s there so that both ODP libraries and applications using them can
> see the errno error definitions. Otherwise things like ³EEXIST² etc will
> give compile errors. The alternative would be to include both
> <odp_errno.h> and <errno.h> in implementation files and applications.
> Which option should we go with?

I'd leave it out for now.

The problem is that errno values are system specific (posix/linux/bare 
metal/?). The mechanism is portable (read/zero/print ODP errno), values are 
not. If user needs to include a system errno header by himself, that fact is 
highlighted.

As we are not (yet) specifying a portable range of errnos, so user can more or 
less log/report the value and not make a decision based on it.

-Petri


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to