On Tue, Dec 29, 2015 at 6:25 AM, Petri Savolainen <
[email protected]> wrote:

> Improved errno specification. Specified that errno may be
> set (on failure) also when API spec does not demand it. Errno
> values are implementation specific.
>
> Signed-off-by: Petri Savolainen <[email protected]>
>

Reviewed-by: Bill Fischofer <[email protected]>


> ---
>  include/odp/api/errno.h | 37 +++++++++++++++++++++++++++----------
>  1 file changed, 27 insertions(+), 10 deletions(-)
>
> diff --git a/include/odp/api/errno.h b/include/odp/api/errno.h
> index 9829807..33998b6 100644
> --- a/include/odp/api/errno.h
> +++ b/include/odp/api/errno.h
> @@ -17,20 +17,38 @@
>  extern "C" {
>  #endif
>
> -/** @defgroup odp_errno ODP ERRNO
> +/**
> + * @defgroup odp_errno ODP ERRNO
> + * @details
> + * <b> ODP errno </b>
> + *
> + * ODP errno (error number) is a thread local variable that any ODP
> function may
> + * set on a failure. It expresses additional information about the cause
> of
> + * the latest failure. A successful function call never sets errno.
> Application
> + * may initialize errno to zero at anytime by calling odp_errno_zero().
> Other
> + * ODP functions never set errno to zero. Valid errno values are non-zero
> + * and implementation specific. It's also implementation specific which
> + * functions set errno in addition to those explicitly specified by
> + * the API spec. ODP errno is initially zero.
> + *
>   *  @{
>   */
>
>  /**
> -* Return latest ODP errno
> +* Latest ODP errno
>  *
> -* @return ODP errno
> -* @retval 0 No error
> +* Returns the current ODP errno value on the calling thread. A non-zero
> value
> +* indicates cause of the latest errno setting failure.
> +*
> +* @return Latest ODP errno value
> +* @retval 0    Errno has not been set since the last initialization to
> zero
>  */
>  int odp_errno(void);
>
>  /**
>  * Set ODP errno to zero
> +*
> +* Sets errno value to zero on the calling thread.
>  */
>  void odp_errno_zero(void);
>
> @@ -40,20 +58,19 @@ void odp_errno_zero(void);
>  * Interprets the value of ODP errno as an error message, and prints it,
>  * optionally preceding it with the custom message specified in str.
>  *
> -* @param str NULL, or pointer to the string to be appended
> +* @param str   Pointer to the string to be appended, or NULL
>  */
>  void odp_errno_print(const char *str);
>
>  /**
>  * Error message string
>  *
> -* Interprets the value of ODP errno, generating a string with a
> -* message that describes the error.
> -* It uses the system definition of errno.
> +* Interprets the value of ODP errno, generating a string with a message
> that
> +* describes the error. Errno values and messages are implementation
> specific.
>  *
> -* @param errnum        Error code
> +* @param errnum         ODP errno value
>  *
> -* @retval Pointer to the string
> +* @retval Pointer to the error message string
>  */
>  const char *odp_errno_str(int errnum);
>
> --
> 2.6.3
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to