未验证 提交 3236e8a1 编写于 作者: O openharmony_ci 提交者: Gitee

!330 feature:C库适配iar

Merge pull request !330 from xuxinyu/master
#ifdef __ICCARM__ /* for iar */
#include_next <assert.h>
#else
#include <features.h> #include <features.h>
#undef assert #undef assert
...@@ -23,6 +20,4 @@ _Noreturn void __assert_fail (const char *, const char *, int, const char *); ...@@ -23,6 +20,4 @@ _Noreturn void __assert_fail (const char *, const char *, int, const char *);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __ICCARM__ */
#endif #endif
...@@ -12,30 +12,6 @@ ...@@ -12,30 +12,6 @@
#define __LONG_MAX 0x7fffffffL #define __LONG_MAX 0x7fffffffL
#ifdef __ICCARM__
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
#include <stddef.h>
#define __DEFINED_wchar_t
#endif
#endif
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
#include <math.h>
#define __DEFINED_float_t
#endif
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
#include <math.h>
#define __DEFINED_double_t
#endif
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
#include <stddef.h>
#define __DEFINED_max_align_t
#endif
#endif /* __ICCARM__ */
#ifndef __cplusplus #ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef unsigned wchar_t; typedef unsigned wchar_t;
...@@ -64,113 +40,6 @@ typedef struct { long long __ll; long double __ld; } max_align_t; ...@@ -64,113 +40,6 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __BIG_ENDIAN 4321 #define __BIG_ENDIAN 4321
#define __USE_TIME_BITS64 1 #define __USE_TIME_BITS64 1
#ifdef __ICCARM__
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
#include <stddef.h>
#define __DEFINED_size_t
#endif
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
#include <stdint.h>
#define __DEFINED_uintptr_t
#endif
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
#include <stddef.h>
#define __DEFINED_ptrdiff_t
#endif
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
#include <stdint.h>
#define __DEFINED_intptr_t
#endif
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
#include <time.h>
#define __DEFINED_time_t
#endif
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
#include <time.h>
#define __DEFINED_clock_t
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
#include <time.h>
#define __DEFINED_struct_timespec
#endif
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
#include <wchar.h>
#define __DEFINED_wint_t
#endif
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
#include <wchar.h>
#define __DEFINED_wctype_t
#endif
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
#include <stdarg.h>
#define __DEFINED_va_list
#endif
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
#include <wchar.h>
#define __DEFINED_mbstate_t
#endif
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) && defined(__INT8_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int8_t
#endif
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) && defined(__INT16_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int16_t
#endif
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) && defined(__INT32_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int32_t
#endif
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) && defined(__INT64_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int64_t
#endif
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) && defined(__UINT8_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint8_t
#endif
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) && defined(__UINT16_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint16_t
#endif
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) && defined(__UINT32_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint32_t
#endif
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) && defined(__UINT64_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint64_t
#endif
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
#include <stdint.h>
#define __DEFINED_intmax_t
#endif
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
#include <stdint.h>
#define __DEFINED_uintmax_t
#endif
#endif /* __ICCARM__ */
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t) #if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t; typedef unsigned _Addr size_t;
#define __DEFINED_size_t #define __DEFINED_size_t
......
#ifndef __ICCARM__
typedef int32_t int_fast16_t; typedef int32_t int_fast16_t;
typedef int32_t int_fast32_t; typedef int32_t int_fast32_t;
typedef uint32_t uint_fast16_t; typedef uint32_t uint_fast16_t;
...@@ -19,4 +18,3 @@ typedef uint32_t uint_fast32_t; ...@@ -19,4 +18,3 @@ typedef uint32_t uint_fast32_t;
#define PTRDIFF_MIN INT32_MIN #define PTRDIFF_MIN INT32_MIN
#define PTRDIFF_MAX INT32_MAX #define PTRDIFF_MAX INT32_MAX
#define SIZE_MAX UINT32_MAX #define SIZE_MAX UINT32_MAX
#endif
\ No newline at end of file
#ifndef _COMPLEX_H #ifndef _COMPLEX_H
#define _COMPLEX_H #define _COMPLEX_H
#ifdef __ICCARM__ /* for iar */
#include_next <complex.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -135,5 +131,4 @@ long double creall(long double complex); ...@@ -135,5 +131,4 @@ long double creall(long double complex);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _CTYPE_H #ifndef _CTYPE_H
#define _CTYPE_H #define _CTYPE_H
#ifdef __ICCARM__ /* for iar */
#include_next <ctype.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -76,5 +72,4 @@ int toascii(int); ...@@ -76,5 +72,4 @@ int toascii(int);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _ERRNO_H #ifndef _ERRNO_H
#define _ERRNO_H #define _ERRNO_H
#ifdef __ICCARM__ /* for iar */
#include_next <errno.h>
#ifdef errno
#undef errno
#endif
#ifdef EDOM
#undef EDOM
#endif
#ifdef ERANGE
#undef ERANGE
#endif
#ifdef EFPOS
#undef EFPOS
#endif
#ifdef EILSEQ
#undef EILSEQ
#endif
#ifdef _NERR
#undef _NERR
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#include <bits/errno.h>
#ifdef __GNUC__
__attribute__((const))
#endif
int *__errno_location(void);
#define errno (*__errno_location())
#ifdef __cplusplus
}
#endif
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -71,6 +23,5 @@ extern char *program_invocation_short_name, *program_invocation_name; ...@@ -71,6 +23,5 @@ extern char *program_invocation_short_name, *program_invocation_name;
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _FENV_H #ifndef _FENV_H
#define _FENV_H #define _FENV_H
#ifdef __ICCARM__ /* for iar */
#include_next <fenv.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -29,6 +25,5 @@ int feupdateenv(const fenv_t *); ...@@ -29,6 +25,5 @@ int feupdateenv(const fenv_t *);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _FLOAT_H #ifndef _FLOAT_H
#define _FLOAT_H #define _FLOAT_H
#ifdef __ICCARM__ /* for iar */
#include_next <float.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -53,5 +49,4 @@ int __flt_rounds(void); ...@@ -53,5 +49,4 @@ int __flt_rounds(void);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _INTTYPES_H #ifndef _INTTYPES_H
#define _INTTYPES_H #define _INTTYPES_H
#ifdef __ICCARM__ /* for iar */
#include_next <inttypes.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -229,6 +225,5 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); ...@@ -229,6 +225,5 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _ISO646_H #ifndef _ISO646_H
#define _ISO646_H #define _ISO646_H
#ifdef __ICCARM__ /* for iar */
#include_next <iso646.h>
#else
#ifndef __cplusplus #ifndef __cplusplus
#define and && #define and &&
...@@ -21,5 +17,4 @@ ...@@ -21,5 +17,4 @@
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
...@@ -3,17 +3,6 @@ ...@@ -3,17 +3,6 @@
#include "los_config.h" #include "los_config.h"
#ifdef __ICCARM__ /* for iar */
#define PATH_MAX 256
#define NAME_MAX 255
#define MQ_PRIO_MAX 1
#define PTHREAD_STACK_MIN LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE
#define IOV_MAX 1024
#define SSIZE_MAX LONG_MAX
#define PTHREAD_KEYS_MAX 128
#include_next <limits.h>
#else
#include <features.h> #include <features.h>
#include <bits/alltypes.h> /* __LONG_MAX */ #include <bits/alltypes.h> /* __LONG_MAX */
...@@ -176,5 +165,4 @@ ...@@ -176,5 +165,4 @@
#define _XOPEN_NAME_MAX 255 #define _XOPEN_NAME_MAX 255
#define _XOPEN_PATH_MAX 1024 #define _XOPEN_PATH_MAX 1024
#endif /* __ICCARM__ */
#endif #endif
#ifndef _LOCALE_H #ifndef _LOCALE_H
#define _LOCALE_H #define _LOCALE_H
#ifdef __ICCARM__ /* for iar */
#include_next <locale.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -87,5 +83,4 @@ locale_t uselocale(locale_t); ...@@ -87,5 +83,4 @@ locale_t uselocale(locale_t);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _MATH_H #ifndef _MATH_H
#define _MATH_H #define _MATH_H
#ifdef __ICCARM__ /* for iar */
#include_next <math.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -443,5 +439,4 @@ long double pow10l(long double); ...@@ -443,5 +439,4 @@ long double pow10l(long double);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _SETJMP_H #ifndef _SETJMP_H
#define _SETJMP_H #define _SETJMP_H
#ifdef __ICCARM__ /* for iar */
#include_next <setjmp.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -42,5 +38,4 @@ _Noreturn void longjmp (jmp_buf, int); ...@@ -42,5 +38,4 @@ _Noreturn void longjmp (jmp_buf, int);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDALIGN_H #ifndef _STDALIGN_H
#define _STDALIGN_H #define _STDALIGN_H
#ifdef __ICCARM__ /* for iar */
#include_next <stdalign.h>
#else
#ifndef __cplusplus #ifndef __cplusplus
/* this whole header only works in C11 or with compiler extensions */ /* this whole header only works in C11 or with compiler extensions */
...@@ -21,5 +17,4 @@ ...@@ -21,5 +17,4 @@
#define __alignas_is_defined 1 #define __alignas_is_defined 1
#define __alignof_is_defined 1 #define __alignof_is_defined 1
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDARG_H #ifndef _STDARG_H
#define _STDARG_H #define _STDARG_H
#ifdef __ICCARM__ /* for iar */
#include_next <stdarg.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -22,5 +18,4 @@ extern "C" { ...@@ -22,5 +18,4 @@ extern "C" {
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDBOOL_H #ifndef _STDBOOL_H
#define _STDBOOL_H #define _STDBOOL_H
#ifdef __ICCARM__ /* for iar */
#include_next <stdbool.h>
#else
#ifndef __cplusplus #ifndef __cplusplus
#define true 1 #define true 1
...@@ -15,5 +11,4 @@ ...@@ -15,5 +11,4 @@
#define __bool_true_false_are_defined 1 #define __bool_true_false_are_defined 1
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDDEF_H #ifndef _STDDEF_H
#define _STDDEF_H #define _STDDEF_H
#ifdef __ICCARM__ /* for iar */
#include_next <stddef.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
#define NULL 0L #define NULL 0L
#else #else
...@@ -26,5 +22,4 @@ ...@@ -26,5 +22,4 @@
#define offsetof(type, member) ((size_t)( (char *)&(((type *)0)->member) - (char *)0 )) #define offsetof(type, member) ((size_t)( (char *)&(((type *)0)->member) - (char *)0 ))
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDINT_H #ifndef _STDINT_H
#define _STDINT_H #define _STDINT_H
#ifdef __ICCARM__ /* for iar */
#include_next <stdint.h>
#else
#define __NEED_int8_t #define __NEED_int8_t
#define __NEED_int16_t #define __NEED_int16_t
#define __NEED_int32_t #define __NEED_int32_t
...@@ -118,5 +114,4 @@ typedef uint64_t uint_least64_t; ...@@ -118,5 +114,4 @@ typedef uint64_t uint_least64_t;
#define UINTMAX_C(c) c ## ULL #define UINTMAX_C(c) c ## ULL
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDIO_H #ifndef _STDIO_H
#define _STDIO_H #define _STDIO_H
#ifdef __ICCARM__ /* for iar */
#include_next <stdio.h>
int rename(const char *, const char *);
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -224,5 +219,4 @@ FILE *fopencookie(void *, const char *, cookie_io_functions_t); ...@@ -224,5 +219,4 @@ FILE *fopencookie(void *, const char *, cookie_io_functions_t);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDLIB_H #ifndef _STDLIB_H
#define _STDLIB_H #define _STDLIB_H
#ifdef __ICCARM__ /* for iar */
#include_next <stdlib.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -177,5 +173,4 @@ long double strtold_l(const char *__restrict, char **__restrict, struct __locale ...@@ -177,5 +173,4 @@ long double strtold_l(const char *__restrict, char **__restrict, struct __locale
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STDNORETURN_H #ifndef _STDNORETURN_H
#define _STDNORETURN_H #define _STDNORETURN_H
#ifdef __ICCARM__ /* for iar */
#include_next <stdnoreturn.h>
#else
#ifndef __cplusplus #ifndef __cplusplus
#include <features.h> #include <features.h>
#define noreturn _Noreturn #define noreturn _Noreturn
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _STRING_H #ifndef _STRING_H
#define _STRING_H #define _STRING_H
#ifdef __ICCARM__ /* for iar */
#include_next <string.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -141,5 +137,4 @@ char *__strncpy (char *__restrict, const char *__restrict, size_t); ...@@ -141,5 +137,4 @@ char *__strncpy (char *__restrict, const char *__restrict, size_t);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
\ No newline at end of file
#ifndef _TGMATH_H #ifndef _TGMATH_H
#define _TGMATH_H #define _TGMATH_H
#ifdef __ICCARM__ /* for iar */
#include_next <tgmath.h>
#else
/* /*
the return types are only correct with gcc (__GNUC__) the return types are only correct with gcc (__GNUC__)
otherwise they are long double or long double complex otherwise they are long double or long double complex
...@@ -271,5 +267,4 @@ so they can be in null pointer constants ...@@ -271,5 +267,4 @@ so they can be in null pointer constants
#define tgamma(x) __tg_real(tgamma, (x)) #define tgamma(x) __tg_real(tgamma, (x))
#define trunc(x) __tg_real(trunc, (x)) #define trunc(x) __tg_real(trunc, (x))
#endif /* __ICCARM__ */
#endif #endif
#ifndef _THREADS_H #ifndef _THREADS_H
#define _THREADS_H #define _THREADS_H
#ifdef __ICCARM__ /* for iar */
#include_next <threads.h>
#else
#include <features.h> #include <features.h>
#include <time.h> #include <time.h>
...@@ -94,5 +90,4 @@ __REDIR(cnd_timedwait, __cnd_timedwait_time64); ...@@ -94,5 +90,4 @@ __REDIR(cnd_timedwait, __cnd_timedwait_time64);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _TIME_H #ifndef _TIME_H
#define _TIME_H #define _TIME_H
#ifdef __ICCARM__ /* for iar */
#if !defined(_DLIB_TIME_USES_64) || !defined(_DLIB_TIME_USES_LONG) || (_DLIB_TIME_USES_64 == 0) || (_DLIB_TIME_USES_LONG == 0)
#error "_DLIB_TIME_USES_64=1 and _DLIB_TIME_USES_LONG=1 should be defined in IAR project(C/C++ Compiler->Preprocessor->Defined symbols)."
#endif
#ifndef tm_isdst
#define tm_isdst tm_isdst; \
long __tm_gmtoff; \
const char *__tm_zone
#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
#define __tm_gmtoff tm_gmtoff
#define __tm_zone tm_zone
#endif
#include_next <time.h>
#undef tm_isdst
#else /* tm_isdst */
#include_next <time.h>
#endif /* tm_isdst */
#ifdef __cplusplus
extern "C" {
#endif
#define __NEED_timer_t
#define __NEED_clockid_t
#include <bits/alltypes.h>
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
#define CLOCK_PROCESS_CPUTIME_ID 2
#define CLOCK_THREAD_CPUTIME_ID 3
#define CLOCK_MONOTONIC_RAW 4
#define CLOCK_REALTIME_COARSE 5
#define CLOCK_MONOTONIC_COARSE 6
#define CLOCK_BOOTTIME 7
#define CLOCK_REALTIME_ALARM 8
#define CLOCK_BOOTTIME_ALARM 9
#define CLOCK_SGI_CYCLE 10
#define CLOCK_TAI 11
#define TIMER_ABSTIME 1
struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict);
struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict);
int nanosleep (const struct timespec *, struct timespec *);
int clock_getres (clockid_t, struct timespec *);
int clock_gettime (clockid_t, struct timespec *);
int clock_settime (clockid_t, const struct timespec *);
int clock_nanosleep (clockid_t, int, const struct timespec *, struct timespec *);
struct sigevent;
int timer_create (clockid_t, struct sigevent *__restrict, timer_t *__restrict);
int timer_delete (timer_t);
int timer_settime (timer_t, int, const struct itimerspec *__restrict, struct itimerspec *__restrict);
int timer_gettime (timer_t, struct itimerspec *);
int timer_getoverrun (timer_t);
#ifdef __cplusplus
}
#endif
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -239,5 +163,4 @@ __REDIR(timegm, __timegm_time64); ...@@ -239,5 +163,4 @@ __REDIR(timegm, __timegm_time64);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _UCHAR_H #ifndef _UCHAR_H
#define _UCHAR_H #define _UCHAR_H
#ifdef __ICCARM__ /* for iar */
#include_next <uchar.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -30,5 +26,4 @@ size_t mbrtoc32(char32_t *__restrict, const char *__restrict, size_t, mbstate_t ...@@ -30,5 +26,4 @@ size_t mbrtoc32(char32_t *__restrict, const char *__restrict, size_t, mbstate_t
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _WCHAR_H #ifndef _WCHAR_H
#define _WCHAR_H #define _WCHAR_H
#ifdef __ICCARM__ /* for iar */
#include_next <wchar.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -208,5 +204,4 @@ wctype_t wctype(const char *); ...@@ -208,5 +204,4 @@ wctype_t wctype(const char *);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
#ifndef _WCTYPE_H #ifndef _WCTYPE_H
#define _WCTYPE_H #define _WCTYPE_H
#ifdef __ICCARM__ /* for iar */
#include_next <wctype.h>
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -80,5 +76,4 @@ wctype_t wctype_l(const char *, locale_t); ...@@ -80,5 +76,4 @@ wctype_t wctype_l(const char *, locale_t);
} }
#endif #endif
#endif /* __ICCARM__ */
#endif #endif
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_m/liteos.gni")
import("iccarm.gni")
libc = "iccarm-c"
LITEOS_MENUCONFIG_H = rebase_path("$root_out_dir/config.h")
config("include") {
include_dirs = [ "include" ]
}
static_library(libc) {
sources = ICCARM_ADAPT_SRC_COMMON
cflags = [
"-imacros",
"$LITEOS_MENUCONFIG_H",
]
public_configs = [ ":include" ]
}
group("kernel") {
public_deps = [ ":$libc" ]
}
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MUSLPORTINGDIR = get_path_info(".", "abspath")
ICCARM_ADAPT_INCLUDE_DIRS = [ "$MUSLPORTINGDIR/include" ]
ICCARM_ADAPT_SRC_COMMON = [
"$MUSLPORTINGDIR/src/malloc.c",
"$MUSLPORTINGDIR/src/fs.c",
]
#ifndef _AIO_H
#define _AIO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#include <signal.h>
#include <time.h>
#define __NEED_ssize_t
#define __NEED_off_t
#include <bits/alltypes.h>
struct aiocb {
int aio_fildes, aio_lio_opcode, aio_reqprio;
volatile void *aio_buf;
size_t aio_nbytes;
struct sigevent aio_sigevent;
void *__td;
int __lock[2];
volatile int __err;
ssize_t __ret;
off_t aio_offset;
void *__next, *__prev;
char __dummy4[32-2*sizeof(void *)];
};
#define AIO_CANCELED 0
#define AIO_NOTCANCELED 1
#define AIO_ALLDONE 2
#define LIO_READ 0
#define LIO_WRITE 1
#define LIO_NOP 2
#define LIO_WAIT 0
#define LIO_NOWAIT 1
int aio_read(struct aiocb *);
int aio_write(struct aiocb *);
int aio_error(const struct aiocb *);
ssize_t aio_return(struct aiocb *);
int aio_cancel(int, struct aiocb *);
int aio_suspend(const struct aiocb *const [], int, const struct timespec *);
int aio_fsync(int, struct aiocb *);
int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define aiocb64 aiocb
#define aio_read64 aio_read
#define aio_write64 aio_write
#define aio_error64 aio_error
#define aio_return64 aio_return
#define aio_cancel64 aio_cancel
#define aio_suspend64 aio_suspend
#define aio_fsync64 aio_fsync
#define lio_listio64 lio_listio
#define off64_t off_t
#endif
#if _REDIR_TIME64
__REDIR(aio_suspend, __aio_suspend_time64);
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef _ALLOCA_H
#define _ALLOCA_H
#ifdef __cplusplus
extern "C" {
#endif
#define __NEED_size_t
#include <bits/alltypes.h>
void *alloca(size_t);
#define alloca __builtin_alloca
#ifdef __cplusplus
}
#endif
#endif
#ifndef _AR_H
#define _AR_H
#ifdef __cplusplus
extern "C" {
#endif
#define ARMAG "!<arch>\n"
#define SARMAG 8
#define ARFMAG "`\n"
struct ar_hdr {
char ar_name[16];
char ar_date[12];
char ar_uid[6], ar_gid[6];
char ar_mode[8];
char ar_size[10];
char ar_fmag[2];
};
#ifdef __cplusplus
}
#endif
#endif
#ifndef _ARPA_FTP_H
#define _ARPA_FTP_H
#define PRELIM 1
#define COMPLETE 2
#define CONTINUE 3
#define TRANSIENT 4
#define ERROR 5
#define TYPE_A 1
#define TYPE_E 2
#define TYPE_I 3
#define TYPE_L 4
#define FORM_N 1
#define FORM_T 2
#define FORM_C 3
#define STRU_F 1
#define STRU_R 2
#define STRU_P 3
#define MODE_S 1
#define MODE_B 2
#define MODE_C 3
#define REC_ESC '\377'
#define REC_EOR '\001'
#define REC_EOF '\002'
#define BLK_EOR 0x80
#define BLK_EOF 0x40
#define BLK_ERRORS 0x20
#define BLK_RESTART 0x10
#define BLK_BYTECOUNT 2
#ifdef FTP_NAMES
char *modenames[] = {"0", "Stream", "Block", "Compressed" };
char *strunames[] = {"0", "File", "Record", "Page" };
char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
#endif
#endif
#ifndef _ARPA_INET_H
#define _ARPA_INET_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#include <netinet/in.h>
uint32_t htonl(uint32_t);
uint16_t htons(uint16_t);
uint32_t ntohl(uint32_t);
uint16_t ntohs(uint16_t);
in_addr_t inet_addr (const char *);
in_addr_t inet_network (const char *);
char *inet_ntoa (struct in_addr);
int inet_pton (int, const char *__restrict, void *__restrict);
const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
int inet_aton (const char *, struct in_addr *);
struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
in_addr_t inet_lnaof(struct in_addr);
in_addr_t inet_netof(struct in_addr);
#undef INET_ADDRSTRLEN
#undef INET6_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#define INET6_ADDRSTRLEN 46
#ifdef __cplusplus
}
#endif
#endif
#ifndef _ARPA_NAMESER_H
#define _ARPA_NAMESER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
#define __NAMESER 19991006
#define NS_PACKETSZ 512
#define NS_MAXDNAME 1025
#define NS_MAXMSG 65535
#define NS_MAXCDNAME 255
#define NS_MAXLABEL 63
#define NS_HFIXEDSZ 12
#define NS_QFIXEDSZ 4
#define NS_RRFIXEDSZ 10
#define NS_INT32SZ 4
#define NS_INT16SZ 2
#define NS_INT8SZ 1
#define NS_INADDRSZ 4
#define NS_IN6ADDRSZ 16
#define NS_CMPRSFLGS 0xc0
#define NS_DEFAULTPORT 53
typedef enum __ns_sect {
ns_s_qd = 0,
ns_s_zn = 0,
ns_s_an = 1,
ns_s_pr = 1,
ns_s_ns = 2,
ns_s_ud = 2,
ns_s_ar = 3,
ns_s_max = 4
} ns_sect;
typedef struct __ns_msg {
const unsigned char *_msg, *_eom;
uint16_t _id, _flags, _counts[ns_s_max];
const unsigned char *_sections[ns_s_max];
ns_sect _sect;
int _rrnum;
const unsigned char *_msg_ptr;
} ns_msg;
struct _ns_flagdata { int mask, shift; };
extern const struct _ns_flagdata _ns_flagdata[];
#define ns_msg_id(handle) ((handle)._id + 0)
#define ns_msg_base(handle) ((handle)._msg + 0)
#define ns_msg_end(handle) ((handle)._eom + 0)
#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
#define ns_msg_getflag(handle, flag) \
(((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
typedef struct __ns_rr {
char name[NS_MAXDNAME];
uint16_t type;
uint16_t rr_class;
uint32_t ttl;
uint16_t rdlength;
const unsigned char *rdata;
} ns_rr;
#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
#define ns_rr_ttl(rr) ((rr).ttl + 0)
#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
#define ns_rr_rdata(rr) ((rr).rdata + 0)
typedef enum __ns_flag {
ns_f_qr,
ns_f_opcode,
ns_f_aa,
ns_f_tc,
ns_f_rd,
ns_f_ra,
ns_f_z,
ns_f_ad,
ns_f_cd,
ns_f_rcode,
ns_f_max
} ns_flag;
typedef enum __ns_opcode {
ns_o_query = 0,
ns_o_iquery = 1,
ns_o_status = 2,
ns_o_notify = 4,
ns_o_update = 5,
ns_o_max = 6
} ns_opcode;
typedef enum __ns_rcode {
ns_r_noerror = 0,
ns_r_formerr = 1,
ns_r_servfail = 2,
ns_r_nxdomain = 3,
ns_r_notimpl = 4,
ns_r_refused = 5,
ns_r_yxdomain = 6,
ns_r_yxrrset = 7,
ns_r_nxrrset = 8,
ns_r_notauth = 9,
ns_r_notzone = 10,
ns_r_max = 11,
ns_r_badvers = 16,
ns_r_badsig = 16,
ns_r_badkey = 17,
ns_r_badtime = 18
} ns_rcode;
typedef enum __ns_update_operation {
ns_uop_delete = 0,
ns_uop_add = 1,
ns_uop_max = 2
} ns_update_operation;
struct ns_tsig_key {
char name[NS_MAXDNAME], alg[NS_MAXDNAME];
unsigned char *data;
int len;
};
typedef struct ns_tsig_key ns_tsig_key;
struct ns_tcp_tsig_state {
int counter;
struct dst_key *key;
void *ctx;
unsigned char sig[NS_PACKETSZ];
int siglen;
};
typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
#define NS_TSIG_FUDGE 300
#define NS_TSIG_TCP_COUNT 100
#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
#define NS_TSIG_ERROR_NO_TSIG -10
#define NS_TSIG_ERROR_NO_SPACE -11
#define NS_TSIG_ERROR_FORMERR -12
typedef enum __ns_type {
ns_t_invalid = 0,
ns_t_a = 1,
ns_t_ns = 2,
ns_t_md = 3,
ns_t_mf = 4,
ns_t_cname = 5,
ns_t_soa = 6,
ns_t_mb = 7,
ns_t_mg = 8,
ns_t_mr = 9,
ns_t_null = 10,
ns_t_wks = 11,
ns_t_ptr = 12,
ns_t_hinfo = 13,
ns_t_minfo = 14,
ns_t_mx = 15,
ns_t_txt = 16,
ns_t_rp = 17,
ns_t_afsdb = 18,
ns_t_x25 = 19,
ns_t_isdn = 20,
ns_t_rt = 21,
ns_t_nsap = 22,
ns_t_nsap_ptr = 23,
ns_t_sig = 24,
ns_t_key = 25,
ns_t_px = 26,
ns_t_gpos = 27,
ns_t_aaaa = 28,
ns_t_loc = 29,
ns_t_nxt = 30,
ns_t_eid = 31,
ns_t_nimloc = 32,
ns_t_srv = 33,
ns_t_atma = 34,
ns_t_naptr = 35,
ns_t_kx = 36,
ns_t_cert = 37,
ns_t_a6 = 38,
ns_t_dname = 39,
ns_t_sink = 40,
ns_t_opt = 41,
ns_t_apl = 42,
ns_t_tkey = 249,
ns_t_tsig = 250,
ns_t_ixfr = 251,
ns_t_axfr = 252,
ns_t_mailb = 253,
ns_t_maila = 254,
ns_t_any = 255,
ns_t_zxfr = 256,
ns_t_max = 65536
} ns_type;
#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
(t) == ns_t_mailb || (t) == ns_t_maila)
#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
(t) == ns_t_zxfr)
typedef enum __ns_class {
ns_c_invalid = 0,
ns_c_in = 1,
ns_c_2 = 2,
ns_c_chaos = 3,
ns_c_hs = 4,
ns_c_none = 254,
ns_c_any = 255,
ns_c_max = 65536
} ns_class;
typedef enum __ns_key_types {
ns_kt_rsa = 1,
ns_kt_dh = 2,
ns_kt_dsa = 3,
ns_kt_private = 254
} ns_key_types;
typedef enum __ns_cert_types {
cert_t_pkix = 1,
cert_t_spki = 2,
cert_t_pgp = 3,
cert_t_url = 253,
cert_t_oid = 254
} ns_cert_types;
#define NS_KEY_TYPEMASK 0xC000
#define NS_KEY_TYPE_AUTH_CONF 0x0000
#define NS_KEY_TYPE_CONF_ONLY 0x8000
#define NS_KEY_TYPE_AUTH_ONLY 0x4000
#define NS_KEY_TYPE_NO_KEY 0xC000
#define NS_KEY_NO_AUTH 0x8000
#define NS_KEY_NO_CONF 0x4000
#define NS_KEY_RESERVED2 0x2000
#define NS_KEY_EXTENDED_FLAGS 0x1000
#define NS_KEY_RESERVED4 0x0800
#define NS_KEY_RESERVED5 0x0400
#define NS_KEY_NAME_TYPE 0x0300
#define NS_KEY_NAME_USER 0x0000
#define NS_KEY_NAME_ENTITY 0x0200
#define NS_KEY_NAME_ZONE 0x0100
#define NS_KEY_NAME_RESERVED 0x0300
#define NS_KEY_RESERVED8 0x0080
#define NS_KEY_RESERVED9 0x0040
#define NS_KEY_RESERVED10 0x0020
#define NS_KEY_RESERVED11 0x0010
#define NS_KEY_SIGNATORYMASK 0x000F
#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
NS_KEY_RESERVED4 | \
NS_KEY_RESERVED5 | \
NS_KEY_RESERVED8 | \
NS_KEY_RESERVED9 | \
NS_KEY_RESERVED10 | \
NS_KEY_RESERVED11 )
#define NS_KEY_RESERVED_BITMASK2 0xFFFF
#define NS_ALG_MD5RSA 1
#define NS_ALG_DH 2
#define NS_ALG_DSA 3
#define NS_ALG_DSS NS_ALG_DSA
#define NS_ALG_EXPIRE_ONLY 253
#define NS_ALG_PRIVATE_OID 254
#define NS_KEY_PROT_TLS 1
#define NS_KEY_PROT_EMAIL 2
#define NS_KEY_PROT_DNSSEC 3
#define NS_KEY_PROT_IPSEC 4
#define NS_KEY_PROT_ANY 255
#define NS_MD5RSA_MIN_BITS 512
#define NS_MD5RSA_MAX_BITS 4096
#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
#define NS_DSA_SIG_SIZE 41
#define NS_DSA_MIN_SIZE 213
#define NS_DSA_MAX_BYTES 405
#define NS_SIG_TYPE 0
#define NS_SIG_ALG 2
#define NS_SIG_LABELS 3
#define NS_SIG_OTTL 4
#define NS_SIG_EXPIR 8
#define NS_SIG_SIGNED 12
#define NS_SIG_FOOT 16
#define NS_SIG_SIGNER 18
#define NS_NXT_BITS 8
#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
#define NS_NXT_MAX 127
#define NS_OPT_DNSSEC_OK 0x8000U
#define NS_OPT_NSID 3
#define NS_GET16(s, cp) (void)((s) = ns_get16(((cp)+=2)-2))
#define NS_GET32(l, cp) (void)((l) = ns_get32(((cp)+=4)-4))
#define NS_PUT16(s, cp) ns_put16((s), ((cp)+=2)-2)
#define NS_PUT32(l, cp) ns_put32((l), ((cp)+=4)-4)
unsigned ns_get16(const unsigned char *);
unsigned long ns_get32(const unsigned char *);
void ns_put16(unsigned, unsigned char *);
void ns_put32(unsigned long, unsigned char *);
int ns_initparse(const unsigned char *, int, ns_msg *);
int ns_parserr(ns_msg *, ns_sect, int, ns_rr *);
int ns_skiprr(const unsigned char *, const unsigned char *, ns_sect, int);
int ns_name_uncompress(const unsigned char *, const unsigned char *, const unsigned char *, char *, size_t);
#define __BIND 19950621
typedef struct {
unsigned id :16;
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned qr: 1;
unsigned opcode: 4;
unsigned aa: 1;
unsigned tc: 1;
unsigned rd: 1;
unsigned ra: 1;
unsigned unused :1;
unsigned ad: 1;
unsigned cd: 1;
unsigned rcode :4;
#else
unsigned rd :1;
unsigned tc :1;
unsigned aa :1;
unsigned opcode :4;
unsigned qr :1;
unsigned rcode :4;
unsigned cd: 1;
unsigned ad: 1;
unsigned unused :1;
unsigned ra :1;
#endif
unsigned qdcount :16;
unsigned ancount :16;
unsigned nscount :16;
unsigned arcount :16;
} HEADER;
#define PACKETSZ NS_PACKETSZ
#define MAXDNAME NS_MAXDNAME
#define MAXCDNAME NS_MAXCDNAME
#define MAXLABEL NS_MAXLABEL
#define HFIXEDSZ NS_HFIXEDSZ
#define QFIXEDSZ NS_QFIXEDSZ
#define RRFIXEDSZ NS_RRFIXEDSZ
#define INT32SZ NS_INT32SZ
#define INT16SZ NS_INT16SZ
#define INT8SZ NS_INT8SZ
#define INADDRSZ NS_INADDRSZ
#define IN6ADDRSZ NS_IN6ADDRSZ
#define INDIR_MASK NS_CMPRSFLGS
#define NAMESERVER_PORT NS_DEFAULTPORT
#define S_ZONE ns_s_zn
#define S_PREREQ ns_s_pr
#define S_UPDATE ns_s_ud
#define S_ADDT ns_s_ar
#define QUERY ns_o_query
#define IQUERY ns_o_iquery
#define STATUS ns_o_status
#define NS_NOTIFY_OP ns_o_notify
#define NS_UPDATE_OP ns_o_update
#define NOERROR ns_r_noerror
#define FORMERR ns_r_formerr
#define SERVFAIL ns_r_servfail
#define NXDOMAIN ns_r_nxdomain
#define NOTIMP ns_r_notimpl
#define REFUSED ns_r_refused
#define YXDOMAIN ns_r_yxdomain
#define YXRRSET ns_r_yxrrset
#define NXRRSET ns_r_nxrrset
#define NOTAUTH ns_r_notauth
#define NOTZONE ns_r_notzone
#define DELETE ns_uop_delete
#define ADD ns_uop_add
#define T_A ns_t_a
#define T_NS ns_t_ns
#define T_MD ns_t_md
#define T_MF ns_t_mf
#define T_CNAME ns_t_cname
#define T_SOA ns_t_soa
#define T_MB ns_t_mb
#define T_MG ns_t_mg
#define T_MR ns_t_mr
#define T_NULL ns_t_null
#define T_WKS ns_t_wks
#define T_PTR ns_t_ptr
#define T_HINFO ns_t_hinfo
#define T_MINFO ns_t_minfo
#define T_MX ns_t_mx
#define T_TXT ns_t_txt
#define T_RP ns_t_rp
#define T_AFSDB ns_t_afsdb
#define T_X25 ns_t_x25
#define T_ISDN ns_t_isdn
#define T_RT ns_t_rt
#define T_NSAP ns_t_nsap
#define T_NSAP_PTR ns_t_nsap_ptr
#define T_SIG ns_t_sig
#define T_KEY ns_t_key
#define T_PX ns_t_px
#define T_GPOS ns_t_gpos
#define T_AAAA ns_t_aaaa
#define T_LOC ns_t_loc
#define T_NXT ns_t_nxt
#define T_EID ns_t_eid
#define T_NIMLOC ns_t_nimloc
#define T_SRV ns_t_srv
#define T_ATMA ns_t_atma
#define T_NAPTR ns_t_naptr
#define T_A6 ns_t_a6
#define T_DNAME ns_t_dname
#define T_TSIG ns_t_tsig
#define T_IXFR ns_t_ixfr
#define T_AXFR ns_t_axfr
#define T_MAILB ns_t_mailb
#define T_MAILA ns_t_maila
#define T_ANY ns_t_any
#define C_IN ns_c_in
#define C_CHAOS ns_c_chaos
#define C_HS ns_c_hs
#define C_NONE ns_c_none
#define C_ANY ns_c_any
#define GETSHORT NS_GET16
#define GETLONG NS_GET32
#define PUTSHORT NS_PUT16
#define PUTLONG NS_PUT32
#ifdef __cplusplus
}
#endif
#endif
#ifndef _ARPA_TELNET_H
#define _ARPA_TELNET_H
#define IAC 255
#define DONT 254
#define DO 253
#define WONT 252
#define WILL 251
#define SB 250
#define GA 249
#define EL 248
#define EC 247
#define AYT 246
#define AO 245
#define IP 244
#define BREAK 243
#define DM 242
#define NOP 241
#define SE 240
#define EOR 239
#define ABORT 238
#define SUSP 237
#define xEOF 236
#define SYNCH 242
#define telcmds ((char [][6]){ "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0 })
#define TELCMD_FIRST xEOF
#define TELCMD_LAST IAC
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
(unsigned int)(x) >= TELCMD_FIRST)
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
#define TELOPT_BINARY 0
#define TELOPT_ECHO 1
#define TELOPT_RCP 2
#define TELOPT_SGA 3
#define TELOPT_NAMS 4
#define TELOPT_STATUS 5
#define TELOPT_TM 6
#define TELOPT_RCTE 7
#define TELOPT_NAOL 8
#define TELOPT_NAOP 9
#define TELOPT_NAOCRD 10
#define TELOPT_NAOHTS 11
#define TELOPT_NAOHTD 12
#define TELOPT_NAOFFD 13
#define TELOPT_NAOVTS 14
#define TELOPT_NAOVTD 15
#define TELOPT_NAOLFD 16
#define TELOPT_XASCII 17
#define TELOPT_LOGOUT 18
#define TELOPT_BM 19
#define TELOPT_DET 20
#define TELOPT_SUPDUP 21
#define TELOPT_SUPDUPOUTPUT 22
#define TELOPT_SNDLOC 23
#define TELOPT_TTYPE 24
#define TELOPT_EOR 25
#define TELOPT_TUID 26
#define TELOPT_OUTMRK 27
#define TELOPT_TTYLOC 28
#define TELOPT_3270REGIME 29
#define TELOPT_X3PAD 30
#define TELOPT_NAWS 31
#define TELOPT_TSPEED 32
#define TELOPT_LFLOW 33
#define TELOPT_LINEMODE 34
#define TELOPT_XDISPLOC 35
#define TELOPT_OLD_ENVIRON 36
#define TELOPT_AUTHENTICATION 37/* Authenticate */
#define TELOPT_ENCRYPT 38
#define TELOPT_NEW_ENVIRON 39
#define TELOPT_EXOPL 255
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
#ifdef TELOPTS
char *telopts[NTELOPTS+1] = {
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
"ENCRYPT", "NEW-ENVIRON",
0,
};
#define TELOPT_FIRST TELOPT_BINARY
#define TELOPT_LAST TELOPT_NEW_ENVIRON
#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
#endif
#define TELQUAL_IS 0
#define TELQUAL_SEND 1
#define TELQUAL_INFO 2
#define TELQUAL_REPLY 2
#define TELQUAL_NAME 3
#define LFLOW_OFF 0
#define LFLOW_ON 1
#define LFLOW_RESTART_ANY 2
#define LFLOW_RESTART_XON 3
#define LM_MODE 1
#define LM_FORWARDMASK 2
#define LM_SLC 3
#define MODE_EDIT 0x01
#define MODE_TRAPSIG 0x02
#define MODE_ACK 0x04
#define MODE_SOFT_TAB 0x08
#define MODE_LIT_ECHO 0x10
#define MODE_MASK 0x1f
#define MODE_FLOW 0x0100
#define MODE_ECHO 0x0200
#define MODE_INBIN 0x0400
#define MODE_OUTBIN 0x0800
#define MODE_FORCE 0x1000
#define SLC_SYNCH 1
#define SLC_BRK 2
#define SLC_IP 3
#define SLC_AO 4
#define SLC_AYT 5
#define SLC_EOR 6
#define SLC_ABORT 7
#define SLC_EOF 8
#define SLC_SUSP 9
#define SLC_EC 10
#define SLC_EL 11
#define SLC_EW 12
#define SLC_RP 13
#define SLC_LNEXT 14
#define SLC_XON 15
#define SLC_XOFF 16
#define SLC_FORW1 17
#define SLC_FORW2 18
#define NSLC 18
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
"LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
#ifdef SLC_NAMES
char *slc_names[] = {
SLC_NAMELIST
};
#else
extern char *slc_names[];
#define SLC_NAMES SLC_NAMELIST
#endif
#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
#define SLC_NAME(x) slc_names[x]
#define SLC_NOSUPPORT 0
#define SLC_CANTCHANGE 1
#define SLC_VARIABLE 2
#define SLC_DEFAULT 3
#define SLC_LEVELBITS 0x03
#define SLC_FUNC 0
#define SLC_FLAGS 1
#define SLC_VALUE 2
#define SLC_ACK 0x80
#define SLC_FLUSHIN 0x40
#define SLC_FLUSHOUT 0x20
#define OLD_ENV_VAR 1
#define OLD_ENV_VALUE 0
#define NEW_ENV_VAR 0
#define NEW_ENV_VALUE 1
#define ENV_ESC 2
#define ENV_USERVAR 3
#define AUTH_WHO_CLIENT 0
#define AUTH_WHO_SERVER 1
#define AUTH_WHO_MASK 1
#define AUTH_HOW_ONE_WAY 0
#define AUTH_HOW_MUTUAL 2
#define AUTH_HOW_MASK 2
#define AUTHTYPE_NULL 0
#define AUTHTYPE_KERBEROS_V4 1
#define AUTHTYPE_KERBEROS_V5 2
#define AUTHTYPE_SPX 3
#define AUTHTYPE_MINK 4
#define AUTHTYPE_CNT 5
#define AUTHTYPE_TEST 99
#ifdef AUTH_NAMES
char *authtype_names[] = {
"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
};
#else
extern char *authtype_names[];
#endif
#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
#define AUTHTYPE_NAME(x) authtype_names[x]
#define ENCRYPT_IS 0
#define ENCRYPT_SUPPORT 1
#define ENCRYPT_REPLY 2
#define ENCRYPT_START 3
#define ENCRYPT_END 4
#define ENCRYPT_REQSTART 5
#define ENCRYPT_REQEND 6
#define ENCRYPT_ENC_KEYID 7
#define ENCRYPT_DEC_KEYID 8
#define ENCRYPT_CNT 9
#define ENCTYPE_ANY 0
#define ENCTYPE_DES_CFB64 1
#define ENCTYPE_DES_OFB64 2
#define ENCTYPE_CNT 3
#ifdef ENCRYPT_NAMES
char *encrypt_names[] = {
"IS", "SUPPORT", "REPLY", "START", "END",
"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
0,
};
char *enctype_names[] = {
"ANY", "DES_CFB64", "DES_OFB64", 0,
};
#else
extern char *encrypt_names[];
extern char *enctype_names[];
#endif
#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
#define ENCRYPT_NAME(x) encrypt_names[x]
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
#define ENCTYPE_NAME(x) enctype_names[x]
#endif
#ifndef _ARPA_TFTP_H
#define _ARPA_TFTP_H
#define SEGSIZE 512
#define RRQ 01
#define WRQ 02
#define DATA 03
#define ACK 04
#define ERROR 05
struct tftphdr {
short th_opcode;
union {
unsigned short tu_block;
short tu_code;
char tu_stuff[1];
} th_u;
char th_data[1];
};
#define th_block th_u.tu_block
#define th_code th_u.tu_code
#define th_stuff th_u.tu_stuff
#define th_msg th_data
#define EUNDEF 0
#define ENOTFOUND 1
#define EACCESS 2
#define ENOSPACE 3
#define EBADOP 4
#define EBADID 5
#define EEXISTS 6
#define ENOUSER 7
#endif
/* The time64 has not been used yet in liteos_m */
#define _REDIR_TIME64 0
#define _Addr int
#define _Int64 long long
#define _Reg int
#ifdef __ARMEB__
#define __BYTE_ORDER 4321
#else
#define __BYTE_ORDER 1234
#endif
#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
#include <stddef.h>
#define __DEFINED_wchar_t
#endif
#endif
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
#include <math.h>
#define __DEFINED_float_t
#endif
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
#include <math.h>
#define __DEFINED_double_t
#endif
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
#include <stddef.h>
#define __DEFINED_max_align_t
#endif
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
#include <stddef.h>
#define __DEFINED_size_t
#endif
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
#include <stdint.h>
#define __DEFINED_uintptr_t
#endif
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
#include <stddef.h>
#define __DEFINED_ptrdiff_t
#endif
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
#include <stdint.h>
#define __DEFINED_intptr_t
#endif
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
#include <time.h>
#define __DEFINED_time_t
#endif
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
#include <time.h>
#define __DEFINED_clock_t
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
#include <time.h>
#define __DEFINED_struct_timespec
#endif
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
#include <wchar.h>
#define __DEFINED_wint_t
#endif
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
#include <wchar.h>
#define __DEFINED_wctype_t
#endif
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
#include <stdarg.h>
#define __DEFINED_va_list
#endif
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
#include <wchar.h>
#define __DEFINED_mbstate_t
#endif
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) && defined(__INT8_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int8_t
#endif
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) && defined(__INT16_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int16_t
#endif
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) && defined(__INT32_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int32_t
#endif
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) && defined(__INT64_T_TYPE__)
#include <stdint.h>
#define __DEFINED_int64_t
#endif
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) && defined(__UINT8_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint8_t
#endif
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) && defined(__UINT16_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint16_t
#endif
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) && defined(__UINT32_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint32_t
#endif
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) && defined(__UINT64_T_TYPE__)
#include <stdint.h>
#define __DEFINED_uint64_t
#endif
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
#include <stdint.h>
#define __DEFINED_intmax_t
#endif
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
#include <stdint.h>
#define __DEFINED_uintmax_t
#endif
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef _Int64 suseconds_t;
#define __DEFINED_suseconds_t
#endif
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
#else
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
#endif
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned type; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { int clock; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE)
struct _IO_FILE {
unsigned flags;
unsigned char *rpos, *rend;
int (*close)(struct _IO_FILE *);
unsigned char *wend, *wpos;
unsigned char *mustbezero_1;
unsigned char *wbase;
size_t (*read)(struct _IO_FILE *, unsigned char *, size_t);
size_t (*write)(struct _IO_FILE *, const unsigned char *, size_t);
off_t (*seek)(struct _IO_FILE *, off_t, int);
unsigned char *buf;
size_t buf_size;
struct _IO_FILE *prev, *next;
int fd;
int pipe_pid;
int mode;
void *lock;
int lbf;
void *cookie;
off_t off;
char *getln_buf;
void *mustbezero_2;
unsigned char *shend;
off_t shlim, shcnt;
struct __locale_struct *locale;
};
#define __DEFINED_struct__IO_FILE
#endif
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef unsigned long sigset_t;
#define __DEFINED_sigset_t
#endif
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
#if (defined(__NEED_sched_param) || defined(__NEED_pthread_attr_t)) && !defined(__DEFINED_sched_param)
struct sched_param {
int sched_priority;
int __reserved1;
#if _REDIR_TIME64
long __reserved2[4];
#else
struct {
time_t __reserved1;
long __reserved2;
} __reserved2[2];
#endif
int __reserved3;
};
#define __DEFINED_sched_param
#endif
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct {
unsigned int detachstate;
unsigned int schedpolicy;
struct sched_param schedparam;
unsigned int inheritsched;
unsigned int scope;
unsigned int stackaddr_set;
void *stackaddr;
unsigned int stacksize_set;
size_t stacksize;
} pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { unsigned int magic; unsigned int handle; pthread_mutexattr_t stAttr;} pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
#include "los_event.h"
typedef struct pthread_cond {
volatile int count; /**< The number of tasks blocked by condition */
EVENT_CB_S event; /**< Event object*/
pthread_mutex_t* mutex; /**< Mutex locker for condition variable protection */
volatile int value; /**< Condition variable state value*/
int clock;
} pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
#undef _Addr
#undef _Int64
#undef _Reg
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
#define _DIRENT_HAVE_D_TYPE
struct dirent {
ino_t d_ino;
off_t d_off;
unsigned short d_reclen;
unsigned char d_type;
char d_name[256];
};
#define ENOERR 0
#define EPERM 1
#define ENOENT 2
#define ESRCH 3
#define EINTR 4
#define EIO 5
#define ENXIO 6
#define E2BIG 7
#define ENOEXEC 8
#define EBADF 9
#define ECHILD 10
#define EAGAIN 11
#define ENOMEM 12
#define EACCES 13
#define EFAULT 14
#define ENOTBLK 15
#define EBUSY 16
#define EEXIST 17
#define EXDEV 18
#define ENODEV 19
#define ENOTDIR 20
#define EISDIR 21
#define EINVAL 22
#define ENFILE 23
#define EMFILE 24
#define ENOTTY 25
#define ETXTBSY 26
#define EFBIG 27
#define ENOSPC 28
#define ESPIPE 29
#define EROFS 30
#define EMLINK 31
#define EPIPE 32
#define EDOM 33
#define ERANGE 34
#define EDEADLK 35
#define ENAMETOOLONG 36
#define ENOLCK 37
#define ENOSYS 38
#define ENOTEMPTY 39
#define ELOOP 40
#define EWOULDBLOCK EAGAIN
#define ENOMSG 42
#define EIDRM 43
#define ECHRNG 44
#define EL2NSYNC 45
#define EL3HLT 46
#define EL3RST 47
#define ELNRNG 48
#define EUNATCH 49
#define ENOCSI 50
#define EL2HLT 51
#define EBADE 52
#define EBADR 53
#define EXFULL 54
#define ENOANO 55
#define EBADRQC 56
#define EBADSLT 57
#define EDEADLOCK EDEADLK
#define EBFONT 59
#define ENOSTR 60
#define ENODATA 61
#define ETIME 62
#define ENOSR 63
#define ENONET 64
#define ENOPKG 65
#define EREMOTE 66
#define ENOLINK 67
#define EADV 68
#define ESRMNT 69
#define ECOMM 70
#define EPROTO 71
#define EMULTIHOP 72
#define EDOTDOT 73
#define EBADMSG 74
#define EOVERFLOW 75
#define ENOTUNIQ 76
#define EBADFD 77
#define EREMCHG 78
#define ELIBACC 79
#define ELIBBAD 80
#define ELIBSCN 81
#define ELIBMAX 82
#define ELIBEXEC 83
#define EILSEQ 84
#define ERESTART 85
#define ESTRPIPE 86
#define EUSERS 87
#define ENOTSOCK 88
#define EDESTADDRREQ 89
#define EMSGSIZE 90
#define EPROTOTYPE 91
#define ENOPROTOOPT 92
#define EPROTONOSUPPORT 93
#define ESOCKTNOSUPPORT 94
#define EOPNOTSUPP 95
#define ENOTSUP EOPNOTSUPP
#define EPFNOSUPPORT 96
#define EAFNOSUPPORT 97
#define EADDRINUSE 98
#define EADDRNOTAVAIL 99
#define ENETDOWN 100
#define ENETUNREACH 101
#define ENETRESET 102
#define ECONNABORTED 103
#define ECONNRESET 104
#define ENOBUFS 105
#define EISCONN 106
#define ENOTCONN 107
#define ESHUTDOWN 108
#define ETOOMANYREFS 109
#define ETIMEDOUT 110
#define ECONNREFUSED 111
#define EHOSTDOWN 112
#define EHOSTUNREACH 113
#define EALREADY 114
#define EINPROGRESS 115
#define ESTALE 116
#define EUCLEAN 117
#define ENOTNAM 118
#define ENAVAIL 119
#define EISNAM 120
#define EREMOTEIO 121
#define EDQUOT 122
#define ENOMEDIUM 123
#define EMEDIUMTYPE 124
#define ECANCELED 125
#define ENOKEY 126
#define EKEYEXPIRED 127
#define EKEYREVOKED 128
#define EKEYREJECTED 129
#define EOWNERDEAD 130
#define ENOTRECOVERABLE 131
#define ERFKILL 132
#define EHWPOISON 133
#define O_CREAT 0100
#define O_EXCL 0200
#define O_NOCTTY 0400
#define O_TRUNC 01000
#define O_APPEND 02000
#define O_NONBLOCK 04000
#define O_DSYNC 010000
#define O_SYNC 04010000
#define O_RSYNC 04010000
#define O_DIRECTORY 040000
#define O_NOFOLLOW 0100000
#define O_CLOEXEC 02000000
#define O_ASYNC 020000
#define O_DIRECT 0200000
#define O_LARGEFILE 0400000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020040000
#define O_NDELAY O_NONBLOCK
#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
#define F_GETFL 3
#define F_SETFL 4
#define F_SETOWN 8
#define F_GETOWN 9
#define F_SETSIG 10
#define F_GETSIG 11
#define F_GETLK 12
#define F_SETLK 13
#define F_SETLKW 14
#define F_SETOWN_EX 15
#define F_GETOWN_EX 16
#define F_GETOWNER_UIDS 17
#ifndef __ARM_PCS_VFP
#define FE_ALL_EXCEPT 0
#define FE_TONEAREST 0
#else
#define FE_INVALID 1
#define FE_DIVBYZERO 2
#define FE_OVERFLOW 4
#define FE_UNDERFLOW 8
#define FE_INEXACT 16
#define FE_ALL_EXCEPT 31
#define FE_TONEAREST 0
#define FE_DOWNWARD 0x800000
#define FE_UPWARD 0x400000
#define FE_TOWARDZERO 0xc00000
#endif
typedef unsigned long fexcept_t;
typedef struct {
unsigned long __cw;
} fenv_t;
#define FE_DFL_ENV ((const fenv_t *) -1)
#define FLT_EVAL_METHOD 0
#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
#define LDBL_MIN 2.22507385850720138309e-308L
#define LDBL_MAX 1.79769313486231570815e+308L
#define LDBL_EPSILON 2.22044604925031308085e-16L
#define LDBL_MANT_DIG 53
#define LDBL_MIN_EXP (-1021)
#define LDBL_MAX_EXP 1024
#define LDBL_DIG 15
#define LDBL_MIN_10_EXP (-307)
#define LDBL_MAX_10_EXP 308
#define DECIMAL_DIG 17
#define HWCAP_SWP (1 << 0)
#define HWCAP_HALF (1 << 1)
#define HWCAP_THUMB (1 << 2)
#define HWCAP_26BIT (1 << 3)
#define HWCAP_FAST_MULT (1 << 4)
#define HWCAP_FPA (1 << 5)
#define HWCAP_VFP (1 << 6)
#define HWCAP_EDSP (1 << 7)
#define HWCAP_JAVA (1 << 8)
#define HWCAP_IWMMXT (1 << 9)
#define HWCAP_CRUNCH (1 << 10)
#define HWCAP_THUMBEE (1 << 11)
#define HWCAP_NEON (1 << 12)
#define HWCAP_VFPv3 (1 << 13)
#define HWCAP_VFPv3D16 (1 << 14)
#define HWCAP_TLS (1 << 15)
#define HWCAP_VFPv4 (1 << 16)
#define HWCAP_IDIVA (1 << 17)
#define HWCAP_IDIVT (1 << 18)
#define HWCAP_VFPD32 (1 << 19)
#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
#define HWCAP_LPAE (1 << 20)
#define HWCAP_EVTSTRM (1 << 21)
#define HWCAP2_AES (1 << 0)
#define HWCAP2_PMULL (1 << 1)
#define HWCAP2_SHA1 (1 << 2)
#define HWCAP2_SHA2 (1 << 3)
#define HWCAP2_CRC32 (1 << 4)
#define HWCAP_ARM_SWP (1 << 0)
#define HWCAP_ARM_HALF (1 << 1)
#define HWCAP_ARM_THUMB (1 << 2)
#define HWCAP_ARM_26BIT (1 << 3)
#define HWCAP_ARM_FAST_MULT (1 << 4)
#define HWCAP_ARM_FPA (1 << 5)
#define HWCAP_ARM_VFP (1 << 6)
#define HWCAP_ARM_EDSP (1 << 7)
#define HWCAP_ARM_JAVA (1 << 8)
#define HWCAP_ARM_IWMMXT (1 << 9)
#define HWCAP_ARM_CRUNCH (1 << 10)
#define HWCAP_ARM_THUMBEE (1 << 11)
#define HWCAP_ARM_NEON (1 << 12)
#define HWCAP_ARM_VFPv3 (1 << 13)
#define HWCAP_ARM_VFPv3D16 (1 << 14)
#define HWCAP_ARM_TLS (1 << 15)
#define HWCAP_ARM_VFPv4 (1 << 16)
#define HWCAP_ARM_IDIVA (1 << 17)
#define HWCAP_ARM_IDIVT (1 << 18)
#define HWCAP_ARM_VFPD32 (1 << 19)
#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
#define HWCAP_ARM_LPAE (1 << 20)
#define HWCAP_ARM_EVTSTRM (1 << 21)
#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
#define _IOC_NONE 0U
#define _IOC_WRITE 1U
#define _IOC_READ 2U
#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
#define TCGETS 0x5401
#define TCSETS 0x5402
#define TCSETSW 0x5403
#define TCSETSF 0x5404
#define TCGETA 0x5405
#define TCSETA 0x5406
#define TCSETAW 0x5407
#define TCSETAF 0x5408
#define TCSBRK 0x5409
#define TCXONC 0x540A
#define TCFLSH 0x540B
#define TIOCEXCL 0x540C
#define TIOCNXCL 0x540D
#define TIOCSCTTY 0x540E
#define TIOCGPGRP 0x540F
#define TIOCSPGRP 0x5410
#define TIOCOUTQ 0x5411
#define TIOCSTI 0x5412
#define TIOCGWINSZ 0x5413
#define TIOCSWINSZ 0x5414
#define TIOCMGET 0x5415
#define TIOCMBIS 0x5416
#define TIOCMBIC 0x5417
#define TIOCMSET 0x5418
#define TIOCGSOFTCAR 0x5419
#define TIOCSSOFTCAR 0x541A
#define FIONREAD 0x541B
#define TIOCINQ FIONREAD
#define TIOCLINUX 0x541C
#define TIOCCONS 0x541D
#define TIOCGSERIAL 0x541E
#define TIOCSSERIAL 0x541F
#define TIOCPKT 0x5420
#define FIONBIO 0x5421
#define TIOCNOTTY 0x5422
#define TIOCSETD 0x5423
#define TIOCGETD 0x5424
#define TCSBRKP 0x5425
#define TIOCSBRK 0x5427
#define TIOCCBRK 0x5428
#define TIOCGSID 0x5429
#define TIOCGRS485 0x542E
#define TIOCSRS485 0x542F
#define TIOCGPTN 0x80045430
#define TIOCSPTLCK 0x40045431
#define TIOCGDEV 0x80045432
#define TCGETX 0x5432
#define TCSETX 0x5433
#define TCSETXF 0x5434
#define TCSETXW 0x5435
#define TIOCSIG 0x40045436
#define TIOCVHANGUP 0x5437
#define TIOCGPKT 0x80045438
#define TIOCGPTLCK 0x80045439
#define TIOCGEXCL 0x80045440
#define TIOCGPTPEER 0x5441
#define TIOCGISO7816 0x80285442
#define TIOCSISO7816 0xc0285443
#define FIONCLEX 0x5450
#define FIOCLEX 0x5451
#define FIOASYNC 0x5452
#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
#define TIOCSERSWILD 0x5455
#define TIOCGLCKTRMIOS 0x5456
#define TIOCSLCKTRMIOS 0x5457
#define TIOCSERGSTRUCT 0x5458
#define TIOCSERGETLSR 0x5459
#define TIOCSERGETMULTI 0x545A
#define TIOCSERSETMULTI 0x545B
#define TIOCMIWAIT 0x545C
#define TIOCGICOUNT 0x545D
#define FIOQSIZE 0x5460
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
#define TIOCM_RTS 0x004
#define TIOCM_ST 0x008
#define TIOCM_SR 0x010
#define TIOCM_CTS 0x020
#define TIOCM_CAR 0x040
#define TIOCM_RNG 0x080
#define TIOCM_DSR 0x100
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RI TIOCM_RNG
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
#define TIOCM_LOOP 0x8000
#define FIOSETOWN 0x8901
#define SIOCSPGRP 0x8902
#define FIOGETOWN 0x8903
#define SIOCGPGRP 0x8904
#define SIOCATMARK 0x8905
#if __LONG_MAX == 0x7fffffff
#define SIOCGSTAMP _IOR(0x89, 6, char[16])
#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
#else
#define SIOCGSTAMP 0x8906
#define SIOCGSTAMPNS 0x8907
#endif
#include <bits/ioctl_fix.h>
struct ipc_perm {
key_t __ipc_perm_key;
uid_t uid;
gid_t gid;
uid_t cuid;
gid_t cgid;
mode_t mode;
int __ipc_perm_seq;
long __pad1;
long __pad2;
};
struct msqid_ds {
struct ipc_perm msg_perm;
unsigned long __msg_stime_lo;
unsigned long __msg_stime_hi;
unsigned long __msg_rtime_lo;
unsigned long __msg_rtime_hi;
unsigned long __msg_ctime_lo;
unsigned long __msg_ctime_hi;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
time_t msg_stime;
time_t msg_rtime;
time_t msg_ctime;
};
#define _POSIX_V6_ILP32_OFFBIG 1
#define _POSIX_V7_ILP32_OFFBIG 1
#define PTRACE_GETWMMXREGS 18
#define PTRACE_SETWMMXREGS 19
#define PTRACE_GET_THREAD_AREA 22
#define PTRACE_SET_SYSCALL 23
#define PTRACE_GETCRUNCHREGS 25
#define PTRACE_SETCRUNCHREGS 26
#define PTRACE_GETVFPREGS 27
#define PTRACE_SETVFPREGS 28
#define PTRACE_GETHBPREGS 29
#define PTRACE_SETHBPREGS 30
#define PTRACE_GETFDPIC 31
#define PTRACE_GETFDPIC_EXEC 0
#define PTRACE_GETFDPIC_INTERP 1
#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
#define PT_GETVFPREGS PTRACE_GETVFPREGS
#define PT_SETVFPREGS PTRACE_SETVFPREGS
#define PT_GETHBPREGS PTRACE_GETHBPREGS
#define PT_SETHBPREGS PTRACE_SETHBPREGS
#define PT_GETFDPIC PTRACE_GETFDPIC
#undef __WORDSIZE
#define __WORDSIZE 32
/* FIXME */
struct semid_ds {
struct ipc_perm sem_perm;
unsigned long __sem_otime_lo;
unsigned long __sem_otime_hi;
unsigned long __sem_ctime_lo;
unsigned long __sem_ctime_hi;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
#else
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
unsigned short sem_nsems;
#endif
long __unused3;
long __unused4;
time_t sem_otime;
time_t sem_ctime;
};
typedef unsigned long long __jmp_buf[32];
#define SHMLBA 4096
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
unsigned long __shm_atime_lo;
unsigned long __shm_atime_hi;
unsigned long __shm_dtime_lo;
unsigned long __shm_dtime_hi;
unsigned long __shm_ctime_lo;
unsigned long __shm_ctime_hi;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
unsigned long __pad3;
time_t shm_atime;
time_t shm_dtime;
time_t shm_ctime;
};
struct shminfo {
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
};
struct shm_info {
int __used_ids;
unsigned long shm_tot, shm_rss, shm_swp;
unsigned long __swap_attempts, __swap_successes;
};
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef int greg_t, gregset_t[18];
typedef struct sigcontext {
unsigned long trap_no, error_code, oldmask;
unsigned long arm_r0, arm_r1, arm_r2, arm_r3;
unsigned long arm_r4, arm_r5, arm_r6, arm_r7;
unsigned long arm_r8, arm_r9, arm_r10, arm_fp;
unsigned long arm_ip, arm_sp, arm_lr, arm_pc;
unsigned long arm_cpsr, fault_address;
} mcontext_t;
#else
typedef struct {
unsigned long __regs[21];
} mcontext_t;
#endif
struct sigaltstack {
void *ss_sp;
int ss_flags;
size_t ss_size;
};
typedef struct __ucontext {
unsigned long uc_flags;
struct __ucontext *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
unsigned long long uc_regspace[64];
} ucontext_t;
#define SA_NOCLDSTOP 1
#define SA_NOCLDWAIT 2
#define SA_SIGINFO 4
#define SA_ONSTACK 0x08000000
#define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#endif
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT SIGABRT
#define SIGBUS 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGUSR1 10
#define SIGSEGV 11
#define SIGUSR2 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#define SIGSTKFLT 16
#define SIGCHLD 17
#define SIGCONT 18
#define SIGSTOP 19
#define SIGTSTP 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGURG 23
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGWINCH 28
#define SIGIO 29
#define SIGPOLL 29
#define SIGPWR 30
#define SIGSYS 31
#define SIGUNUSED SIGSYS
#define _NSIG 65
/* copied from kernel definition, but with padding replaced
* by the corresponding correctly-sized userspace types. */
struct stat {
dev_t st_dev;
int __st_dev_padding;
long __st_ino_truncated;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
int __st_rdev_padding;
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
struct {
long tv_sec;
long tv_nsec;
} __st_atim32, __st_mtim32, __st_ctim32;
ino_t st_ino;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
};
struct statfs {
unsigned long f_type, f_bsize;
fsblkcnt_t f_blocks, f_bfree, f_bavail;
fsfilcnt_t f_files, f_ffree;
fsid_t f_fsid;
unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
};
/**
* @defgroup syscall syscall
* @defgroup syscall system call ID definitions
* @ingroup syscall
*/
#ifndef _SYSCALL_SYSCALL_H
#define _SYSCALL_SYSCALL_H
#define ARG_NUM_0 0
#define ARG_NUM_1 1
#define ARG_NUM_2 2
#define ARG_NUM_3 3
#define ARG_NUM_4 4
#define ARG_NUM_5 5
#define ARG_NUM_6 6
#define ARG_NUM_7 7
#define __NR_restart_syscall 0
#define __NR_exit 1
#define __NR_fork 2
#define __NR_read 3
#define __NR_write 4
#define __NR_open 5
#define __NR_close 6
#define __NR_creat 8
#define __NR_link 9
#define __NR_unlink 10
#define __NR_execve 11
#define __NR_chdir 12
#define __NR_mknod 14
#define __NR_chmod 15
#define __NR_lchown 16
#define __NR_lseek 19
#define __NR_getpid 20
#define __NR_mount 21
#define __NR_umount 22
#define __NR_setuid 23
#define __NR_getuid 24
#define __NR_ptrace 26
#define __NR_pause 29
#define __NR_access 33
#define __NR_nice 34
#define __NR_sync 36
#define __NR_kill 37
#define __NR_rename 38
#define __NR_mkdir 39
#define __NR_rmdir 40
#define __NR_dup 41
#define __NR_pipe 42
#define __NR_times 43
#define __NR_brk 45
#define __NR_setgid 46
#define __NR_getgid 47
#define __NR_geteuid 49
#define __NR_getegid 50
#define __NR_acct 51
#define __NR_umount2 52
#define __NR_ioctl 54
#define __NR_fcntl 55
#define __NR_setpgid 57
#define __NR_umask 60
#define __NR_chroot 61
#define __NR_ustat 62
#define __NR_dup2 63
#define __NR_getppid 64
#define __NR_getpgrp 65
#define __NR_setsid 66
#define __NR_sigaction 67
#define __NR_setreuid 70
#define __NR_setregid 71
#define __NR_sigsuspend 72
#define __NR_sigpending 73
#define __NR_sethostname 74
#define __NR_setrlimit 75
#define __NR_getrusage 77
#define __NR_gettimeofday_time32 78
#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_symlink 83
#define __NR_readlink 85
#define __NR_uselib 86
#define __NR_swapon 87
#define __NR_reboot 88
#define __NR_munmap 91
#define __NR_truncate 92
#define __NR_ftruncate 93
#define __NR_fchmod 94
#define __NR_fchown 95
#define __NR_getpriority 96
#define __NR_setpriority 97
#define __NR_statfs 99
#define __NR_fstatfs 100
#define __NR_syslog 103
#define __NR_setitimer 104
#define __NR_getitimer 105
#define __NR_stat 106
#define __NR_lstat 107
#define __NR_fstat 108
#define __NR_vhangup 111
#define __NR_wait4 114
#define __NR_swapoff 115
#define __NR_sysinfo 116
#define __NR_fsync 118
#define __NR_sigreturn 119
#define __NR_clone 120
#define __NR_setdomainname 121
#define __NR_uname 122
#define __NR_adjtimex 124
#define __NR_mprotect 125
#define __NR_sigprocmask 126
#define __NR_init_module 128
#define __NR_delete_module 129
#define __NR_quotactl 131
#define __NR_getpgid 132
#define __NR_fchdir 133
#define __NR_bdflush 134
#define __NR_sysfs 135
#define __NR_personality 136
#define __NR_setfsuid 138
#define __NR_setfsgid 139
#define __NR__llseek 140
#define __NR_getdents 141
#define __NR__newselect 142
#define __NR_flock 143
#define __NR_msync 144
#define __NR_readv 145
#define __NR_writev 146
#define __NR_getsid 147
#define __NR_fdatasync 148
#define __NR__sysctl 149
#define __NR_mlock 150
#define __NR_munlock 151
#define __NR_mlockall 152
#define __NR_munlockall 153
#define __NR_sched_setparam 154
#define __NR_sched_getparam 155
#define __NR_sched_setscheduler 156
#define __NR_sched_getscheduler 157
#define __NR_sched_yield 158
#define __NR_sched_get_priority_max 159
#define __NR_sched_get_priority_min 160
#define __NR_sched_rr_get_interval 161
#define __NR_nanosleep 162
#define __NR_mremap 163
#define __NR_setresuid 164
#define __NR_getresuid 165
#define __NR_poll 168
#define __NR_nfsservctl 169
#define __NR_setresgid 170
#define __NR_getresgid 171
#define __NR_prctl 172
#define __NR_rt_sigreturn 173
#define __NR_rt_sigaction 174
#define __NR_rt_sigprocmask 175
#define __NR_rt_sigpending 176
#define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179
#define __NR_pread64 180
#define __NR_pwrite64 181
#define __NR_chown 182
#define __NR_getcwd 183
#define __NR_capget 184
#define __NR_capset 185
#define __NR_sigaltstack 186
#define __NR_sendfile 187
#define __NR_vfork 190
#define __NR_ugetrlimit 191
#define __NR_mmap2 192
#define __NR_truncate64 193
#define __NR_ftruncate64 194
#define __NR_stat64 195
#define __NR_lstat64 196
#define __NR_fstat64 197
#define __NR_lchown32 198
#define __NR_getuid32 199
#define __NR_getgid32 200
#define __NR_geteuid32 201
#define __NR_getegid32 202
#define __NR_setreuid32 203
#define __NR_setregid32 204
#define __NR_getgroups32 205
#define __NR_setgroups32 206
#define __NR_fchown32 207
#define __NR_setresuid32 208
#define __NR_getresuid32 209
#define __NR_setresgid32 210
#define __NR_getresgid32 211
#define __NR_chown32 212
#define __NR_setuid32 213
#define __NR_setgid32 214
#define __NR_setfsuid32 215
#define __NR_setfsgid32 216
#define __NR_getdents64 217
#define __NR_pivot_root 218
#define __NR_mincore 219
#define __NR_madvise 220
#define __NR_fcntl64 221
#define __NR_gettid 224
#define __NR_readahead 225
#define __NR_setxattr 226
#define __NR_lsetxattr 227
#define __NR_fsetxattr 228
#define __NR_getxattr 229
#define __NR_lgetxattr 230
#define __NR_fgetxattr 231
#define __NR_listxattr 232
#define __NR_llistxattr 233
#define __NR_flistxattr 234
#define __NR_removexattr 235
#define __NR_lremovexattr 236
#define __NR_fremovexattr 237
#define __NR_tkill 238
#define __NR_sendfile64 239
#define __NR_futex 240
#define __NR_sched_setaffinity 241
#define __NR_sched_getaffinity 242
#define __NR_io_setup 243
#define __NR_io_destroy 244
#define __NR_io_getevents 245
#define __NR_io_submit 246
#define __NR_io_cancel 247
#define __NR_exit_group 248
#define __NR_lookup_dcookie 249
#define __NR_epoll_create 250
#define __NR_epoll_ctl 251
#define __NR_epoll_wait 252
#define __NR_remap_file_pages 253
#define __NR_set_thread_area 254
#define __NR_get_thread_area 255
#define __NR_set_tid_address 256
#define __NR_timer_create 257
#define __NR_timer_settime32 258
#define __NR_timer_gettime32 259
#define __NR_timer_getoverrun 260
#define __NR_timer_delete 261
#define __NR_clock_settime32 262
#define __NR_clock_gettime32 263
#define __NR_clock_getres_time32 264
#define __NR_clock_nanosleep_time32 265
#define __NR_statfs64 266
#define __NR_fstatfs64 267
#define __NR_tgkill 268
#define __NR_utimes 269
#define __NR_fadvise64_64 270
#define __NR_arm_fadvise64_64 270
#define __NR_pciconfig_iobase 271
#define __NR_pciconfig_read 272
#define __NR_pciconfig_write 273
#define __NR_mq_open 274
#define __NR_mq_unlink 275
#define __NR_mq_timedsend 276
#define __NR_mq_timedreceive 277
#define __NR_mq_notify 278
#define __NR_mq_getsetattr 279
#define __NR_waitid 280
#define __NR_socket 281
#define __NR_bind 282
#define __NR_connect 283
#define __NR_listen 284
#define __NR_accept 285
#define __NR_getsockname 286
#define __NR_getpeername 287
#define __NR_socketpair 288
#define __NR_send 289
#define __NR_sendto 290
#define __NR_recv 291
#define __NR_recvfrom 292
#define __NR_shutdown 293
#define __NR_setsockopt 294
#define __NR_getsockopt 295
#define __NR_sendmsg 296
#define __NR_recvmsg 297
#define __NR_semop 298
#define __NR_semget 299
#define __NR_semctl 300
#define __NR_msgsnd 301
#define __NR_msgrcv 302
#define __NR_msgget 303
#define __NR_msgctl 304
#define __NR_shmat 305
#define __NR_shmdt 306
#define __NR_shmget 307
#define __NR_shmctl 308
#define __NR_add_key 309
#define __NR_request_key 310
#define __NR_keyctl 311
#define __NR_semtimedop 312
#define __NR_vserver 313
#define __NR_ioprio_set 314
#define __NR_ioprio_get 315
#define __NR_inotify_init 316
#define __NR_inotify_add_watch 317
#define __NR_inotify_rm_watch 318
#define __NR_mbind 319
#define __NR_get_mempolicy 320
#define __NR_set_mempolicy 321
#define __NR_openat 322
#define __NR_mkdirat 323
#define __NR_mknodat 324
#define __NR_fchownat 325
#define __NR_futimesat 326
#define __NR_fstatat64 327
#define __NR_unlinkat 328
#define __NR_renameat 329
#define __NR_linkat 330
#define __NR_symlinkat 331
#define __NR_readlinkat 332
#define __NR_fchmodat 333
#define __NR_faccessat 334
#define __NR_pselect6 335
#define __NR_ppoll 336
#define __NR_unshare 337
#define __NR_set_robust_list 338
#define __NR_get_robust_list 339
#define __NR_splice 340
#define __NR_sync_file_range2 341
#define __NR_arm_sync_file_range 341
#define __NR_tee 342
#define __NR_vmsplice 343
#define __NR_move_pages 344
#define __NR_getcpu 345
#define __NR_epoll_pwait 346
#define __NR_kexec_load 347
#define __NR_utimensat 348
#define __NR_signalfd 349
#define __NR_timerfd_create 350
#define __NR_eventfd 351
#define __NR_fallocate 352
#define __NR_timerfd_settime32 353
#define __NR_timerfd_gettime32 354
#define __NR_signalfd4 355
#define __NR_eventfd2 356
#define __NR_epoll_create1 357
#define __NR_dup3 358
#define __NR_pipe2 359
#define __NR_inotify_init1 360
#define __NR_preadv 361
#define __NR_pwritev 362
#define __NR_rt_tgsigqueueinfo 363
#define __NR_perf_event_open 364
#define __NR_recvmmsg 365
#define __NR_accept4 366
#define __NR_fanotify_init 367
#define __NR_fanotify_mark 368
#define __NR_prlimit64 369
#define __NR_name_to_handle_at 370
#define __NR_open_by_handle_at 371
#define __NR_clock_adjtime 372
#define __NR_syncfs 373
#define __NR_sendmmsg 374
#define __NR_setns 375
#define __NR_process_vm_readv 376
#define __NR_process_vm_writev 377
#define __NR_kcmp 378
#define __NR_finit_module 379
#define __NR_sched_setattr 380
#define __NR_sched_getattr 381
#define __NR_renameat2 382
#define __NR_seccomp 383
#define __NR_getrandom 384
#define __NR_memfd_create 385
#define __NR_bpf 386
#define __NR_execveat 387
#define __NR_userfaultfd 388
#define __NR_membarrier 389
#define __NR_mlock2 390
#define __NR_copy_file_range 391
#define __NR_preadv2 392
#define __NR_pwritev2 393
#define __NR_pkey_mprotect 394
#define __NR_pkey_alloc 395
#define __NR_pkey_free 396
#define __NR_statx 397
#define __NR_rseq 398
#define __NR_io_pgetevents 399
#define __NR_migrate_pages 400
#define __NR_kexec_file_load 401
#define __NR_pidfd_send_signal 424
#define __NR_io_uring_setup 425
#define __NR_io_uring_enter 426
#define __NR_io_uring_register 427
#define __NR_open_tree 428
#define __NR_move_mount 429
#define __NR_fsopen 430
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
#define __NR_pidfd_open 434
#define __NR_clone3 435
/* OHOS customized syscalls, not compatible with ARM EABI */
#define __NR_OHOS_BEGIN 500
#define __NR_pthread_set_detach (__NR_OHOS_BEGIN + 0)
#define __NR_pthread_join (__NR_OHOS_BEGIN + 1)
#define __NR_pthread_deatch (__NR_OHOS_BEGIN + 2)
#define __NR_creat_user_thread (__NR_OHOS_BEGIN + 3)
#define __NR_processcreat (__NR_OHOS_BEGIN + 4)
#define __NR_processtart (__NR_OHOS_BEGIN + 5)
#define __NR_printf (__NR_OHOS_BEGIN + 6)
#define __NR_dumpmemory (__NR_OHOS_BEGIN + 13)
#define __NR_mkfifo (__NR_OHOS_BEGIN + 14)
#define __NR_mqclose (__NR_OHOS_BEGIN + 15)
#define __NR_realpath (__NR_OHOS_BEGIN + 16)
#define __NR_format (__NR_OHOS_BEGIN + 17)
#define __NR_shellexec (__NR_OHOS_BEGIN + 18)
#define __NR_ohoscapget (__NR_OHOS_BEGIN + 19)
#define __NR_ohoscapset (__NR_OHOS_BEGIN + 20)
#define __NR_sysconf (__NR_OHOS_BEGIN + 21)
#define __NR_syscallend (__NR_OHOS_BEGIN + 22)
#define __ARM_NR_breakpoint 0x0f0001
#define __ARM_NR_cacheflush 0x0f0002
#define __ARM_NR_usr26 0x0f0003
#define __ARM_NR_usr32 0x0f0004
#define __ARM_NR_set_tls 0x0f0005
#define __ARM_NR_get_tls 0x0f0006
#endif // _SYSCALL_SYSCALL_H
struct termios {
tcflag_t c_iflag;
tcflag_t c_oflag;
tcflag_t c_cflag;
tcflag_t c_lflag;
cc_t c_line;
cc_t c_cc[NCCS];
speed_t __c_ispeed;
speed_t __c_ospeed;
};
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VTIME 5
#define VMIN 6
#define VSWTC 7
#define VSTART 8
#define VSTOP 9
#define VSUSP 10
#define VEOL 11
#define VREPRINT 12
#define VDISCARD 13
#define VWERASE 14
#define VLNEXT 15
#define VEOL2 16
#define IGNBRK 0000001
#define BRKINT 0000002
#define IGNPAR 0000004
#define PARMRK 0000010
#define INPCK 0000020
#define ISTRIP 0000040
#define INLCR 0000100
#define IGNCR 0000200
#define ICRNL 0000400
#define IUCLC 0001000
#define IXON 0002000
#define IXANY 0004000
#define IXOFF 0010000
#define IMAXBEL 0020000
#define IUTF8 0040000
#define OPOST 0000001
#define OLCUC 0000002
#define ONLCR 0000004
#define OCRNL 0000010
#define ONOCR 0000020
#define ONLRET 0000040
#define OFILL 0000100
#define OFDEL 0000200
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
#define NLDLY 0000400
#define NL0 0000000
#define NL1 0000400
#define CRDLY 0003000
#define CR0 0000000
#define CR1 0001000
#define CR2 0002000
#define CR3 0003000
#define TABDLY 0014000
#define TAB0 0000000
#define TAB1 0004000
#define TAB2 0010000
#define TAB3 0014000
#define BSDLY 0020000
#define BS0 0000000
#define BS1 0020000
#define FFDLY 0100000
#define FF0 0000000
#define FF1 0100000
#endif
#define VTDLY 0040000
#define VT0 0000000
#define VT1 0040000
#define B0 0000000
#define B50 0000001
#define B75 0000002
#define B110 0000003
#define B134 0000004
#define B150 0000005
#define B200 0000006
#define B300 0000007
#define B600 0000010
#define B1200 0000011
#define B1800 0000012
#define B2400 0000013
#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017
#define B57600 0010001
#define B115200 0010002
#define B230400 0010003
#define B460800 0010004
#define B500000 0010005
#define B576000 0010006
#define B921600 0010007
#define B1000000 0010010
#define B1152000 0010011
#define B1500000 0010012
#define B2000000 0010013
#define B2500000 0010014
#define B3000000 0010015
#define B3500000 0010016
#define B4000000 0010017
#define CSIZE 0000060
#define CS5 0000000
#define CS6 0000020
#define CS7 0000040
#define CS8 0000060
#define CSTOPB 0000100
#define CREAD 0000200
#define PARENB 0000400
#define PARODD 0001000
#define HUPCL 0002000
#define CLOCAL 0004000
#define ISIG 0000001
#define ICANON 0000002
#define ECHO 0000010
#define ECHOE 0000020
#define ECHOK 0000040
#define ECHONL 0000100
#define NOFLSH 0000200
#define TOSTOP 0000400
#define IEXTEN 0100000
#define TCOOFF 0
#define TCOON 1
#define TCIOFF 2
#define TCION 3
#define TCIFLUSH 0
#define TCOFLUSH 1
#define TCIOFLUSH 2
#define TCSANOW 0
#define TCSADRAIN 1
#define TCSAFLUSH 2
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define EXTA 0000016
#define EXTB 0000017
#define CBAUD 0010017
#define CBAUDEX 0010000
#define CIBAUD 002003600000
#define CMSPAR 010000000000
#define CRTSCTS 020000000000
#define XCASE 0000004
#define ECHOCTL 0001000
#define ECHOPRT 0002000
#define ECHOKE 0004000
#define FLUSHO 0010000
#define PENDIN 0040000
#define EXTPROC 0200000
#define XTABS 0014000
#endif
typedef struct user_fpregs {
struct fp_reg {
unsigned sign1:1;
unsigned unused:15;
unsigned sign2:1;
unsigned exponent:14;
unsigned j:1;
unsigned mantissa1:31;
unsigned mantissa0:32;
} fpregs[8];
unsigned fpsr:32;
unsigned fpcr:32;
unsigned char ftype[8];
unsigned int init_flag;
} elf_fpregset_t;
struct user_regs {
unsigned long uregs[18];
};
#define ELF_NGREG 18
typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
struct user {
struct user_regs regs;
int u_fpvalid;
unsigned long u_tsize, u_dsize, u_ssize;
unsigned long start_code, start_stack;
long signal;
int reserved;
struct user_regs *u_ar0;
unsigned long magic;
char u_comm[32];
int u_debugreg[8];
struct user_fpregs u_fp;
struct user_fpregs *u_fp0;
};
#ifndef _BYTESWAP_H
#define _BYTESWAP_H
#include <features.h>
#include <stdint.h>
static __inline uint16_t __bswap_16(uint16_t __x)
{
return __x<<8 | __x>>8;
}
static __inline uint32_t __bswap_32(uint32_t __x)
{
return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
}
static __inline uint64_t __bswap_64(uint64_t __x)
{
return __bswap_32(__x)+0ULL<<32 | __bswap_32(__x>>32);
}
#define bswap_16(x) __bswap_16(x)
#define bswap_32(x) __bswap_32(x)
#define bswap_64(x) __bswap_64(x)
#endif
#ifndef _CPIO_H
#define _CPIO_H
#define MAGIC "070707"
#define C_IRUSR 000400
#define C_IWUSR 000200
#define C_IXUSR 000100
#define C_IRGRP 000040
#define C_IWGRP 000020
#define C_IXGRP 000010
#define C_IROTH 000004
#define C_IWOTH 000002
#define C_IXOTH 000001
#define C_ISUID 004000
#define C_ISGID 002000
#define C_ISVTX 001000
#define C_ISBLK 060000
#define C_ISCHR 020000
#define C_ISDIR 040000
#define C_ISFIFO 010000
#define C_ISSOCK 0140000
#define C_ISLNK 0120000
#define C_ISCTG 0110000
#define C_ISREG 0100000
#endif
#ifndef _CRYPT_H
#define _CRYPT_H
#ifdef __cplusplus
extern "C" {
#endif
struct crypt_data {
int initialized;
char __buf[256];
};
char *crypt(const char *, const char *);
char *crypt_r(const char *, const char *, struct crypt_data *);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DIRENT_H
#define _DIRENT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define __NEED_ino_t
#define __NEED_off_t
#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
#define __NEED_size_t
#endif
#include <bits/alltypes.h>
#include <bits/dirent.h>
typedef struct __dirstream DIR;
#define d_fileno d_ino
int closedir(DIR *);
DIR *fdopendir(int);
DIR *opendir(const char *);
struct dirent *readdir(DIR *);
int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
void rewinddir(DIR *);
int dirfd(DIR *);
int alphasort(const struct dirent **, const struct dirent **);
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
void seekdir(DIR *, long);
long telldir(DIR *);
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define DT_UNKNOWN 0
#define DT_FIFO 1
#define DT_CHR 2
#define DT_DIR 4
#define DT_BLK 6
#define DT_REG 8
#define DT_LNK 10
#define DT_SOCK 12
#define DT_WHT 14
#define IFTODT(x) ((x)>>12 & 017)
#define DTTOIF(x) ((x)<<12)
int getdents(int, struct dirent *, size_t);
#endif
#ifdef _GNU_SOURCE
int versionsort(const struct dirent **, const struct dirent **);
#endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define dirent64 dirent
#define readdir64 readdir
#define readdir64_r readdir_r
#define scandir64 scandir
#define alphasort64 alphasort
#define versionsort64 versionsort
#define off64_t off_t
#define ino64_t ino_t
#define getdents64 getdents
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DLFCN_H
#define _DLFCN_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define RTLD_LAZY 1
#define RTLD_NOW 2
#define RTLD_NOLOAD 4
#define RTLD_NODELETE 4096
#define RTLD_GLOBAL 256
#define RTLD_LOCAL 0
#define RTLD_NEXT ((void *)-1)
#define RTLD_DEFAULT ((void *)0)
#define RTLD_DI_LINKMAP 2
int dlclose(void *);
char *dlerror(void);
void *dlopen(const char *, int);
void *dlsym(void *__restrict, const char *__restrict);
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef struct {
const char *dli_fname;
void *dli_fbase;
const char *dli_sname;
void *dli_saddr;
} Dl_info;
int dladdr(const void *, Dl_info *);
int dlinfo(void *, int, void *);
#endif
#if _REDIR_TIME64
__REDIR(dlsym, __dlsym_time64);
#endif
#ifdef __cplusplus
}
#endif
#endif
此差异已折叠。
#ifndef _ENDIAN_H
#define _ENDIAN_H
#include <features.h>
#define __NEED_uint16_t
#define __NEED_uint32_t
#define __NEED_uint64_t
#include <bits/alltypes.h>
#define __PDP_ENDIAN 3412
#define BIG_ENDIAN __BIG_ENDIAN
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#define PDP_ENDIAN __PDP_ENDIAN
#define BYTE_ORDER __BYTE_ORDER
static __inline uint16_t __bswap16(uint16_t __x)
{
return __x<<8 | __x>>8;
}
static __inline uint32_t __bswap32(uint32_t __x)
{
return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
}
static __inline uint64_t __bswap64(uint64_t __x)
{
return __bswap32(__x)+0ULL<<32 | __bswap32(__x>>32);
}
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htobe16(x) __bswap16(x)
#define be16toh(x) __bswap16(x)
#define htobe32(x) __bswap32(x)
#define be32toh(x) __bswap32(x)
#define htobe64(x) __bswap64(x)
#define be64toh(x) __bswap64(x)
#define htole16(x) (uint16_t)(x)
#define le16toh(x) (uint16_t)(x)
#define htole32(x) (uint32_t)(x)
#define le32toh(x) (uint32_t)(x)
#define htole64(x) (uint64_t)(x)
#define le64toh(x) (uint64_t)(x)
#else
#define htobe16(x) (uint16_t)(x)
#define be16toh(x) (uint16_t)(x)
#define htobe32(x) (uint32_t)(x)
#define be32toh(x) (uint32_t)(x)
#define htobe64(x) (uint64_t)(x)
#define be64toh(x) (uint64_t)(x)
#define htole16(x) __bswap16(x)
#define le16toh(x) __bswap16(x)
#define htole32(x) __bswap32(x)
#define le32toh(x) __bswap32(x)
#define htole64(x) __bswap64(x)
#define le64toh(x) __bswap64(x)
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define betoh16(x) __bswap16(x)
#define betoh32(x) __bswap32(x)
#define betoh64(x) __bswap64(x)
#define letoh16(x) (uint16_t)(x)
#define letoh32(x) (uint32_t)(x)
#define letoh64(x) (uint64_t)(x)
#else
#define betoh16(x) (uint16_t)(x)
#define betoh32(x) (uint32_t)(x)
#define betoh64(x) (uint64_t)(x)
#define letoh16(x) __bswap16(x)
#define letoh32(x) __bswap32(x)
#define letoh64(x) __bswap64(x)
#endif
#endif
#endif
#ifndef _ERR_H
#define _ERR_H
#include <features.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
void warn(const char *, ...);
void vwarn(const char *, va_list);
void warnx(const char *, ...);
void vwarnx(const char *, va_list);
_Noreturn void err(int, const char *, ...);
_Noreturn void verr(int, const char *, va_list);
_Noreturn void errx(int, const char *, ...);
_Noreturn void verrx(int, const char *, va_list);
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _ADAPT_ERRNO_H
#define _ADAPT_ERRNO_H
#include_next <errno.h>
#ifdef errno
#undef errno
#endif
#ifdef EDOM
#undef EDOM
#endif
#ifdef ERANGE
#undef ERANGE
#endif
#ifdef EFPOS
#undef EFPOS
#endif
#ifdef EILSEQ
#undef EILSEQ
#endif
#ifdef _NERR
#undef _NERR
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#include <bits/errno.h>
#ifdef __GNUC__
__attribute__((const))
#endif
int *__errno_location(void);
#define errno (*__errno_location())
#ifdef __cplusplus
}
#endif
#endif /* _ADAPT_ERRNO_H */
#ifndef _FCNTL_H
#define _FCNTL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define __NEED_off_t
#define __NEED_pid_t
#define __NEED_mode_t
#ifdef _GNU_SOURCE
#define __NEED_size_t
#define __NEED_ssize_t
#define __NEED_struct_iovec
#endif
#include <bits/alltypes.h>
#include <bits/fcntl.h>
struct flock {
short l_type;
short l_whence;
off_t l_start;
off_t l_len;
pid_t l_pid;
};
int creat(const char *, mode_t);
int fcntl(int, int, ...);
int open(const char *, int, ...);
int openat(int, const char *, int, ...);
int posix_fadvise(int, off_t, off_t, int);
int posix_fallocate(int, off_t, off_t);
#define O_SEARCH O_PATH
#define O_EXEC O_PATH
#define O_TTY_INIT 0
#define O_ACCMODE (03|O_SEARCH)
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define F_OFD_GETLK 36
#define F_OFD_SETLK 37
#define F_OFD_SETLKW 38
#define F_DUPFD_CLOEXEC 1030
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
#define FD_CLOEXEC 1
#define AT_FDCWD (-100)
#define AT_SYMLINK_NOFOLLOW 0x100
#define AT_REMOVEDIR 0x200
#define AT_SYMLINK_FOLLOW 0x400
#define AT_EACCESS 0x200
#define POSIX_FADV_NORMAL 0
#define POSIX_FADV_RANDOM 1
#define POSIX_FADV_SEQUENTIAL 2
#define POSIX_FADV_WILLNEED 3
#ifndef POSIX_FADV_DONTNEED
#define POSIX_FADV_DONTNEED 4
#define POSIX_FADV_NOREUSE 5
#endif
#undef SEEK_SET
#undef SEEK_CUR
#undef SEEK_END
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#ifndef S_IRUSR
#define S_ISUID 04000
#define S_ISGID 02000
#define S_ISVTX 01000
#define S_IRUSR 0400
#define S_IWUSR 0200
#define S_IXUSR 0100
#define S_IRWXU 0700
#define S_IRGRP 0040
#define S_IWGRP 0020
#define S_IXGRP 0010
#define S_IRWXG 0070
#define S_IROTH 0004
#define S_IWOTH 0002
#define S_IXOTH 0001
#define S_IRWXO 0007
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define AT_NO_AUTOMOUNT 0x800
#define AT_EMPTY_PATH 0x1000
#define AT_STATX_SYNC_TYPE 0x6000
#define AT_STATX_SYNC_AS_STAT 0x0000
#define AT_STATX_FORCE_SYNC 0x2000
#define AT_STATX_DONT_SYNC 0x4000
#define AT_RECURSIVE 0x8000
#define FAPPEND O_APPEND
#define FFSYNC O_SYNC
#define FASYNC O_ASYNC
#define FNONBLOCK O_NONBLOCK
#define FNDELAY O_NDELAY
#define F_OK 0
#define R_OK 4
#define W_OK 2
#define X_OK 1
#define F_ULOCK 0
#define F_LOCK 1
#define F_TLOCK 2
#define F_TEST 3
#define F_SETLEASE 1024
#define F_GETLEASE 1025
#define F_NOTIFY 1026
#define F_CANCELLK 1029
#define F_SETPIPE_SZ 1031
#define F_GETPIPE_SZ 1032
#define F_ADD_SEALS 1033
#define F_GET_SEALS 1034
#define F_SEAL_SEAL 0x0001
#define F_SEAL_SHRINK 0x0002
#define F_SEAL_GROW 0x0004
#define F_SEAL_WRITE 0x0008
#define F_SEAL_FUTURE_WRITE 0x0010
#define F_GET_RW_HINT 1035
#define F_SET_RW_HINT 1036
#define F_GET_FILE_RW_HINT 1037
#define F_SET_FILE_RW_HINT 1038
#define RWF_WRITE_LIFE_NOT_SET 0
#define RWH_WRITE_LIFE_NONE 1
#define RWH_WRITE_LIFE_SHORT 2
#define RWH_WRITE_LIFE_MEDIUM 3
#define RWH_WRITE_LIFE_LONG 4
#define RWH_WRITE_LIFE_EXTREME 5
#define DN_ACCESS 0x00000001
#define DN_MODIFY 0x00000002
#define DN_CREATE 0x00000004
#define DN_DELETE 0x00000008
#define DN_RENAME 0x00000010
#define DN_ATTRIB 0x00000020
#define DN_MULTISHOT 0x80000000
int lockf(int, int, off_t);
#endif
#if defined(_GNU_SOURCE)
#define F_OWNER_TID 0
#define F_OWNER_PID 1
#define F_OWNER_PGRP 2
#define F_OWNER_GID 2
struct file_handle {
unsigned handle_bytes;
int handle_type;
unsigned char f_handle[];
};
struct f_owner_ex {
int type;
pid_t pid;
};
#define FALLOC_FL_KEEP_SIZE 1
#define FALLOC_FL_PUNCH_HOLE 2
#define MAX_HANDLE_SZ 128
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
#define SYNC_FILE_RANGE_WRITE 2
#define SYNC_FILE_RANGE_WAIT_AFTER 4
#define SPLICE_F_MOVE 1
#define SPLICE_F_NONBLOCK 2
#define SPLICE_F_MORE 4
#define SPLICE_F_GIFT 8
int fallocate(int, int, off_t, off_t);
#define fallocate64 fallocate
int name_to_handle_at(int, const char *, struct file_handle *, int *, int);
int open_by_handle_at(int, struct file_handle *, int);
ssize_t readahead(int, off_t, size_t);
int sync_file_range(int, off_t, off_t, unsigned);
ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned);
ssize_t tee(int, int, size_t, unsigned);
#define loff_t off_t
#endif
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define F_GETLK64 F_GETLK
#define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW
#define flock64 flock
#define open64 open
#define openat64 openat
#define creat64 creat
#define lockf64 lockf
#define posix_fadvise64 posix_fadvise
#define posix_fallocate64 posix_fallocate
#define off64_t off_t
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef _FEATURES_H
#define _FEATURES_H
#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
#define _GNU_SOURCE 1
#endif
#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
#define _BSD_SOURCE 1
#endif
#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
&& !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
&& !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
#define _BSD_SOURCE 1
#define _XOPEN_SOURCE 700
#endif
#if __STDC_VERSION__ >= 199901L && !defined(__cplusplus)
#define __restrict restrict
#elif !defined(__GNUC__)
#define __restrict
#endif
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
#define __inline inline
#elif !defined(__GNUC__)
#define __inline
#endif
#if defined(__cplusplus)
#if __cplusplus >= 201103L
#define _Noreturn [[ noreturn ]]
#else
#define _Noreturn
#endif
#elif __STDC_VERSION__ >= 201112L
#elif defined(__GNUC__)
#define _Noreturn __attribute__((__noreturn__))
#else
#define _Noreturn
#endif
#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
#endif
#ifndef _FMTMSG_H
#define _FMTMSG_H
#ifdef __cplusplus
extern "C" {
#endif
#define MM_HARD 1
#define MM_SOFT 2
#define MM_FIRM 4
#define MM_APPL 8
#define MM_UTIL 16
#define MM_OPSYS 32
#define MM_RECOVER 64
#define MM_NRECOV 128
#define MM_PRINT 256
#define MM_CONSOLE 512
#define MM_NULLMC 0L
#define MM_HALT 1
#define MM_ERROR 2
#define MM_WARNING 3
#define MM_INFO 4
#define MM_NOSEV 0
#define MM_OK 0
#define MM_NOTOK (-1)
#define MM_NOMSG 1
#define MM_NOCON 4
#define MM_NULLLBL ((char*)0)
#define MM_NULLTXT ((char*)0)
#define MM_NULLACT ((char*)0)
#define MM_NULLTAG ((char*)0)
#define MM_NULLSEV 0
int fmtmsg(long, const char *, int, const char *, const char *, const char *);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _FNMATCH_H
#define _FNMATCH_H
#ifdef __cplusplus
extern "C" {
#endif
#define FNM_PATHNAME 0x1
#define FNM_NOESCAPE 0x2
#define FNM_PERIOD 0x4
#define FNM_LEADING_DIR 0x8
#define FNM_CASEFOLD 0x10
#define FNM_FILE_NAME FNM_PATHNAME
#define FNM_NOMATCH 1
#define FNM_NOSYS (-1)
int fnmatch(const char *, const char *, int);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _FTW_H
#define _FTW_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#include <sys/stat.h>
#define FTW_F 1
#define FTW_D 2
#define FTW_DNR 3
#define FTW_NS 4
#define FTW_SL 5
#define FTW_DP 6
#define FTW_SLN 7
#define FTW_PHYS 1
#define FTW_MOUNT 2
#define FTW_CHDIR 4
#define FTW_DEPTH 8
struct FTW {
int base;
int level;
};
int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int);
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define ftw64 ftw
#define nftw64 nftw
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef _GETOPT_H
#define _GETOPT_H
#ifdef __cplusplus
extern "C" {
#endif
int getopt(int, char * const [], const char *);
extern char *optarg;
extern int optind, opterr, optopt, optreset;
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
int getopt_long(int, char *const *, const char *, const struct option *, int *);
int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#ifdef __cplusplus
}
#endif
#endif
#ifndef _GLOB_H
#define _GLOB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define __NEED_size_t
#include <bits/alltypes.h>
typedef struct {
size_t gl_pathc;
char **gl_pathv;
size_t gl_offs;
int __dummy1;
void *__dummy2[5];
} glob_t;
int glob(const char *__restrict, int, int (*)(const char *, int), glob_t *__restrict);
void globfree(glob_t *);
#define GLOB_ERR 0x01
#define GLOB_MARK 0x02
#define GLOB_NOSORT 0x04
#define GLOB_DOOFFS 0x08
#define GLOB_NOCHECK 0x10
#define GLOB_APPEND 0x20
#define GLOB_NOESCAPE 0x40
#define GLOB_PERIOD 0x80
#define GLOB_TILDE 0x1000
#define GLOB_TILDE_CHECK 0x4000
#define GLOB_NOSPACE 1
#define GLOB_ABORTED 2
#define GLOB_NOMATCH 3
#define GLOB_NOSYS 4
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define glob64 glob
#define globfree64 globfree
#define glob64_t glob_t
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef _GRP_H
#define _GRP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define __NEED_size_t
#define __NEED_gid_t
#ifdef _GNU_SOURCE
#define __NEED_FILE
#endif
#include <bits/alltypes.h>
struct group {
char *gr_name;
char *gr_passwd;
gid_t gr_gid;
char **gr_mem;
};
struct group *getgrgid(gid_t);
struct group *getgrnam(const char *);
int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct group *getgrent(void);
void endgrent(void);
void setgrent(void);
#endif
#ifdef _GNU_SOURCE
struct group *fgetgrent(FILE *);
int putgrent(const struct group *, FILE *);
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
int getgrouplist(const char *, gid_t, gid_t *, int *);
int setgroups(size_t, const gid_t *);
int initgroups(const char *, gid_t);
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef _ICONV_H
#define _ICONV_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#define __NEED_size_t
#include <bits/alltypes.h>
typedef void *iconv_t;
iconv_t iconv_open(const char *, const char *);
size_t iconv(iconv_t, char **__restrict, size_t *__restrict, char **__restrict, size_t *__restrict);
int iconv_close(iconv_t);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _IFADDRS_H
#define _IFADDRS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#include <netinet/in.h>
#include <sys/socket.h>
struct ifaddrs {
struct ifaddrs *ifa_next;
char *ifa_name;
unsigned ifa_flags;
struct sockaddr *ifa_addr;
struct sockaddr *ifa_netmask;
union {
struct sockaddr *ifu_broadaddr;
struct sockaddr *ifu_dstaddr;
} ifa_ifu;
void *ifa_data;
};
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
void freeifaddrs(struct ifaddrs *);
int getifaddrs(struct ifaddrs **);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _LANGINFO_H
#define _LANGINFO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <features.h>
#include <nl_types.h>
#define __NEED_locale_t
#include <bits/alltypes.h>
#define ABDAY_1 0x20000
#define ABDAY_2 0x20001
#define ABDAY_3 0x20002
#define ABDAY_4 0x20003
#define ABDAY_5 0x20004
#define ABDAY_6 0x20005
#define ABDAY_7 0x20006
#define DAY_1 0x20007
#define DAY_2 0x20008
#define DAY_3 0x20009
#define DAY_4 0x2000A
#define DAY_5 0x2000B
#define DAY_6 0x2000C
#define DAY_7 0x2000D
#define ABMON_1 0x2000E
#define ABMON_2 0x2000F
#define ABMON_3 0x20010
#define ABMON_4 0x20011
#define ABMON_5 0x20012
#define ABMON_6 0x20013
#define ABMON_7 0x20014
#define ABMON_8 0x20015
#define ABMON_9 0x20016
#define ABMON_10 0x20017
#define ABMON_11 0x20018
#define ABMON_12 0x20019
#define MON_1 0x2001A
#define MON_2 0x2001B
#define MON_3 0x2001C
#define MON_4 0x2001D
#define MON_5 0x2001E
#define MON_6 0x2001F
#define MON_7 0x20020
#define MON_8 0x20021
#define MON_9 0x20022
#define MON_10 0x20023
#define MON_11 0x20024
#define MON_12 0x20025
#define AM_STR 0x20026
#define PM_STR 0x20027
#define D_T_FMT 0x20028
#define D_FMT 0x20029
#define T_FMT 0x2002A
#define T_FMT_AMPM 0x2002B
#define ERA 0x2002C
#define ERA_D_FMT 0x2002E
#define ALT_DIGITS 0x2002F
#define ERA_D_T_FMT 0x20030
#define ERA_T_FMT 0x20031
#define CODESET 14
#define CRNCYSTR 0x4000F
#define RADIXCHAR 0x10000
#define THOUSEP 0x10001
#define YESEXPR 0x50000
#define NOEXPR 0x50001
#define _NL_LOCALE_NAME(cat) (((cat)<<16) | 0xffff)
#if defined(_GNU_SOURCE)
#define NL_LOCALE_NAME(cat) _NL_LOCALE_NAME(cat)
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define YESSTR 0x50002
#define NOSTR 0x50003
#endif
char *nl_langinfo(nl_item);
char *nl_langinfo_l(nl_item, locale_t);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _LIBGEN_H
#define _LIBGEN_H
#ifdef __cplusplus
extern "C" {
#endif
char *dirname(char *);
char *basename(char *);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _LIBINTL_H
#define _LIBINTL_H
#ifdef __cplusplus
extern "C" {
#endif
#define __USE_GNU_GETTEXT 1
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 1 : -1)
#if __GNUC__ >= 3
#define __fa(n) __attribute__ ((__format_arg__ (n)))
#else
#define __fa(n)
#endif
char *gettext(const char *) __fa(1);
char *dgettext(const char *, const char *) __fa(2);
char *dcgettext(const char *, const char *, int) __fa(2);
char *ngettext(const char *, const char *, unsigned long) __fa(1) __fa(2);
char *dngettext(const char *, const char *, const char *, unsigned long) __fa(2) __fa(3);
char *dcngettext(const char *, const char *, const char *, unsigned long, int) __fa(2) __fa(3);
char *textdomain(const char *);
char *bindtextdomain (const char *, const char *);
char *bind_textdomain_codeset(const char *, const char *);
#undef __fa
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _ADAPT_LIMITS_H
#define _ADAPT_LIMITS_H
#include "los_config.h"
#define PATH_MAX 256
#define NAME_MAX 255
#define MQ_PRIO_MAX 1
#define PTHREAD_STACK_MIN LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE
#define IOV_MAX 1024
#define SSIZE_MAX LONG_MAX
#define PTHREAD_KEYS_MAX 128
#include_next <limits.h>
#endif /* _ADAPT_LIMITS_H */
#ifndef _LINK_H
#define _LINK_H
#ifdef __cplusplus
extern "C" {
#endif
#include <elf.h>
#define __NEED_size_t
#define __NEED_uint32_t
#include <bits/alltypes.h>
#if UINTPTR_MAX > 0xffffffff
#define ElfW(type) Elf64_ ## type
#else
#define ElfW(type) Elf32_ ## type
#endif
#include <bits/link.h>
struct dl_phdr_info {
ElfW(Addr) dlpi_addr;
const char *dlpi_name;
const ElfW(Phdr) *dlpi_phdr;
ElfW(Half) dlpi_phnum;
unsigned long long int dlpi_adds;
unsigned long long int dlpi_subs;
size_t dlpi_tls_modid;
void *dlpi_tls_data;
};
struct link_map {
ElfW(Addr) l_addr;
char *l_name;
ElfW(Dyn) *l_ld;
struct link_map *l_next, *l_prev;
};
struct r_debug {
int r_version;
struct link_map *r_map;
ElfW(Addr) r_brk;
enum { RT_CONSISTENT, RT_ADD, RT_DELETE } r_state;
ElfW(Addr) r_ldbase;
};
int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _MALLOC_H
#define _MALLOC_H
#ifdef __cplusplus
extern "C" {
#endif
#define __NEED_size_t
#include <bits/alltypes.h>
void *malloc (size_t);
void *calloc (size_t, size_t);
void *realloc (void *, size_t);
void free (void *);
void *valloc (size_t);
void *memalign(size_t, size_t);
size_t malloc_usable_size(void *);
#ifdef __cplusplus
}
#endif
#endif
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册