blob: dc3e0142c6b52f48687d489a0e0e01c836657b09 [file] [log] [blame]
Andrew Boie7f4d0062018-07-19 11:09:33 -07001/*
2 * Copyright (c) 2018 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
Flavio Ceolin67ca1762018-09-14 10:43:44 -07007#ifndef ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_
8#define ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_
Andrew Boie7f4d0062018-07-19 11:09:33 -07009
10#include <toolchain.h>
11
12#ifdef __cplusplus
13extern "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 Ceolin67ca1762018-09-14 10:43:44 -070036#endif /* ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_ */