Interface __ERR_PTR

SpaceUser/kernel
ContextSync/async/rt-irq
May blockNo
SPLAny
Dynamic memoryNo

Preprocessor macro expanding to an expression

#include <SYS/TYPES.H>

void *p = __ERR_PTR(err)

Description

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.

Arguments

Returns

This macro returns a void pointer with encoded error code.

See also

__PTR_ERR, __IS_ERR