diff --git a/include/misc/errno_private.h b/include/misc/errno_private.h index dc3e0142c6b..ebf00250d2b 100644 --- a/include/misc/errno_private.h +++ b/include/misc/errno_private.h @@ -1,36 +1,15 @@ /* - * Copyright (c) 2018 Intel Corporation. + * Copyright (c) 2019 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ - #ifndef ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_ #define ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_ -#include - -#ifdef __cplusplus -extern "C" { +#ifndef CONFIG_COMPAT_INCLUDES +#warning "This header file has moved, include instead." #endif -/* NOTE: located here to avoid include dependency loops between errno.h - * and kernel.h - */ - -/** - * return a pointer to a memory location containing errno - * - * errno is thread-specific, and can't just be a global. This pointer - * is guaranteed to be read/writable from user mode. - * - * @return Memory location of errno data for current thread - */ -__syscall int *z_errno(void); - -#ifdef __cplusplus -} -#endif - -#include +#include #endif /* ZEPHYR_INCLUDE_MISC_ERRNO_PRIVATE_H_ */ diff --git a/include/sys/errno_private.h b/include/sys/errno_private.h new file mode 100644 index 00000000000..a51f37765b1 --- /dev/null +++ b/include/sys/errno_private.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018 Intel Corporation. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_SYS_ERRNO_PRIVATE_H_ +#define ZEPHYR_INCLUDE_SYS_ERRNO_PRIVATE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* NOTE: located here to avoid include dependency loops between errno.h + * and kernel.h + */ + +/** + * return a pointer to a memory location containing errno + * + * errno is thread-specific, and can't just be a global. This pointer + * is guaranteed to be read/writable from user mode. + * + * @return Memory location of errno data for current thread + */ +__syscall int *z_errno(void); + +#ifdef __cplusplus +} +#endif + +#include + +#endif /* ZEPHYR_INCLUDE_SYS_ERRNO_PRIVATE_H_ */ diff --git a/lib/libc/minimal/include/errno.h b/lib/libc/minimal/include/errno.h index 4d2230c4901..cb50ef71b1b 100644 --- a/lib/libc/minimal/include/errno.h +++ b/lib/libc/minimal/include/errno.h @@ -17,7 +17,7 @@ #ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ERRNO_H_ #define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ERRNO_H_ -#include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/libc/newlib/libc-hooks.c b/lib/libc/newlib/libc-hooks.c index cabb0f1c833..ef7245eea23 100644 --- a/lib/libc/newlib/libc-hooks.c +++ b/lib/libc/newlib/libc-hooks.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include