Andrew Boie | 7f4d006 | 2018-07-19 11:09:33 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 Intel Corporation. |
| 3 | * |
| 4 | * SPDX-License-Identifier: Apache-2.0 |
| 5 | */ |
| 6 | |
Flavio Ceolin | 67ca176 | 2018-09-14 10:43:44 -0700 | [diff] [blame] | 7 | #ifndef ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_ |
| 8 | #define ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_ |
Andrew Boie | 7f4d006 | 2018-07-19 11:09:33 -0700 | [diff] [blame] | 9 | |
| 10 | #include <toolchain.h> |
| 11 | |
| 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | |
| 16 | /* NOTE: located here to avoid include dependency loops between errno.h |
| 17 | * and kernel.h |
| 18 | */ |
| 19 | |
| 20 | /** |
| 21 | * return a pointer to a memory location containing errno |
| 22 | * |
| 23 | * errno is thread-specific, and can't just be a global. This pointer |
| 24 | * is guaranteed to be read/writable from user mode. |
| 25 | * |
| 26 | * @return Memory location of errno data for current thread |
| 27 | */ |
| 28 | __syscall int *z_errno(void); |
| 29 | |
| 30 | #ifdef __cplusplus |
| 31 | } |
| 32 | #endif |
| 33 | |
| 34 | #include <syscalls/errno_private.h> |
| 35 | |
Flavio Ceolin | 67ca176 | 2018-09-14 10:43:44 -0700 | [diff] [blame] | 36 | #endif /* ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_ */ |