Simon Glass | 00e9e6d | 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 | 65cd3fa | 2010-06-12 00:19:46 +0200 | [diff] [blame] | 7 | #ifndef _ERRNO_H |
Simon Glass | 00e9e6d | 2016-05-08 16:55:17 -0600 | [diff] [blame] | 8 | #define _ERRNO_H |
Wolfgang Denk | 65cd3fa | 2010-06-12 00:19:46 +0200 | [diff] [blame] | 9 | |
| 10 | #include <asm-generic/errno.h> |
| 11 | |
| 12 | extern int errno; |
| 13 | |
| 14 | #define __set_errno(val) do { errno = val; } while (0) |
| 15 | |
Przemyslaw Marczak | 59345b1 | 2014-10-08 22:48:37 +0200 | [diff] [blame] | 16 | #ifdef CONFIG_ERRNO_STR |
| 17 | const char *errno_str(int errno); |
Simon Glass | 862887d | 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 | 59345b1 | 2014-10-08 22:48:37 +0200 | [diff] [blame] | 23 | #endif |
Wolfgang Denk | 65cd3fa | 2010-06-12 00:19:46 +0200 | [diff] [blame] | 24 | #endif /* _ERRNO_H */ |