diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/errno.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/errno.h b/include/errno.h index 025816e067..496ccab0ee 100644 --- a/include/errno.h +++ b/include/errno.h @@ -2,6 +2,7 @@ #define __ERRNO_H #include <asm-generic/errno.h> +#include <linux/err.h> extern int errno; @@ -9,4 +10,9 @@ void perror(const char *s); const char *errno_str(void); const char *strerror(int errnum); +static inline const char *strerrorp(const void *errp) +{ + return strerror(-PTR_ERR(errp)); +} + #endif /* __ERRNO_H */ |