Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
errno_private.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
11
12#ifndef ZEPHYR_INCLUDE_SYS_ERRNO_PRIVATE_H_
13#define ZEPHYR_INCLUDE_SYS_ERRNO_PRIVATE_H_
14
15#include <zephyr/toolchain.h>
16#include <zephyr/types.h> /* For Z_THREAD_LOCAL */
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/* NOTE: located here to avoid include dependency loops between errno.h
23 * and kernel.h
24 */
25
26#ifdef CONFIG_LIBC_ERRNO
27#include <errno.h>
28
29static inline int *z_errno(void)
30{
31 return &errno;
32}
33
34#elif defined(CONFIG_ERRNO_IN_TLS)
35extern Z_THREAD_LOCAL int z_errno_var;
36
37static inline int *z_errno(void)
38{
39 return &z_errno_var;
40}
41#else
50__syscall int *z_errno(void);
51
52#endif /* CONFIG_ERRNO_IN_TLS */
53
54#ifdef __cplusplus
55}
56#endif
57
58#if !defined(CONFIG_ERRNO_IN_TLS) && !defined(CONFIG_LIBC_ERRNO)
59#include <zephyr/syscalls/errno_private.h>
60#endif /* CONFIG_ERRNO_IN_TLS */
61
62#endif /* ZEPHYR_INCLUDE_SYS_ERRNO_PRIVATE_H_ */
System error numbers.
#define errno
Definition errno.h:37
Macros to abstract toolchain specific capabilities.