Skip to content
Permalink
Browse files

cleanup: include/: move misc/errno_private.h to sys/errno_private.h

move misc/errno_private.h to sys/errno_private.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information...
nashif committed Jun 26, 2019
1 parent ee9dd1a commit 896b8d3c50eb857f070b631a218154710163b5db
Showing with 42 additions and 27 deletions.
  1. +4 −25 include/misc/errno_private.h
  2. +36 −0 include/sys/errno_private.h
  3. +1 −1 lib/libc/minimal/include/errno.h
  4. +1 −1 lib/libc/newlib/libc-hooks.c
@@ -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 <toolchain.h>

#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
}
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <sys/errno_private.h> instead."
#endif

#include <syscalls/errno_private.h>
#include <sys/errno_private.h>

#endif /* ZEPHYR_INCLUDE_MISC_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 <toolchain.h>

#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 <syscalls/errno_private.h>

#endif /* ZEPHYR_INCLUDE_SYS_ERRNO_PRIVATE_H_ */
@@ -17,7 +17,7 @@
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ERRNO_H_
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_ERRNO_H_

#include <misc/errno_private.h>
#include <sys/errno_private.h>

#ifdef __cplusplus
extern "C" {
@@ -11,7 +11,7 @@
#include <linker/linker-defs.h>
#include <misc/util.h>
#include <kernel_internal.h>
#include <misc/errno_private.h>
#include <sys/errno_private.h>
#include <misc/libc-hooks.h>
#include <syscall_handler.h>
#include <app_memory/app_memdomain.h>

0 comments on commit 896b8d3

Please sign in to comment.
You can’t perform that action at this time.