]> git.proxmox.com Git - ceph.git/blame - ceph/src/include/err.h
bump version to 12.0.3-pve3
[ceph.git] / ceph / src / include / err.h
CommitLineData
7c673cae
FG
1#ifndef CEPH_ERR_H
2#define CEPH_ERR_H
3
4/*
5 * adapted from linux 2.6.24 include/linux/err.h
6 */
7#define MAX_ERRNO 4095
8#define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO)
9
10#include <errno.h>
11
12/* this generates a warning in c++; caller can do the cast manually
13static inline void *ERR_PTR(long error)
14{
15 return (void *) error;
16}
17*/
18
19static inline long PTR_ERR(const void *ptr)
20{
21 return (long) ptr;
22}
23
24static inline long IS_ERR(const void *ptr)
25{
26 return IS_ERR_VALUE((unsigned long)ptr);
27}
28
29#endif