修改上传所有文件
This commit is contained in:
76
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/ssp.h
Normal file
76
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/ssp.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/* $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006, 2011 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 _SSP_SSP_H_
|
||||
#define _SSP_SSP_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* __ssp_real is used by the implementation in libc */
|
||||
#if __SSP_FORTIFY_LEVEL == 0
|
||||
#define __ssp_real_(fun) fun
|
||||
#else
|
||||
#define __ssp_real_(fun) __ssp_real_ ## fun
|
||||
#endif
|
||||
#define __ssp_real(fun) __ssp_real_(fun)
|
||||
|
||||
#define __ssp_inline extern __inline__ __attribute__((__always_inline__, __gnu_inline__))
|
||||
|
||||
#define __ssp_bos(ptr) __builtin_object_size(ptr, __SSP_FORTIFY_LEVEL > 1)
|
||||
#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0)
|
||||
|
||||
#define __ssp_check(buf, len, bos) \
|
||||
if (bos(buf) != (size_t)-1 && len > bos(buf)) \
|
||||
__chk_fail()
|
||||
#define __ssp_decl(rtype, fun, args) \
|
||||
rtype __ssp_real_(fun) args __asm__(__ASMNAME(#fun)); \
|
||||
__ssp_inline rtype fun args
|
||||
#define __ssp_redirect_raw(rtype, fun, args, call, cond, bos) \
|
||||
__ssp_decl(rtype, fun, args) \
|
||||
{ \
|
||||
if (cond) \
|
||||
__ssp_check(__buf, __len, bos); \
|
||||
return __ssp_real_(fun) call; \
|
||||
}
|
||||
|
||||
#define __ssp_redirect(rtype, fun, args, call) \
|
||||
__ssp_redirect_raw(rtype, fun, args, call, 1, __ssp_bos)
|
||||
#define __ssp_redirect0(rtype, fun, args, call) \
|
||||
__ssp_redirect_raw(rtype, fun, args, call, 1, __ssp_bos0)
|
||||
|
||||
#define __ssp_overlap(a, b, l) \
|
||||
(((a) <= (b) && (b) < (a) + (l)) || ((b) <= (a) && (a) < (b) + (l)))
|
||||
|
||||
__BEGIN_DECLS
|
||||
void __stack_chk_fail(void) __dead2;
|
||||
void __chk_fail(void) __dead2;
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SSP_SSP_H_ */
|
||||
101
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/stdio.h
Normal file
101
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/stdio.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/* $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:34 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 _SSP_STDIO_H_
|
||||
#define _SSP_STDIO_H_
|
||||
|
||||
#include <ssp/ssp.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int __sprintf_chk(char *__restrict, int, size_t, const char *__restrict, ...)
|
||||
__printflike(4, 5);
|
||||
int __vsprintf_chk(char *__restrict, int, size_t, const char *__restrict,
|
||||
__va_list)
|
||||
__printflike(4, 0);
|
||||
int __snprintf_chk(char *__restrict, size_t, int, size_t,
|
||||
const char *__restrict, ...)
|
||||
__printflike(5, 6);
|
||||
int __vsnprintf_chk(char *__restrict, size_t, int, size_t,
|
||||
const char *__restrict, __va_list)
|
||||
__printflike(5, 0);
|
||||
char *__gets_chk(char *, size_t);
|
||||
__END_DECLS
|
||||
|
||||
#if __SSP_FORTIFY_LEVEL > 0
|
||||
|
||||
|
||||
#define sprintf(str, ...) \
|
||||
__builtin___sprintf_chk(str, 0, __ssp_bos(str), __VA_ARGS__)
|
||||
|
||||
#define vsprintf(str, fmt, ap) \
|
||||
__builtin___vsprintf_chk(str, 0, __ssp_bos(str), fmt, ap)
|
||||
|
||||
#define snprintf(str, len, ...) \
|
||||
__builtin___snprintf_chk(str, len, 0, __ssp_bos(str), __VA_ARGS__)
|
||||
|
||||
#define vsnprintf(str, len, fmt, ap) \
|
||||
__builtin___vsnprintf_chk(str, len, 0, __ssp_bos(str), fmt, ap)
|
||||
|
||||
#define gets(str) \
|
||||
__gets_chk(str, __ssp_bos(str))
|
||||
|
||||
__ssp_decl(char *, fgets, (char *__restrict __buf, int __len, FILE *__fp))
|
||||
{
|
||||
if (__len > 0)
|
||||
__ssp_check(__buf, (size_t)__len, __ssp_bos);
|
||||
return __ssp_real_fgets(__buf, __len, __fp);
|
||||
}
|
||||
|
||||
#if __GNU_VISIBLE
|
||||
__ssp_decl(char *, fgets_unlocked, (char *__restrict __buf, int __len, FILE *__fp))
|
||||
{
|
||||
if (__len > 0)
|
||||
__ssp_check(__buf, (size_t)__len, __ssp_bos);
|
||||
return __ssp_real_fgets_unlocked(__buf, __len, __fp);
|
||||
}
|
||||
#endif /* __GNU_VISIBLE */
|
||||
|
||||
__ssp_decl(size_t, fread, (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __fp))
|
||||
{
|
||||
__ssp_check(__ptr, __size * __n, __ssp_bos0);
|
||||
return __ssp_real_fread(__ptr, __size, __n, __fp);
|
||||
}
|
||||
|
||||
#if __MISC_VISIBLE
|
||||
__ssp_decl(size_t, fread_unlocked, (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __fp))
|
||||
{
|
||||
__ssp_check(__ptr, __size * __n, __ssp_bos0);
|
||||
return __ssp_real_fread_unlocked(__ptr, __size, __n, __fp);
|
||||
}
|
||||
#endif /* __MISC_VISIBLE */
|
||||
|
||||
#endif /* __SSP_FORTIFY_LEVEL > 0 */
|
||||
|
||||
#endif /* _SSP_STDIO_H_ */
|
||||
30
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/stdlib.h
Normal file
30
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/stdlib.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef _SSP_STDLIB_H_
|
||||
#define _SSP_STDLIB_H_
|
||||
|
||||
#include <ssp/ssp.h>
|
||||
|
||||
#if __SSP_FORTIFY_LEVEL > 0
|
||||
__BEGIN_DECLS
|
||||
|
||||
__ssp_decl(size_t, mbstowcs, (wchar_t *__buf, const char *__src, size_t __n))
|
||||
{
|
||||
if (__buf != NULL)
|
||||
__ssp_check(__buf, __n * sizeof(wchar_t), __ssp_bos);
|
||||
return __ssp_real_mbstowcs (__buf, __src, __n);
|
||||
}
|
||||
|
||||
__ssp_redirect_raw(size_t, wcstombs, \
|
||||
(char *__buf, const wchar_t *__src, size_t __len), \
|
||||
(__buf, __src, __len), __buf != NULL, __ssp_bos);
|
||||
|
||||
__ssp_decl(int, wctomb, (char *__buf, wchar_t __wc))
|
||||
{
|
||||
if (__buf != NULL)
|
||||
__ssp_check(__buf, MB_CUR_MAX, __ssp_bos);
|
||||
return __ssp_real_wctomb (__buf, __wc);
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __SSP_FORTIFY_LEVEL > 0 */
|
||||
#endif /* _SSP_STDLIB_H_ */
|
||||
115
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/string.h
Normal file
115
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/string.h
Normal file
@@ -0,0 +1,115 @@
|
||||
/* $NetBSD: string.h,v 1.13 2014/11/29 13:23:48 pooka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 _SSP_STRING_H_
|
||||
#define _SSP_STRING_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <ssp/ssp.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
void *__memcpy_chk(void *, const void *, size_t, size_t);
|
||||
void *__memmove_chk(void *, void *, size_t, size_t);
|
||||
void *__mempcpy_chk(void *, const void *, size_t, size_t);
|
||||
void *__memset_chk(void *, int, size_t, size_t);
|
||||
char *__stpcpy_chk(char *, const char *, size_t);
|
||||
char *__strcat_chk(char *, const char *, size_t);
|
||||
char *__strcpy_chk(char *, const char *, size_t);
|
||||
char *__strncat_chk(char *, const char *, size_t, size_t);
|
||||
char *__strncpy_chk(char *, const char *, size_t, size_t);
|
||||
__END_DECLS
|
||||
|
||||
#if __SSP_FORTIFY_LEVEL > 0
|
||||
|
||||
#define __ssp_bos_check3(fun, dst, src, len) \
|
||||
((__ssp_bos0(dst) != (size_t)-1) ? \
|
||||
__builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)) : \
|
||||
__ ## fun ## _ichk(dst, src, len))
|
||||
|
||||
#define __ssp_bos_check2(fun, dst, src) \
|
||||
((__ssp_bos0(dst) != (size_t)-1) ? \
|
||||
__builtin___ ## fun ## _chk(dst, src, __ssp_bos0(dst)) : \
|
||||
__ ## fun ## _ichk(dst, src))
|
||||
|
||||
#define __ssp_bos_icheck3_restrict(fun, type1, type2) \
|
||||
__ssp_inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __restrict, size_t); \
|
||||
__ssp_inline type1 \
|
||||
__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, size_t len) { \
|
||||
return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \
|
||||
}
|
||||
|
||||
#define __ssp_bos_icheck3(fun, type1, type2) \
|
||||
__ssp_inline type1 __ ## fun ## _ichk(type1, type2, size_t); \
|
||||
__ssp_inline type1 \
|
||||
__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \
|
||||
return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \
|
||||
}
|
||||
|
||||
#define __ssp_bos_icheck2_restrict(fun, type1, type2) \
|
||||
__ssp_inline type1 __ ## fun ## _ichk(type1, type2); \
|
||||
__ssp_inline type1 \
|
||||
__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src) { \
|
||||
return __builtin___ ## fun ## _chk(dst, src, __ssp_bos0(dst)); \
|
||||
}
|
||||
|
||||
__BEGIN_DECLS
|
||||
__ssp_bos_icheck3_restrict(memcpy, void *, const void *)
|
||||
__ssp_bos_icheck3(memmove, void *, const void *)
|
||||
__ssp_bos_icheck3_restrict(mempcpy, void *, const void *)
|
||||
__ssp_bos_icheck3(memset, void *, int)
|
||||
__ssp_bos_icheck2_restrict(stpcpy, char *, const char *)
|
||||
#if __GNUC_PREREQ__(4,8) || defined(__clang__)
|
||||
__ssp_bos_icheck3_restrict(stpncpy, char *, const char *)
|
||||
#endif
|
||||
__ssp_bos_icheck2_restrict(strcpy, char *, const char *)
|
||||
__ssp_bos_icheck2_restrict(strcat, char *, const char *)
|
||||
__ssp_bos_icheck3_restrict(strncpy, char *, const char *)
|
||||
__ssp_bos_icheck3_restrict(strncat, char *, const char *)
|
||||
__END_DECLS
|
||||
|
||||
#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len)
|
||||
#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len)
|
||||
#if __GNU_VISIBLE
|
||||
#define mempcpy(dst, src, len) __ssp_bos_check3(mempcpy, dst, src, len)
|
||||
#endif
|
||||
#define memset(dst, val, len) __ssp_bos_check3(memset, dst, val, len)
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src)
|
||||
#if __GNUC_PREREQ__(4,8) || defined(__clang__)
|
||||
#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len)
|
||||
#endif
|
||||
#endif
|
||||
#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src)
|
||||
#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src)
|
||||
#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len)
|
||||
#define strncat(dst, src, len) __ssp_bos_check3(strncat, dst, src, len)
|
||||
|
||||
#endif /* __SSP_FORTIFY_LEVEL > 0 */
|
||||
#endif /* _SSP_STRING_H_ */
|
||||
55
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/strings.h
Normal file
55
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/strings.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 _SSP_STRINGS_H_
|
||||
#define _SSP_STRINGS_H_
|
||||
|
||||
#include <ssp/ssp.h>
|
||||
|
||||
#if __SSP_FORTIFY_LEVEL > 0
|
||||
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
|
||||
#define bcopy(src, dst, len) \
|
||||
((__ssp_bos0(dst) != (size_t)-1) ? \
|
||||
__builtin___memmove_chk(dst, src, len, __ssp_bos0(dst)) : \
|
||||
__memmove_ichk(dst, src, len))
|
||||
#define bzero(dst, len) \
|
||||
((__ssp_bos0(dst) != (size_t)-1) ? \
|
||||
__builtin___memset_chk(dst, 0, len, __ssp_bos0(dst)) : \
|
||||
__memset_ichk(dst, 0, len))
|
||||
#endif
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
__ssp_redirect0(void, explicit_bzero, (void *__buf, size_t __len), \
|
||||
(__buf, __len));
|
||||
#endif
|
||||
|
||||
#endif /* __SSP_FORTIFY_LEVEL > 0 */
|
||||
#endif /* _SSP_STRINGS_H_ */
|
||||
93
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/unistd.h
Normal file
93
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/unistd.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 _SSP_UNISTD_H_
|
||||
#define _SSP_UNISTD_H_
|
||||
|
||||
#include <ssp/ssp.h>
|
||||
|
||||
#if __SSP_FORTIFY_LEVEL > 0
|
||||
__BEGIN_DECLS
|
||||
|
||||
#if __POSIX_VISIBLE >= 199209
|
||||
__ssp_redirect(size_t, confstr, (int __name, char *__buf, size_t __len), \
|
||||
(__name, __buf, __len));
|
||||
#endif
|
||||
|
||||
__ssp_redirect_raw(char *, getcwd, (char *__buf, size_t __len),
|
||||
(__buf, __len), __buf != 0, __ssp_bos);
|
||||
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
|
||||
__ssp_redirect(int, getdomainname, (char *__buf, size_t __len), \
|
||||
(__buf, __len));
|
||||
#endif
|
||||
|
||||
__ssp_decl(int, getgroups, (int __n, gid_t __buf[]))
|
||||
{
|
||||
__ssp_check(__buf, __n * sizeof(gid_t), __ssp_bos);
|
||||
return __ssp_real_getgroups (__n, __buf);
|
||||
}
|
||||
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500
|
||||
#if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))
|
||||
__ssp_redirect(int, gethostname, (char *__buf, size_t __len), \
|
||||
(__buf, __len));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
__ssp_redirect(int, getlogin_r, (char *__buf, size_t __len), \
|
||||
(__buf, __len));
|
||||
|
||||
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500
|
||||
__ssp_redirect0(ssize_t, pread, (int __fd, void *__buf, size_t __len, off_t __off), \
|
||||
(__fd, __buf, __len, __off));
|
||||
#endif
|
||||
|
||||
__ssp_redirect0(_READ_WRITE_RETURN_TYPE, read, \
|
||||
(int __fd, void *__buf, size_t __len), (__fd, __buf, __len));
|
||||
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4
|
||||
__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \
|
||||
char *__restrict __buf, size_t __len), (__path, __buf, __len));
|
||||
#endif
|
||||
|
||||
#if __ATFILE_VISIBLE
|
||||
__ssp_redirect(ssize_t, readlinkat, \
|
||||
(int __dirfd1, const char *__restrict __path, char *__restrict __buf, size_t __len), \
|
||||
(__dirfd1, __path, __buf, __len));
|
||||
#endif
|
||||
|
||||
__ssp_redirect(int, ttyname_r, (int __fd, char *__buf, size_t __len), \
|
||||
(__fd, __buf, __len));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __SSP_FORTIFY_LEVEL > 0 */
|
||||
#endif /* _SSP_UNISTD_H_ */
|
||||
97
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/wchar.h
Normal file
97
e3_176_ref/prebuilts/gcc/arm-none-eabi/include/ssp/wchar.h
Normal file
@@ -0,0 +1,97 @@
|
||||
#ifndef _SSP_WCHAR_H_
|
||||
#define _SSP_WCHAR_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <ssp/ssp.h>
|
||||
|
||||
#if __SSP_FORTIFY_LEVEL > 0
|
||||
|
||||
/* wide character variant, __wlen is number of wchar_t */
|
||||
#define __ssp_redirect_wc(rtype, fun, args, call, cond, bos) \
|
||||
__ssp_decl(rtype, fun, args) \
|
||||
{ \
|
||||
if (cond) \
|
||||
__ssp_check(__buf, __wlen * sizeof(wchar_t), bos); \
|
||||
return __ssp_real_(fun) call; \
|
||||
}
|
||||
|
||||
#define __ssp_bos_wicheck3(fun) \
|
||||
__ssp_redirect_wc(wchar_t *, fun, \
|
||||
(wchar_t *__buf, const wchar_t *__src, size_t __wlen), \
|
||||
(__buf, __src, __wlen), 1, __ssp_bos0)
|
||||
|
||||
#define __ssp_bos_wicheck3_restrict(fun) \
|
||||
__ssp_redirect_wc(wchar_t *, fun, \
|
||||
(wchar_t *__restrict __buf, const wchar_t *__restrict __src, size_t __wlen), \
|
||||
(__buf, __src, __wlen), 1, __ssp_bos0)
|
||||
|
||||
#define __ssp_bos_wicheck2_restrict(fun) \
|
||||
__ssp_decl(wchar_t *, fun, (wchar_t *__restrict __buf, const wchar_t *__restrict __src)) \
|
||||
{ \
|
||||
__ssp_check(__buf, (wcslen(__src) + 1) * sizeof(wchar_t), __ssp_bos0); \
|
||||
return __ssp_real_(fun) (__buf, __src); \
|
||||
}
|
||||
|
||||
__BEGIN_DECLS
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
__ssp_bos_wicheck2_restrict(wcpcpy)
|
||||
__ssp_bos_wicheck3_restrict(wcpncpy)
|
||||
#endif
|
||||
__ssp_bos_wicheck2_restrict(wcscpy)
|
||||
__ssp_bos_wicheck2_restrict(wcscat)
|
||||
__ssp_bos_wicheck3_restrict(wcsncpy)
|
||||
__ssp_bos_wicheck3_restrict(wcsncat)
|
||||
__ssp_bos_wicheck3_restrict(wmemcpy)
|
||||
__ssp_bos_wicheck3(wmemmove)
|
||||
#if __GNU_VISIBLE
|
||||
__ssp_bos_wicheck3_restrict(wmempcpy)
|
||||
#endif
|
||||
__ssp_redirect_wc(wchar_t *, wmemset, \
|
||||
(wchar_t *__buf, wchar_t __src, size_t __wlen), \
|
||||
(__buf, __src, __wlen), 1, __ssp_bos0)
|
||||
|
||||
__ssp_decl(size_t, wcrtomb, (char *__buf, wchar_t __src, mbstate_t *__ps))
|
||||
{
|
||||
if (__buf != NULL && __src != L'\0')
|
||||
__ssp_check(__buf, sizeof(wchar_t), __ssp_bos);
|
||||
return __ssp_real_wcrtomb (__buf, __src, __ps);
|
||||
}
|
||||
|
||||
__ssp_redirect_wc(size_t, mbsrtowcs, \
|
||||
(wchar_t *__buf, const char **__src, size_t __wlen, mbstate_t *__ps), \
|
||||
(__buf, __src, __wlen, __ps), __buf != NULL, __ssp_bos)
|
||||
|
||||
__ssp_redirect_raw(size_t, wcsrtombs, \
|
||||
(char *__buf, const wchar_t **__src, size_t __len, mbstate_t *__ps), \
|
||||
(__buf, __src, __len, __ps), __buf != NULL, __ssp_bos)
|
||||
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
__ssp_redirect_wc(size_t, mbsnrtowcs, \
|
||||
(wchar_t *__buf, const char **__src, size_t __nms, size_t __wlen, mbstate_t *__ps), \
|
||||
(__buf, __src, __nms, __wlen, __ps), __buf != NULL, __ssp_bos)
|
||||
|
||||
__ssp_redirect_raw(size_t, wcsnrtombs, \
|
||||
(char *__buf, const wchar_t **__src, size_t __nwc, size_t __len, mbstate_t *__ps), \
|
||||
(__buf, __src, __nwc, __len, __ps), __buf != NULL, __ssp_bos)
|
||||
#endif
|
||||
|
||||
__ssp_decl(wchar_t *, fgetws, (wchar_t *__restrict __buf, int __wlen, __FILE *__restrict __fp))
|
||||
{
|
||||
if (__wlen > 0)
|
||||
__ssp_check(__buf, (size_t)__wlen * sizeof(wchar_t) , __ssp_bos);
|
||||
return __ssp_real_fgetws(__buf, __wlen, __fp);
|
||||
}
|
||||
|
||||
#if __GNU_VISIBLE
|
||||
__ssp_decl(wchar_t *, fgetws_unlocked, (wchar_t *__buf, int __wlen, __FILE *__fp))
|
||||
{
|
||||
if (__wlen > 0)
|
||||
__ssp_check(__buf, (size_t)__wlen * sizeof(wchar_t) , __ssp_bos);
|
||||
return __ssp_real_fgetws_unlocked(__buf, __wlen, __fp);
|
||||
}
|
||||
#endif /* __GNU_VISIBLE */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __SSP_FORTIFY_LEVEL > 0 */
|
||||
#endif /* _SSP_WCHAR_H_ */
|
||||
Reference in New Issue
Block a user