mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 01:15:50 +08:00
[libc] Add the header sys/types.h.
Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D136642
This commit is contained in:
@@ -296,6 +296,13 @@ def SysSendfileAPI : PublicAPI<"sys/sendfile.h"> {
|
||||
let Types = ["off_t", "size_t", "ssize_t"];
|
||||
}
|
||||
|
||||
def SysTypesAPI : PublicAPI<"sys/types.h"> {
|
||||
let Types = ["blkcnt_t", "blksize_t", "clockid_t", "dev_t", "gid_t", "ino_t",
|
||||
"mode_t", "nlink_t", "off_t", "pid_t", "pthread_attr_t", "pthread_key_t",
|
||||
"pthread_mutex_t", "pthread_mutexattr_t", "pthread_once_t", "pthread_t",
|
||||
"size_t", "ssize_t", "suseconds_t", "time_t", "uid_t"];
|
||||
}
|
||||
|
||||
def SysUtsNameAPI : PublicAPI<"sys/utsname.h"> {
|
||||
let Types = ["struct utsname"];
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ set(TARGET_PUBLIC_HEADERS
|
||||
libc.include.sys_stat
|
||||
libc.include.sys_syscall
|
||||
libc.include.sys_time
|
||||
libc.include.sys_types
|
||||
libc.include.sys_utsname
|
||||
libc.include.sys_wait
|
||||
)
|
||||
|
||||
@@ -347,6 +347,35 @@ add_gen_header(
|
||||
.llvm-libc-macros.sys_time_macros
|
||||
)
|
||||
|
||||
add_gen_header(
|
||||
sys_types
|
||||
DEF_FILE sys/types.h.def
|
||||
GEN_HDR sys/types.h
|
||||
DEPENDS
|
||||
.llvm_libc_common_h
|
||||
.llvm-libc-types.blkcnt_t
|
||||
.llvm-libc-types.blksize_t
|
||||
.llvm-libc-types.clockid_t
|
||||
.llvm-libc-types.dev_t
|
||||
.llvm-libc-types.gid_t
|
||||
.llvm-libc-types.ino_t
|
||||
.llvm-libc-types.mode_t
|
||||
.llvm-libc-types.nlink_t
|
||||
.llvm-libc-types.off_t
|
||||
.llvm-libc-types.pid_t
|
||||
.llvm-libc-types.pthread_attr_t
|
||||
.llvm-libc-types.pthread_key_t
|
||||
.llvm-libc-types.pthread_mutex_t
|
||||
.llvm-libc-types.pthread_mutexattr_t
|
||||
.llvm-libc-types.pthread_once_t
|
||||
.llvm-libc-types.pthread_t
|
||||
.llvm-libc-types.size_t
|
||||
.llvm-libc-types.ssize_t
|
||||
.llvm-libc-types.suseconds_t
|
||||
.llvm-libc-types.time_t
|
||||
.llvm-libc-types.uid_t
|
||||
)
|
||||
|
||||
add_gen_header(
|
||||
sys_utsname
|
||||
DEF_FILE sys/utsname.h.def
|
||||
|
||||
16
libc/include/sys/types.h.def
Normal file
16
libc/include/sys/types.h.def
Normal file
@@ -0,0 +1,16 @@
|
||||
//===-- Header for sys/types.h --------------------------------------------===//
|
||||
//
|
||||
// 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_SYS_TYPES_H
|
||||
#define LLVM_LIBC_SYS_TYPES_H
|
||||
|
||||
#include <__llvm-libc-common.h>
|
||||
|
||||
%%public_api()
|
||||
|
||||
#endif // LLVM_LIBC_SYS_TYPES_H
|
||||
@@ -1205,6 +1205,16 @@ def POSIX : StandardSpec<"POSIX"> {
|
||||
]
|
||||
>;
|
||||
|
||||
HeaderSpec SysTypes = HeaderSpec<
|
||||
"sys/types.h",
|
||||
[], // Macros
|
||||
[BlkCntT, BlkSizeT, ClockIdT, DevT, GidT, InoT, ModeTType, NLinkT, OffTType, PidT,
|
||||
PThreadAttrTType, PThreadKeyT, PThreadMutexTType, PThreadMutexAttrTType, PThreadOnceT, PThreadTType,
|
||||
SizeTType, SSizeTType, SuSecondsT, TimeTType, UidT],
|
||||
[], // Enumerations
|
||||
[] // Functions
|
||||
>;
|
||||
|
||||
let Headers = [
|
||||
CType,
|
||||
Dirent,
|
||||
@@ -1220,6 +1230,7 @@ def POSIX : StandardSpec<"POSIX"> {
|
||||
SysResource,
|
||||
SysSelect,
|
||||
SysStat,
|
||||
SysTypes,
|
||||
SysUtsName,
|
||||
SysWait,
|
||||
Time,
|
||||
|
||||
Reference in New Issue
Block a user