ARGOBOTS  1.1
Functions
Error

This group is for Error. More...

Functions

int ABT_error_get_str (int err, char *str, size_t *len)
 Retrieve a string of an error code and its length. More...
 

Detailed Description

This group is for Error.

Function Documentation

◆ ABT_error_get_str()

int ABT_error_get_str ( int  err,
char *  str,
size_t *  len 
)

Retrieve a string of an error code and its length.

ABT_error_get_str() returns a zero-terminated string of the error code err through str and its length in bytes through len.

If str is not NULL, the user must be responsible for passing str that has enough space to save "the length of the string + 1" bytes of characters. If str is NULL, str is not updated.

If len is not NULL, this routine sets the length of the string to len. If len is NULL, len is not updated.

Note
The length of the string does not count the terminator '\0'. For example, the length of "Hello world" is 11.
Changes from Argobots 1.x to Argobots 2.0 (planned)
[Argobots 1.x] ABT_ERR_OTHER is returned if err is not a valid error code.
[Argobots 2.0] ABT_ERR_INV_ARG is returned if err is not a valid error code.
Rationale
Argobots 2.0 changes the error code for consistent behavior with other Argobots routines.
Execution context
This routine can be called in any execution context. Argobots does not need to be initialized. This routine does not switch the context of the calling ULT unless any user-defined function that is involved in this routine switch the context of the calling ULT.
Errors
[Argobots 1.x] ABT_ERR_OTHER is returned if err is not a valid error code.
[Argobots 2.0] ABT_ERR_INV_ARG is returned if err is not a valid error code.
Parameters
[in]errerror code
[out]strerror string
[out]lenlength of string in bytes
Returns
Error code

Definition at line 52 of file error.c.