diff options
Diffstat (limited to '9/platforms/android-18/arch-x86/usr/include/sys')
5 files changed, 174 insertions, 13 deletions
diff --git a/9/platforms/android-18/arch-x86/usr/include/sys/_wchar_limits.h b/9/platforms/android-18/arch-x86/usr/include/sys/_wchar_limits.h new file mode 100644 index 0000000..644792f --- /dev/null +++ b/9/platforms/android-18/arch-x86/usr/include/sys/_wchar_limits.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 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 OWNER 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 _SYS__WCHAR_LIMITS_H +#define _SYS__WCHAR_LIMITS_H + +#include <android/api-level.h> + +/* WCHAR_MIN / WCHAR_MAX can be defined by <stdint.h> or <wchar.h>. + * Due to historical reasons, their definition is a bit complex. + * + * - In NDK r8e and older, all definitions of WCHAR_MIN and WCHAR_MAX + * where 32-bit signed values (with one exception described below), + * despite the fact that wchar_t is 'unsigned' on ARM. + * See http://b.android.com/57749 + * + * This is no longer the case, unless you define _WCHAR_IS_ALWAYS_SIGNED + * at compile time to restore the old (broken) behaviour. This doesn't + * affect other CPU ABIs. + * + * - Before API level 9, on ARM, wchar_t was typedef to 'char' when + * compiling C (not C++). Also, the definitions of WCHAR_MIN and + * WCHAR_MAX differed between <stdint.h> and <wchar.h>: + * + * <stdint.h> conditionally defined them to INT32_MIN / INT32_MAX. + * <wchar.h> conditionally defined them to 0 and 255 instead. + * + * <stdint.h> would only define WCHAR_MIN and WCHAR_MAX when: + * - Compiling C sources. + * - Compiling C++ sources with __STDC_LIMIT_MACROS being defined. + * + * <wchar.h> always ends up including <stdint.h> indirectly. This + * means that: + * + * - When compiling C sources, WCHAR_MIN / WCHAR_MAX were always + * defined as INT32_MIN / INT32_MAX. + * + * - When compiling C++ sources with __STDC_LIMIT_MACROS defined, + * they were always defined to INT32_MIN / INT32_MAX + * + * - When compiling C++ sources without __STDC_LIMIT_MACROS defined, + * they were defined by <wchar.h> as 0 and 255, respectively. + * + * Keep in mind that this was ARM-specific, only for API level < 9. + * + * If _WCHAR_IS_8BIT is defined, the same broken behaviour will + * be restored. See http://b.android.com/57267 + */ +#if !defined(WCHAR_MIN) + +# if defined(_WCHAR_IS_8BIT) && defined(__arm__) && __ANDROID_API__ < 9 +# if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS) +# define WCHAR_MIN 0 +# define WCHAR_MAX 255 +# else +# define WCHAR_MIN (-2147483647 - 1) +# define WCHAR_MAX (2147483647) +# endif +# elif defined(_WCHAR_IS_ALWAYS_SIGNED) +# define WCHAR_MIN (-2147483647 - 1) +# define WCHAR_MAX (2147483647) +# else + /* Otherwise, the value is derived from the toolchain configuration. + * to avoid putting explicit CPU checks in this header. */ +# ifndef __WCHAR_MAX__ +# error "__WCHAR_MAX__ is not defined. Check your toolchain!" +# endif + /* Clang does define __WCHAR_MAX__, but not __WCHAR_MIN__ */ +# ifndef __WCHAR_MIN__ +# if __WCHAR_MAX__ == 4294967295 +# define __WCHAR_MIN__ (0U) +# elif __WCHAR_MAX__ == 2147483647 +# define __WCHAR_MIN__ (-2147483647 - 1) +# else +# error "Invalid __WCHAR_MAX__ value. Check your toolchain!" +# endif +# endif /* !__WCHAR_MIN__ */ +# define WCHAR_MIN __WCHAR_MIN__ +# define WCHAR_MAX __WCHAR_MAX__ +# endif /* !_WCHAR_IS_ALWAYS_SIGNED */ + +#endif /* !WCHAR_MIN */ + +#endif /* _SYS__WCHAR_LIMITS_H */ diff --git a/9/platforms/android-18/arch-x86/usr/include/sys/cdefs.h b/9/platforms/android-18/arch-x86/usr/include/sys/cdefs.h index 92035d4..beb35c4 100644 --- a/9/platforms/android-18/arch-x86/usr/include/sys/cdefs.h +++ b/9/platforms/android-18/arch-x86/usr/include/sys/cdefs.h @@ -499,4 +499,31 @@ #define __BIONIC__ 1 #include <android/api-level.h> +/* __NDK_FPABI__ or __NDK_FPABI_MATH__ are applied to APIs taking or returning float or + [long] double, to ensure even at the presence of -mhard-float (which implies + -mfloat-abi=hard), calling to 32-bit Android native APIs still follow -mfloat-abi=softfp. + + __NDK_FPABI_MATH__ is applied to APIs in math.h. It normally equals to __NDK_FPABI__, + but allows use of customized libm.a compiled with -mhard-float by -D_NDK_MATH_NO_SOFTFP=1 + + NOTE: Disable for clang for now unless _NDK_MATH_NO_SOFTFP=1, because clang before 3.4 doesn't + allow change of calling convension for builtin and produces error message reads: + + a.i:564:6: error: function declared 'aapcs' here was previously declared without calling convention + int sin(double d) __attribute__((pcs("aapcs"))); + ^ + a.i:564:6: note: previous declaration is here + */ +#if defined(__ANDROID__) && !__LP64__ && defined( __arm__) +#define __NDK_FPABI__ __attribute__((pcs("aapcs"))) +#else +#define __NDK_FPABI__ +#endif + +#if (!defined(_NDK_MATH_NO_SOFTFP) || _NDK_MATH_NO_SOFTFP != 1) && !defined(__clang__) +#define __NDK_FPABI_MATH__ __NDK_FPABI__ +#else +#define __NDK_FPABI_MATH__ /* nothing */ +#endif + #endif /* !_SYS_CDEFS_H_ */ diff --git a/9/platforms/android-18/arch-x86/usr/include/sys/cdefs_elf.h b/9/platforms/android-18/arch-x86/usr/include/sys/cdefs_elf.h index 1e57470..5d2e0f3 100644 --- a/9/platforms/android-18/arch-x86/usr/include/sys/cdefs_elf.h +++ b/9/platforms/android-18/arch-x86/usr/include/sys/cdefs_elf.h @@ -32,7 +32,7 @@ #ifdef __LEADING_UNDERSCORE #define _C_LABEL(x) __CONCAT(_,x) -#define _C_LABEL_STRING(x) "_"x +#define _C_LABEL_STRING(x) "_" x #else #define _C_LABEL(x) x #define _C_LABEL_STRING(x) x diff --git a/9/platforms/android-18/arch-x86/usr/include/sys/stat.h b/9/platforms/android-18/arch-x86/usr/include/sys/stat.h index 091ee6d..497f404 100644 --- a/9/platforms/android-18/arch-x86/usr/include/sys/stat.h +++ b/9/platforms/android-18/arch-x86/usr/include/sys/stat.h @@ -103,6 +103,10 @@ extern int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int f extern int fchmodat(int dirfd, const char *path, mode_t mode, int flags); extern int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +extern int utimensat(int fd, const char *path, const struct timespec times[2], int flags); + __END_DECLS #endif /* _SYS_STAT_H_ */ diff --git a/9/platforms/android-18/arch-x86/usr/include/sys/vfs.h b/9/platforms/android-18/arch-x86/usr/include/sys/vfs.h index 4adaf5f..4ec0e0d 100644 --- a/9/platforms/android-18/arch-x86/usr/include/sys/vfs.h +++ b/9/platforms/android-18/arch-x86/usr/include/sys/vfs.h @@ -34,20 +34,42 @@ __BEGIN_DECLS -/* note: this corresponds to the kernel's statfs64 type */ +/* The kernel's __kernel_fsid_t has a 'val' member but glibc uses '__val'. */ +typedef struct { int __val[2]; } __fsid_t; + +/* Our struct statfs corresponds to the kernel's statfs64 type. */ +#ifdef __mips__ +struct statfs { + uint32_t f_type; + uint32_t f_bsize; + uint32_t f_frsize; + uint32_t __pad; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_files; + uint64_t f_ffree; + uint64_t f_bavail; + __fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_flags; + uint32_t f_spare[5]; +}; +#else struct statfs { - uint32_t f_type; - uint32_t f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - __kernel_fsid_t f_fsid; - uint32_t f_namelen; - uint32_t f_frsize; - uint32_t f_spare[5]; + uint32_t f_type; + uint32_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + __fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_frsize; + uint32_t f_flags; + uint32_t f_spare[4]; }; +#endif #define ADFS_SUPER_MAGIC 0xadf5 #define AFFS_SUPER_MAGIC 0xADFF |