Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
75f08c85
Unverified
Commit
75f08c85
authored
Feb 20, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macro: add pointer error encoding support
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
bde8540b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
macro.h
src/lxc/macro.h
+39
-0
No files found.
src/lxc/macro.h
View file @
75f08c85
...
...
@@ -21,6 +21,8 @@
#include <sys/un.h>
#include <unistd.h>
#include "compiler.h"
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
...
...
@@ -670,4 +672,41 @@ enum {
(b) = __tmp; \
} while (0)
#define MAX_ERRNO 4095
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
static
inline
void
*
ERR_PTR
(
long
error
)
{
return
(
void
*
)
error
;
}
static
inline
long
PTR_ERR
(
const
void
*
ptr
)
{
return
(
long
)
ptr
;
}
static
inline
long
IS_ERR
(
const
void
*
ptr
)
{
return
IS_ERR_VALUE
((
unsigned
long
)
ptr
);
}
static
inline
long
IS_ERR_OR_NULL
(
const
void
*
ptr
)
{
return
!
ptr
||
IS_ERR_VALUE
((
unsigned
long
)
ptr
);
}
static
inline
void
*
ERR_CAST
(
const
void
*
ptr
)
{
return
(
void
*
)
ptr
;
}
static
inline
int
PTR_RET
(
const
void
*
ptr
)
{
if
(
IS_ERR
(
ptr
))
return
PTR_ERR
(
ptr
);
else
return
0
;
}
#endif
/* __LXC_MACRO_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment