On 21 January 2015 at 15:46, Savolainen, Petri (NSN - FI/Espoo) <[email protected]> wrote: >> -----Original Message----- >> From: ext Mario Torrecillas Rodriguez >> [mailto:[email protected]] >> Sent: Tuesday, January 20, 2015 5:08 PM >> To: Savolainen, Petri (NSN - FI/Espoo); [email protected] >> 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)" >> <[email protected]> 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. What about the ODP implementation's usage of odp_errno? If an ODP function returns an error code through odp_errno(), the user must know how to interpret the value. The user cannot start defining their own meaning of specific error codes (numeric values).
> > 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 > [email protected] > http://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
