Simon Glass | 7d0f1a2 | 2016-05-08 16:55:17 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 Samsung Electronics |
| 3 | * Przemyslaw Marczak <p.marczak@samsung.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
Wolfgang Denk | 74aedc1 | 2010-06-12 00:19:46 +0200 | [diff] [blame] | 7 | #ifndef _ERRNO_H |
Simon Glass | 7d0f1a2 | 2016-05-08 16:55:17 -0600 | [diff] [blame] | 8 | #define _ERRNO_H |
Wolfgang Denk | 74aedc1 | 2010-06-12 00:19:46 +0200 | [diff] [blame] | 9 | |
Masahiro Yamada | 64e4f7f | 2016-09-21 11:28:57 +0900 | [diff] [blame] | 10 | #include <linux/errno.h> |
Wolfgang Denk | 74aedc1 | 2010-06-12 00:19:46 +0200 | [diff] [blame] | 11 | |
| 12 | extern int errno; |
| 13 | |
| 14 | #define __set_errno(val) do { errno = val; } while (0) |
| 15 | |
Przemyslaw Marczak | 87e3161 | 2014-10-08 22:48:37 +0200 | [diff] [blame] | 16 | #ifdef CONFIG_ERRNO_STR |
| 17 | const char *errno_str(int errno); |
Simon Glass | 21adb08 | 2016-05-08 16:55:18 -0600 | [diff] [blame] | 18 | #else |
| 19 | static inline const char *errno_str(int errno) |
| 20 | { |
| 21 | return 0; |
| 22 | } |
Przemyslaw Marczak | 87e3161 | 2014-10-08 22:48:37 +0200 | [diff] [blame] | 23 | #endif |
Wolfgang Denk | 74aedc1 | 2010-06-12 00:19:46 +0200 | [diff] [blame] | 24 | #endif /* _ERRNO_H */ |