Space | User/kernel |
Context | Sync/async/rt-irq |
May block | No |
SPL | Any |
Dynamic memory | No |
Preprocessor macro expanding to an expression
#include <SYS/TYPES.H>
void *p = __ERR_PTR(err)
This macro converts a negative error code to a pointer. The conversion method is architecture-specific. The returned pointer won't collide with any other pointer to aby object.
The macro is used in functions that return pointer, but also need to return an error code.
This macro returns a void pointer with encoded error code.