mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-15 23:06:32 +00:00
[libc] Add unistd overlay (#119312)
Reverts the revert #119295 of #118882 by expanding #118882 with additional fixes which made CI unhappy.
This commit is contained in:
parent
4c5ddc9ed4
commit
7477b61b24
@ -126,10 +126,13 @@ add_proxy_header_library(
|
||||
libc.include.llvm-libc-macros.sys_stat_macros
|
||||
)
|
||||
|
||||
add_header_library(unistd_overlay HDRS unistd_overlay.h)
|
||||
add_proxy_header_library(
|
||||
unistd_macros
|
||||
HDRS
|
||||
unistd_macros.h
|
||||
DEPENDS
|
||||
.unistd_overlay
|
||||
FULL_BUILD_DEPENDS
|
||||
libc.include.unistd
|
||||
libc.include.llvm-libc-macros.unistd_macros
|
||||
|
@ -93,6 +93,14 @@ add_proxy_header_library(
|
||||
libc.include.llvm-libc-types.size_t
|
||||
)
|
||||
|
||||
add_proxy_header_library(
|
||||
ssize_t
|
||||
HDRS
|
||||
ssize_t.h
|
||||
FULL_BUILD_DEPENDS
|
||||
libc.include.llvm-libc-types.ssize_t
|
||||
)
|
||||
|
||||
add_proxy_header_library(
|
||||
mode_t
|
||||
HDRS
|
||||
@ -309,3 +317,11 @@ add_proxy_header_library(
|
||||
libc.include.llvm-libc-types.wint_t
|
||||
libc.include.wchar
|
||||
)
|
||||
|
||||
add_proxy_header_library(
|
||||
uid_t
|
||||
HDRS
|
||||
uid_t.h
|
||||
FULL_BUILD_DEPENDS
|
||||
libc.include.llvm-libc-types.uid_t
|
||||
)
|
||||
|
@ -14,9 +14,7 @@
|
||||
|
||||
#else
|
||||
|
||||
#define __need_ssize_t
|
||||
#include <stddef.h>
|
||||
#undef __need_ssize_t
|
||||
#include <sys/types.h>
|
||||
|
||||
#endif // LIBC_FULL_BUILD
|
||||
|
||||
|
22
libc/hdr/types/uid_t.h
Normal file
22
libc/hdr/types/uid_t.h
Normal file
@ -0,0 +1,22 @@
|
||||
//===-- Proxy for uid_t ---------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_HDR_TYPES_UID_T_H
|
||||
#define LLVM_LIBC_HDR_TYPES_UID_T_H
|
||||
|
||||
#ifdef LIBC_FULL_BUILD
|
||||
|
||||
#include "include/llvm-libc-types/uid_t.h"
|
||||
|
||||
#else // Overlay mode
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#endif // LLVM_LIBC_FULL_BUILD
|
||||
|
||||
#endif // LLVM_LIBC_HDR_TYPES_UID_T_H
|
@ -15,7 +15,7 @@
|
||||
|
||||
#else // Overlay mode
|
||||
|
||||
#include <unistd.h>
|
||||
#include "unistd_overlay.h"
|
||||
|
||||
#endif // LLVM_LIBC_FULL_BUILD
|
||||
|
||||
|
69
libc/hdr/unistd_overlay.h
Normal file
69
libc/hdr/unistd_overlay.h
Normal file
@ -0,0 +1,69 @@
|
||||
//===-- Including unistd.h in overlay mode -------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_HDR_UNISTD_OVERLAY_H
|
||||
#define LLVM_LIBC_HDR_UNISTD_OVERLAY_H
|
||||
|
||||
#ifdef LIBC_FULL_BUILD
|
||||
#error "This header should only be included in overlay mode"
|
||||
#endif
|
||||
|
||||
// Overlay mode
|
||||
|
||||
// glibc <unistd.h> header might provide extern inline definitions for few
|
||||
// functions, causing external alias errors. They are guarded by
|
||||
// `__USE_EXTERN_INLINES` macro. We temporarily disable `__USE_EXTERN_INLINES`
|
||||
// macro by defining `__NO_INLINE__` before including <stdio.h>.
|
||||
// And the same with `__USE_FORTIFY_LEVEL`, which will be temporarily disabled
|
||||
// with `_FORTIFY_SOURCE`.
|
||||
|
||||
#ifdef _FORTIFY_SOURCE
|
||||
#define LIBC_OLD_FORTIFY_SOURCE _FORTIFY_SOURCE
|
||||
#undef _FORTIFY_SOURCE
|
||||
#endif
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
#define LIBC_OLD_USE_EXTERN_INLINES
|
||||
#undef __USE_EXTERN_INLINES
|
||||
#endif
|
||||
|
||||
#ifdef __USE_FORTIFY_LEVEL
|
||||
#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
|
||||
#undef __USE_FORTIFY_LEVEL
|
||||
#define __USE_FORTIFY_LEVEL 0
|
||||
#endif
|
||||
|
||||
#ifndef __NO_INLINE__
|
||||
#define __NO_INLINE__ 1
|
||||
#define LIBC_SET_NO_INLINE
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef LIBC_OLD_FORTIFY_SOURCE
|
||||
#define _FORTIFY_SOURCE LIBC_OLD_FORTIFY_SOURCE
|
||||
#undef LIBC_OLD_FORTIFY_SOURCE
|
||||
#endif
|
||||
|
||||
#ifdef LIBC_SET_NO_INLINE
|
||||
#undef __NO_INLINE__
|
||||
#undef LIBC_SET_NO_INLINE
|
||||
#endif
|
||||
|
||||
#ifdef LIBC_OLD_USE_FORTIFY_LEVEL
|
||||
#undef __USE_FORTIFY_LEVEL
|
||||
#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL
|
||||
#undef LIBC_OLD_USE_FORTIFY_LEVEL
|
||||
#endif
|
||||
|
||||
#ifdef LIBC_OLD_USE_EXTERN_INLINES
|
||||
#define __USE_EXTERN_INLINES
|
||||
#undef LIBC_OLD_USE_EXTERN_INLINES
|
||||
#endif
|
||||
|
||||
#endif // LLVM_LIBC_HDR_UNISTD_OVERLAY_H
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_DUP_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_DUP_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_DUP2_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_DUP2_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_DUP3_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_DUP3_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_FORK_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_FORK_H
|
||||
|
||||
#include "hdr/types/pid_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_FTRUNCATE_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_FTRUNCATE_H
|
||||
|
||||
#include "hdr/types/off_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_GETCWD_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_GETCWD_H
|
||||
|
||||
#include "hdr/types/size_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_GETEUID_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_GETEUID_H
|
||||
|
||||
#include "hdr/types/uid_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
#define LLVM_LIBC_SRC_UNISTD_GETOPT_H
|
||||
|
||||
#include "hdr/types/FILE.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_GETPID_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_GETPID_H
|
||||
|
||||
#include "hdr/types/pid_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_GETPPID_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_GETPPID_H
|
||||
|
||||
#include "hdr/types/pid_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_GETUID_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_GETUID_H
|
||||
|
||||
#include "hdr/types/uid_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_ISATTY_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_ISATTY_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_LINK_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_LINK_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -45,6 +45,7 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../dup.h
|
||||
DEPENDS
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -72,6 +73,7 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../dup3.h
|
||||
DEPENDS
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -98,6 +100,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../fork.h
|
||||
DEPENDS
|
||||
libc.hdr.types.pid_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.threads.fork_callbacks
|
||||
@ -166,6 +170,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../ftruncate.h
|
||||
DEPENDS
|
||||
libc.hdr.types.off_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -179,6 +185,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../getcwd.h
|
||||
DEPENDS
|
||||
libc.hdr.types.size_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -192,6 +200,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../geteuid.h
|
||||
DEPENDS
|
||||
libc.hdr.types.uid_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -204,6 +214,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../getpid.h
|
||||
DEPENDS
|
||||
libc.hdr.types.pid_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -216,6 +228,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../getppid.h
|
||||
DEPENDS
|
||||
libc.hdr.types.pid_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -228,6 +242,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../getuid.h
|
||||
DEPENDS
|
||||
libc.hdr.types.uid_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -240,6 +256,7 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../isatty.h
|
||||
DEPENDS
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_ioctl
|
||||
libc.include.sys_syscall
|
||||
@ -282,6 +299,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../lseek.h
|
||||
DEPENDS
|
||||
libc.hdr.types.off_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -349,6 +368,10 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../pread.h
|
||||
DEPENDS
|
||||
libc.hdr.types.off_t
|
||||
libc.hdr.types.size_t
|
||||
libc.hdr.types.ssize_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -363,6 +386,10 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../pwrite.h
|
||||
DEPENDS
|
||||
libc.hdr.types.off_t
|
||||
libc.hdr.types.size_t
|
||||
libc.hdr.types.ssize_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -376,6 +403,9 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../read.h
|
||||
DEPENDS
|
||||
libc.hdr.types.size_t
|
||||
libc.hdr.types.ssize_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -404,6 +434,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../readlink.h
|
||||
DEPENDS
|
||||
libc.hdr.types.size_t
|
||||
libc.hdr.types.ssize_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
@ -418,6 +450,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../readlinkat.h
|
||||
DEPENDS
|
||||
libc.hdr.types.size_t
|
||||
libc.hdr.types.ssize_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
@ -485,6 +519,8 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../truncate.h
|
||||
DEPENDS
|
||||
libc.hdr.types.off_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
@ -526,6 +562,9 @@ add_entrypoint_object(
|
||||
HDRS
|
||||
../write.h
|
||||
DEPENDS
|
||||
libc.hdr.types.size_t
|
||||
libc.hdr.types.ssize_t
|
||||
libc.hdr.fcntl_macros
|
||||
libc.include.unistd
|
||||
libc.include.sys_syscall
|
||||
libc.src.__support.OSUtil.osutil
|
||||
|
@ -11,11 +11,11 @@
|
||||
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
|
||||
#include "src/__support/common.h"
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include "src/errno/libc_errno.h"
|
||||
#include <stdint.h> // For uint64_t.
|
||||
#include <sys/syscall.h> // For syscall numbers.
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
|
||||
#include "src/__support/common.h"
|
||||
|
||||
#include "hdr/types/off_t.h"
|
||||
#include <sys/syscall.h> // For syscall numbers.
|
||||
#include <unistd.h> // For off_t.
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -10,11 +10,11 @@
|
||||
|
||||
#include "src/__support/common.h"
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include "src/errno/libc_errno.h"
|
||||
#include "src/sys/auxv/getauxval.h"
|
||||
#include <sys/auxv.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -13,9 +13,9 @@
|
||||
#include "src/__support/macros/config.h"
|
||||
#include "src/errno/libc_errno.h"
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include <stdint.h> // For uint64_t.
|
||||
#include <sys/syscall.h> // For syscall numbers.
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_LSEEK_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_LSEEK_H
|
||||
|
||||
#include "hdr/types/off_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,11 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_PREAD_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_PREAD_H
|
||||
|
||||
#include "hdr/types/off_t.h"
|
||||
#include "hdr/types/size_t.h"
|
||||
#include "hdr/types/ssize_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,11 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_PWRITE_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_PWRITE_H
|
||||
|
||||
#include "hdr/types/off_t.h"
|
||||
#include "hdr/types/size_t.h"
|
||||
#include "hdr/types/ssize_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,10 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_READ_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_READ_H
|
||||
|
||||
#include "hdr/types/size_t.h"
|
||||
#include "hdr/types/ssize_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,10 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_READLINK_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_READLINK_H
|
||||
|
||||
#include "hdr/types/size_t.h"
|
||||
#include "hdr/types/ssize_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,10 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_READLINKAT_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_READLINKAT_H
|
||||
|
||||
#include "hdr/types/size_t.h"
|
||||
#include "hdr/types/ssize_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_SWAB_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_SWAB_H
|
||||
|
||||
#include "hdr/types/ssize_t.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h> // For ssize_t
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_SYMLINK_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_SYMLINK_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_SYMLINKAT_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_SYMLINKAT_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_SYSCALL_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_SYSCALL_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_SYSCONF_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_SYSCONF_H
|
||||
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_TRUNCATE_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_TRUNCATE_H
|
||||
|
||||
#include "hdr/types/off_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -9,8 +9,10 @@
|
||||
#ifndef LLVM_LIBC_SRC_UNISTD_WRITE_H
|
||||
#define LLVM_LIBC_SRC_UNISTD_WRITE_H
|
||||
|
||||
#include "hdr/types/size_t.h"
|
||||
#include "hdr/types/ssize_t.h"
|
||||
#include "hdr/unistd_macros.h"
|
||||
#include "src/__support/macros/config.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
|
||||
|
@ -23,7 +23,7 @@ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
|
||||
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
|
||||
|
||||
TEST(LlvmLibcRemapFilePagesTest, NoError) {
|
||||
size_t page_size = sysconf(_SC_PAGE_SIZE);
|
||||
size_t page_size = LIBC_NAMESPACE::sysconf(_SC_PAGE_SIZE);
|
||||
ASSERT_GT(page_size, size_t(0));
|
||||
|
||||
// Create a file-backed mapping
|
||||
@ -53,7 +53,7 @@ TEST(LlvmLibcRemapFilePagesTest, NoError) {
|
||||
}
|
||||
|
||||
TEST(LlvmLibcRemapFilePagesTest, ErrorInvalidFlags) {
|
||||
size_t page_size = sysconf(_SC_PAGE_SIZE);
|
||||
size_t page_size = LIBC_NAMESPACE::sysconf(_SC_PAGE_SIZE);
|
||||
ASSERT_GT(page_size, size_t(0));
|
||||
|
||||
// Create a file-backed mapping
|
||||
@ -81,7 +81,7 @@ TEST(LlvmLibcRemapFilePagesTest, ErrorInvalidFlags) {
|
||||
}
|
||||
|
||||
TEST(LlvmLibcRemapFilePagesTest, ErrorInvalidAddress) {
|
||||
size_t page_size = sysconf(_SC_PAGESIZE);
|
||||
size_t page_size = LIBC_NAMESPACE::sysconf(_SC_PAGESIZE);
|
||||
ASSERT_GT(page_size, size_t(0));
|
||||
|
||||
// Use an address that we haven't mapped
|
||||
|
@ -180,6 +180,14 @@ libc_support_library(
|
||||
],
|
||||
)
|
||||
|
||||
libc_support_library(
|
||||
name = "hdr_unistd_macros",
|
||||
hdrs = ["hdr/unistd_macros.h"],
|
||||
deps = [
|
||||
":hdr_unistd_overlay",
|
||||
],
|
||||
)
|
||||
|
||||
libc_support_library(
|
||||
name = "hdr_limits_macros",
|
||||
hdrs = ["hdr/limits_macros.h"],
|
||||
@ -195,6 +203,11 @@ libc_support_library(
|
||||
hdrs = ["hdr/stdlib_overlay.h"],
|
||||
)
|
||||
|
||||
libc_support_library(
|
||||
name = "hdr_unistd_overlay",
|
||||
hdrs = ["hdr/unistd_overlay.h"],
|
||||
)
|
||||
|
||||
############################ Type Proxy Header Files ###########################
|
||||
|
||||
libc_support_library(
|
||||
@ -300,6 +313,11 @@ libc_support_library(
|
||||
hdrs = ["hdr/types/pid_t.h"],
|
||||
)
|
||||
|
||||
libc_support_library(
|
||||
name = "types_uid_t",
|
||||
hdrs = ["hdr/types/uid_t.h"],
|
||||
)
|
||||
|
||||
libc_support_library(
|
||||
name = "types_off_t",
|
||||
hdrs = ["hdr/types/off_t.h"],
|
||||
@ -3996,6 +4014,7 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4008,6 +4027,7 @@ libc_function(
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_fcntl_macros",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4023,6 +4043,7 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4067,6 +4088,8 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_off_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4078,6 +4101,8 @@ libc_function(
|
||||
# ":__support_common",
|
||||
# ":__support_osutil_syscall",
|
||||
# ":errno",
|
||||
# ":hdr_unistd_macros",
|
||||
# ":types_size_t",
|
||||
# ],
|
||||
# )
|
||||
|
||||
@ -4089,6 +4114,9 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_size_t",
|
||||
":types_uid_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4100,6 +4128,8 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_pid_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4111,6 +4141,8 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_uid_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4125,6 +4157,7 @@ libc_function(
|
||||
# ":__support_file_file",
|
||||
# ":__support_osutil_syscall",
|
||||
# ":errno",
|
||||
# ":hdr_unistd_macros",
|
||||
# ],
|
||||
# )
|
||||
|
||||
@ -4136,6 +4169,7 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4148,6 +4182,7 @@ libc_function(
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_fcntl_macros",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4160,6 +4195,7 @@ libc_function(
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_fcntl_macros",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4184,6 +4220,8 @@ libc_function(
|
||||
":__support_file_linux_lseekimpl",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_off_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4200,6 +4238,10 @@ libc_function(
|
||||
":__support_macros_sanitizer",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_off_t",
|
||||
":types_size_t",
|
||||
":types_ssize_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4215,6 +4257,10 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_off_t",
|
||||
":types_size_t",
|
||||
":types_ssize_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4228,6 +4274,9 @@ libc_function(
|
||||
":__support_macros_sanitizer",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_size_t",
|
||||
":types_ssize_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4240,6 +4289,9 @@ libc_function(
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_fcntl_macros",
|
||||
":hdr_unistd_macros",
|
||||
":types_size_t",
|
||||
":types_ssize_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4252,6 +4304,9 @@ libc_function(
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_fcntl_macros",
|
||||
":hdr_unistd_macros",
|
||||
":types_size_t",
|
||||
":types_ssize_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4276,6 +4331,7 @@ libc_function(
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_fcntl_macros",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4288,6 +4344,7 @@ libc_function(
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_fcntl_macros",
|
||||
":hdr_unistd_macros",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4302,6 +4359,7 @@ libc_function(
|
||||
# ":__support_common",
|
||||
# ":__support_osutil_syscall",
|
||||
# ":errno",
|
||||
# ":hdr_unistd_macros",
|
||||
# ],
|
||||
# )
|
||||
|
||||
@ -4313,6 +4371,8 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_ssize_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4324,6 +4384,8 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_off_t",
|
||||
],
|
||||
)
|
||||
|
||||
@ -4360,6 +4422,9 @@ libc_function(
|
||||
":__support_common",
|
||||
":__support_osutil_syscall",
|
||||
":errno",
|
||||
":hdr_unistd_macros",
|
||||
":types_size_t",
|
||||
":types_ssize_t",
|
||||
],
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user