VSF Documented
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
source
shell
sys
linux
include
linux
err.h
Go to the documentation of this file.
1
#include <
linux/errno.h
>
2
3
#define MAX_ERRNO 4095
4
5
#define IS_ERR_VALUE(__X) ((unsigned long)(uintptr_t)(__X) >= (unsigned long)-MAX_ERRNO)
6
7
static
inline
void
* ERR_PTR(
long
error)
8
{
9
return
(
void
*)(
uintptr_t
)error;
10
}
11
12
static
inline
long
PTR_ERR(
const
void
*ptr)
13
{
14
return
(
long
)(
uintptr_t
)ptr;
15
}
16
17
static
inline
bool
IS_ERR(
const
void
*ptr)
18
{
19
return
IS_ERR_VALUE
(ptr);
20
}
21
22
static
inline
bool
IS_ERR_OR_NULL(
const
void
*ptr)
23
{
24
return
!ptr ||
IS_ERR_VALUE
(ptr);
25
}
26
27
static
inline
void
* ERR_CAST(
const
void
*ptr)
28
{
29
return
(
void
*)ptr;
30
}
31
32
static
inline
int
PTR_ERR_OR_ZERO(
const
void
*ptr)
33
{
34
if
(IS_ERR(ptr)) {
35
return
PTR_ERR(ptr);
36
}
else
{
37
return
0;
38
}
39
}
IS_ERR_VALUE
#define IS_ERR_VALUE(__X)
Definition
err.h:5
errno.h
uintptr_t
uint32_t uintptr_t
Definition
stdint.h:38
Generated by
1.9.8