diff options
89 files changed, 2344 insertions, 84 deletions
diff --git a/build/platforms/android-3/arch-arm/usr/include/arpa/inet.h b/build/platforms/android-3/arch-arm/usr/include/arpa/inet.h index 3ebb872ec..e78e7c5b7 100644 --- a/build/platforms/android-3/arch-arm/usr/include/arpa/inet.h +++ b/build/platforms/android-3/arch-arm/usr/include/arpa/inet.h @@ -31,7 +31,6 @@ #include <stdint.h> #include <sys/types.h> #include <netinet/in.h> -#include <netinet/in6.h> __BEGIN_DECLS diff --git a/build/platforms/android-3/arch-arm/usr/include/ctype.h b/build/platforms/android-3/arch-arm/usr/include/ctype.h index b5f9ff4f8..58b76eae6 100644 --- a/build/platforms/android-3/arch-arm/usr/include/ctype.h +++ b/build/platforms/android-3/arch-arm/usr/include/ctype.h @@ -59,7 +59,11 @@ extern const short *_toupper_tab_; /* extern __inline is a GNU C extension */ #ifdef __GNUC__ +# if defined(__GNUC_STDC_INLINE__) +#define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__)) +# else #define __CTYPE_INLINE extern __inline +# endif #else #define __CTYPE_INLINE static __inline #endif diff --git a/build/platforms/android-3/arch-arm/usr/include/mntent.h b/build/platforms/android-3/arch-arm/usr/include/mntent.h index 468ff742e..b83da1f2f 100644 --- a/build/platforms/android-3/arch-arm/usr/include/mntent.h +++ b/build/platforms/android-3/arch-arm/usr/include/mntent.h @@ -28,6 +28,7 @@ #ifndef _MNTENT_H_ #define _MNTENT_H_ +#include <stdio.h> #define MNTTYPE_IGNORE "ignore" diff --git a/build/platforms/android-3/arch-arm/usr/include/netdb.h b/build/platforms/android-3/arch-arm/usr/include/netdb.h index b0c3b7275..c2e08ea87 100644 --- a/build/platforms/android-3/arch-arm/usr/include/netdb.h +++ b/build/platforms/android-3/arch-arm/usr/include/netdb.h @@ -75,10 +75,6 @@ #define MAXHOSTNAMELEN 256 -/* BIONIC-BEGIN */ -#define h_errno (*__get_h_errno()) -extern int* __get_h_errno(void); -/* BIONIC-END */ /* * Structures returned by network data base library. All addresses are @@ -203,6 +199,10 @@ struct addrinfo { #define SCOPE_DELIMITER '%' __BEGIN_DECLS +/* BIONIC-BEGIN */ +#define h_errno (*__get_h_errno()) +int* __get_h_errno(void); +/* BIONIC-END */ void endhostent(void); void endnetent(void); void endnetgrent(void); diff --git a/build/platforms/android-3/arch-arm/usr/include/netinet/in.h b/build/platforms/android-3/arch-arm/usr/include/netinet/in.h index 77ae50654..0ebd926fe 100644 --- a/build/platforms/android-3/arch-arm/usr/include/netinet/in.h +++ b/build/platforms/android-3/arch-arm/usr/include/netinet/in.h @@ -32,6 +32,7 @@ #include <linux/socket.h> #include <linux/in.h> #include <linux/in6.h> +#include <netinet/in6.h> __BEGIN_DECLS @@ -39,6 +40,9 @@ __BEGIN_DECLS extern int bindresvport (int sd, struct sockaddr_in *sin); +static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +static const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; + __END_DECLS #endif /* _NETINET_IN_H_ */ diff --git a/build/platforms/android-3/arch-arm/usr/include/netinet/in6.h b/build/platforms/android-3/arch-arm/usr/include/netinet/in6.h index e645c4877..2f5fee116 100644 --- a/build/platforms/android-3/arch-arm/usr/include/netinet/in6.h +++ b/build/platforms/android-3/arch-arm/usr/include/netinet/in6.h @@ -90,4 +90,12 @@ #define INET6_ADDRSTRLEN 46 +#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP +#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP + +#define IN6ADDR_ANY_INIT {{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}} + +#define ipv6mr_interface ipv6mr_ifindex + + #endif /* _NETINET_IN6_H */ diff --git a/build/platforms/android-3/arch-arm/usr/include/stdio.h b/build/platforms/android-3/arch-arm/usr/include/stdio.h index 79e526b7c..791b26083 100644 --- a/build/platforms/android-3/arch-arm/usr/include/stdio.h +++ b/build/platforms/android-3/arch-arm/usr/include/stdio.h @@ -112,6 +112,9 @@ struct __sbuf { * that does not match the previous one in _bf. When this happens, * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NOTE: if you change this structure, you also need to update the + * std() initializer in findfp.c. */ typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ diff --git a/build/platforms/android-3/arch-arm/usr/include/sys/epoll.h b/build/platforms/android-3/arch-arm/usr/include/sys/epoll.h index 1478caa6c..decdb4649 100644 --- a/build/platforms/android-3/arch-arm/usr/include/sys/epoll.h +++ b/build/platforms/android-3/arch-arm/usr/include/sys/epoll.h @@ -28,6 +28,10 @@ #ifndef _SYS_EPOLL_H_ #define _SYS_EPOLL_H_ +#include <sys/cdefs.h> + +__BEGIN_DECLS + #define EPOLLIN 0x00000001 #define EPOLLPRI 0x00000002 #define EPOLLOUT 0x00000004 @@ -62,5 +66,7 @@ int epoll_create(int size); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); +__END_DECLS + #endif /* _SYS_EPOLL_H_ */ diff --git a/build/platforms/android-3/arch-arm/usr/include/sys/resource.h b/build/platforms/android-3/arch-arm/usr/include/sys/resource.h index a7de6f0ac..ef325c7aa 100644 --- a/build/platforms/android-3/arch-arm/usr/include/sys/resource.h +++ b/build/platforms/android-3/arch-arm/usr/include/sys/resource.h @@ -40,6 +40,8 @@ #include <linux/resource.h> #undef getrusage +typedef unsigned long rlim_t; + __BEGIN_DECLS extern int getpriority(int, int); diff --git a/build/platforms/android-3/arch-arm/usr/include/sys/system_properties.h b/build/platforms/android-3/arch-arm/usr/include/sys/system_properties.h index 2eb00cdc0..4fdc9447f 100644 --- a/build/platforms/android-3/arch-arm/usr/include/sys/system_properties.h +++ b/build/platforms/android-3/arch-arm/usr/include/sys/system_properties.h @@ -29,6 +29,10 @@ #ifndef _INCLUDE_SYS_SYSTEM_PROPERTIES_H #define _INCLUDE_SYS_SYSTEM_PROPERTIES_H +#include <sys/cdefs.h> + +__BEGIN_DECLS + typedef struct prop_info prop_info; #define PROP_NAME_MAX 32 @@ -76,4 +80,6 @@ int __system_property_read(const prop_info *pi, char *name, char *value); */ const prop_info *__system_property_find_nth(unsigned n); +__END_DECLS + #endif diff --git a/build/platforms/android-3/arch-arm/usr/include/time64.h b/build/platforms/android-3/arch-arm/usr/include/time64.h index 9da4bc702..7ec05af65 100644 --- a/build/platforms/android-3/arch-arm/usr/include/time64.h +++ b/build/platforms/android-3/arch-arm/usr/include/time64.h @@ -31,9 +31,12 @@ Modified for Bionic by the Android Open Source Project #ifndef TIME64_H #define TIME64_H +#include <sys/cdefs.h> #include <time.h> #include <stdint.h> +__BEGIN_DECLS + typedef int64_t time64_t; struct tm *gmtime64_r (const time64_t *, struct tm *); @@ -51,4 +54,6 @@ time64_t timegm64 (const struct tm *); time64_t mktime64 (const struct tm *); time64_t timelocal64 (const struct tm *); +__END_DECLS + #endif /* TIME64_H */ diff --git a/build/platforms/android-4/arch-arm/usr/include/arpa/inet.h b/build/platforms/android-4/arch-arm/usr/include/arpa/inet.h index 3ebb872ec..e78e7c5b7 100644 --- a/build/platforms/android-4/arch-arm/usr/include/arpa/inet.h +++ b/build/platforms/android-4/arch-arm/usr/include/arpa/inet.h @@ -31,7 +31,6 @@ #include <stdint.h> #include <sys/types.h> #include <netinet/in.h> -#include <netinet/in6.h> __BEGIN_DECLS diff --git a/build/platforms/android-4/arch-arm/usr/include/ctype.h b/build/platforms/android-4/arch-arm/usr/include/ctype.h index b5f9ff4f8..58b76eae6 100644 --- a/build/platforms/android-4/arch-arm/usr/include/ctype.h +++ b/build/platforms/android-4/arch-arm/usr/include/ctype.h @@ -59,7 +59,11 @@ extern const short *_toupper_tab_; /* extern __inline is a GNU C extension */ #ifdef __GNUC__ +# if defined(__GNUC_STDC_INLINE__) +#define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__)) +# else #define __CTYPE_INLINE extern __inline +# endif #else #define __CTYPE_INLINE static __inline #endif diff --git a/build/platforms/android-4/arch-arm/usr/include/mntent.h b/build/platforms/android-4/arch-arm/usr/include/mntent.h index 468ff742e..b83da1f2f 100644 --- a/build/platforms/android-4/arch-arm/usr/include/mntent.h +++ b/build/platforms/android-4/arch-arm/usr/include/mntent.h @@ -28,6 +28,7 @@ #ifndef _MNTENT_H_ #define _MNTENT_H_ +#include <stdio.h> #define MNTTYPE_IGNORE "ignore" diff --git a/build/platforms/android-4/arch-arm/usr/include/netdb.h b/build/platforms/android-4/arch-arm/usr/include/netdb.h index b0c3b7275..c2e08ea87 100644 --- a/build/platforms/android-4/arch-arm/usr/include/netdb.h +++ b/build/platforms/android-4/arch-arm/usr/include/netdb.h @@ -75,10 +75,6 @@ #define MAXHOSTNAMELEN 256 -/* BIONIC-BEGIN */ -#define h_errno (*__get_h_errno()) -extern int* __get_h_errno(void); -/* BIONIC-END */ /* * Structures returned by network data base library. All addresses are @@ -203,6 +199,10 @@ struct addrinfo { #define SCOPE_DELIMITER '%' __BEGIN_DECLS +/* BIONIC-BEGIN */ +#define h_errno (*__get_h_errno()) +int* __get_h_errno(void); +/* BIONIC-END */ void endhostent(void); void endnetent(void); void endnetgrent(void); diff --git a/build/platforms/android-4/arch-arm/usr/include/netinet/in.h b/build/platforms/android-4/arch-arm/usr/include/netinet/in.h index 77ae50654..0ebd926fe 100644 --- a/build/platforms/android-4/arch-arm/usr/include/netinet/in.h +++ b/build/platforms/android-4/arch-arm/usr/include/netinet/in.h @@ -32,6 +32,7 @@ #include <linux/socket.h> #include <linux/in.h> #include <linux/in6.h> +#include <netinet/in6.h> __BEGIN_DECLS @@ -39,6 +40,9 @@ __BEGIN_DECLS extern int bindresvport (int sd, struct sockaddr_in *sin); +static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +static const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; + __END_DECLS #endif /* _NETINET_IN_H_ */ diff --git a/build/platforms/android-4/arch-arm/usr/include/netinet/in6.h b/build/platforms/android-4/arch-arm/usr/include/netinet/in6.h index e645c4877..2f5fee116 100644 --- a/build/platforms/android-4/arch-arm/usr/include/netinet/in6.h +++ b/build/platforms/android-4/arch-arm/usr/include/netinet/in6.h @@ -90,4 +90,12 @@ #define INET6_ADDRSTRLEN 46 +#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP +#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP + +#define IN6ADDR_ANY_INIT {{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}} + +#define ipv6mr_interface ipv6mr_ifindex + + #endif /* _NETINET_IN6_H */ diff --git a/build/platforms/android-4/arch-arm/usr/include/stdio.h b/build/platforms/android-4/arch-arm/usr/include/stdio.h index 79e526b7c..791b26083 100644 --- a/build/platforms/android-4/arch-arm/usr/include/stdio.h +++ b/build/platforms/android-4/arch-arm/usr/include/stdio.h @@ -112,6 +112,9 @@ struct __sbuf { * that does not match the previous one in _bf. When this happens, * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NOTE: if you change this structure, you also need to update the + * std() initializer in findfp.c. */ typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ diff --git a/build/platforms/android-4/arch-arm/usr/include/sys/epoll.h b/build/platforms/android-4/arch-arm/usr/include/sys/epoll.h index 1478caa6c..decdb4649 100644 --- a/build/platforms/android-4/arch-arm/usr/include/sys/epoll.h +++ b/build/platforms/android-4/arch-arm/usr/include/sys/epoll.h @@ -28,6 +28,10 @@ #ifndef _SYS_EPOLL_H_ #define _SYS_EPOLL_H_ +#include <sys/cdefs.h> + +__BEGIN_DECLS + #define EPOLLIN 0x00000001 #define EPOLLPRI 0x00000002 #define EPOLLOUT 0x00000004 @@ -62,5 +66,7 @@ int epoll_create(int size); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); +__END_DECLS + #endif /* _SYS_EPOLL_H_ */ diff --git a/build/platforms/android-4/arch-arm/usr/include/sys/resource.h b/build/platforms/android-4/arch-arm/usr/include/sys/resource.h index a7de6f0ac..ef325c7aa 100644 --- a/build/platforms/android-4/arch-arm/usr/include/sys/resource.h +++ b/build/platforms/android-4/arch-arm/usr/include/sys/resource.h @@ -40,6 +40,8 @@ #include <linux/resource.h> #undef getrusage +typedef unsigned long rlim_t; + __BEGIN_DECLS extern int getpriority(int, int); diff --git a/build/platforms/android-4/arch-arm/usr/include/sys/system_properties.h b/build/platforms/android-4/arch-arm/usr/include/sys/system_properties.h index 2eb00cdc0..4fdc9447f 100644 --- a/build/platforms/android-4/arch-arm/usr/include/sys/system_properties.h +++ b/build/platforms/android-4/arch-arm/usr/include/sys/system_properties.h @@ -29,6 +29,10 @@ #ifndef _INCLUDE_SYS_SYSTEM_PROPERTIES_H #define _INCLUDE_SYS_SYSTEM_PROPERTIES_H +#include <sys/cdefs.h> + +__BEGIN_DECLS + typedef struct prop_info prop_info; #define PROP_NAME_MAX 32 @@ -76,4 +80,6 @@ int __system_property_read(const prop_info *pi, char *name, char *value); */ const prop_info *__system_property_find_nth(unsigned n); +__END_DECLS + #endif diff --git a/build/platforms/android-4/arch-arm/usr/include/time64.h b/build/platforms/android-4/arch-arm/usr/include/time64.h index 9da4bc702..7ec05af65 100644 --- a/build/platforms/android-4/arch-arm/usr/include/time64.h +++ b/build/platforms/android-4/arch-arm/usr/include/time64.h @@ -31,9 +31,12 @@ Modified for Bionic by the Android Open Source Project #ifndef TIME64_H #define TIME64_H +#include <sys/cdefs.h> #include <time.h> #include <stdint.h> +__BEGIN_DECLS + typedef int64_t time64_t; struct tm *gmtime64_r (const time64_t *, struct tm *); @@ -51,4 +54,6 @@ time64_t timegm64 (const struct tm *); time64_t mktime64 (const struct tm *); time64_t timelocal64 (const struct tm *); +__END_DECLS + #endif /* TIME64_H */ diff --git a/build/platforms/android-5/arch-arm/usr/include/arpa/inet.h b/build/platforms/android-5/arch-arm/usr/include/arpa/inet.h index 3ebb872ec..e78e7c5b7 100644 --- a/build/platforms/android-5/arch-arm/usr/include/arpa/inet.h +++ b/build/platforms/android-5/arch-arm/usr/include/arpa/inet.h @@ -31,7 +31,6 @@ #include <stdint.h> #include <sys/types.h> #include <netinet/in.h> -#include <netinet/in6.h> __BEGIN_DECLS diff --git a/build/platforms/android-5/arch-arm/usr/include/ctype.h b/build/platforms/android-5/arch-arm/usr/include/ctype.h index b5f9ff4f8..58b76eae6 100644 --- a/build/platforms/android-5/arch-arm/usr/include/ctype.h +++ b/build/platforms/android-5/arch-arm/usr/include/ctype.h @@ -59,7 +59,11 @@ extern const short *_toupper_tab_; /* extern __inline is a GNU C extension */ #ifdef __GNUC__ +# if defined(__GNUC_STDC_INLINE__) +#define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__)) +# else #define __CTYPE_INLINE extern __inline +# endif #else #define __CTYPE_INLINE static __inline #endif diff --git a/build/platforms/android-5/arch-arm/usr/include/mntent.h b/build/platforms/android-5/arch-arm/usr/include/mntent.h index 468ff742e..b83da1f2f 100644 --- a/build/platforms/android-5/arch-arm/usr/include/mntent.h +++ b/build/platforms/android-5/arch-arm/usr/include/mntent.h @@ -28,6 +28,7 @@ #ifndef _MNTENT_H_ #define _MNTENT_H_ +#include <stdio.h> #define MNTTYPE_IGNORE "ignore" diff --git a/build/platforms/android-5/arch-arm/usr/include/netdb.h b/build/platforms/android-5/arch-arm/usr/include/netdb.h index b0c3b7275..c2e08ea87 100644 --- a/build/platforms/android-5/arch-arm/usr/include/netdb.h +++ b/build/platforms/android-5/arch-arm/usr/include/netdb.h @@ -75,10 +75,6 @@ #define MAXHOSTNAMELEN 256 -/* BIONIC-BEGIN */ -#define h_errno (*__get_h_errno()) -extern int* __get_h_errno(void); -/* BIONIC-END */ /* * Structures returned by network data base library. All addresses are @@ -203,6 +199,10 @@ struct addrinfo { #define SCOPE_DELIMITER '%' __BEGIN_DECLS +/* BIONIC-BEGIN */ +#define h_errno (*__get_h_errno()) +int* __get_h_errno(void); +/* BIONIC-END */ void endhostent(void); void endnetent(void); void endnetgrent(void); diff --git a/build/platforms/android-5/arch-arm/usr/include/netinet/in.h b/build/platforms/android-5/arch-arm/usr/include/netinet/in.h index 77ae50654..0ebd926fe 100644 --- a/build/platforms/android-5/arch-arm/usr/include/netinet/in.h +++ b/build/platforms/android-5/arch-arm/usr/include/netinet/in.h @@ -32,6 +32,7 @@ #include <linux/socket.h> #include <linux/in.h> #include <linux/in6.h> +#include <netinet/in6.h> __BEGIN_DECLS @@ -39,6 +40,9 @@ __BEGIN_DECLS extern int bindresvport (int sd, struct sockaddr_in *sin); +static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +static const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; + __END_DECLS #endif /* _NETINET_IN_H_ */ diff --git a/build/platforms/android-5/arch-arm/usr/include/netinet/in6.h b/build/platforms/android-5/arch-arm/usr/include/netinet/in6.h index e645c4877..2f5fee116 100644 --- a/build/platforms/android-5/arch-arm/usr/include/netinet/in6.h +++ b/build/platforms/android-5/arch-arm/usr/include/netinet/in6.h @@ -90,4 +90,12 @@ #define INET6_ADDRSTRLEN 46 +#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP +#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP + +#define IN6ADDR_ANY_INIT {{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}} + +#define ipv6mr_interface ipv6mr_ifindex + + #endif /* _NETINET_IN6_H */ diff --git a/build/platforms/android-5/arch-arm/usr/include/stdio.h b/build/platforms/android-5/arch-arm/usr/include/stdio.h index 79e526b7c..791b26083 100644 --- a/build/platforms/android-5/arch-arm/usr/include/stdio.h +++ b/build/platforms/android-5/arch-arm/usr/include/stdio.h @@ -112,6 +112,9 @@ struct __sbuf { * that does not match the previous one in _bf. When this happens, * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NOTE: if you change this structure, you also need to update the + * std() initializer in findfp.c. */ typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ diff --git a/build/platforms/android-5/arch-arm/usr/include/sys/epoll.h b/build/platforms/android-5/arch-arm/usr/include/sys/epoll.h index 1478caa6c..decdb4649 100644 --- a/build/platforms/android-5/arch-arm/usr/include/sys/epoll.h +++ b/build/platforms/android-5/arch-arm/usr/include/sys/epoll.h @@ -28,6 +28,10 @@ #ifndef _SYS_EPOLL_H_ #define _SYS_EPOLL_H_ +#include <sys/cdefs.h> + +__BEGIN_DECLS + #define EPOLLIN 0x00000001 #define EPOLLPRI 0x00000002 #define EPOLLOUT 0x00000004 @@ -62,5 +66,7 @@ int epoll_create(int size); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); +__END_DECLS + #endif /* _SYS_EPOLL_H_ */ diff --git a/build/platforms/android-5/arch-arm/usr/include/sys/resource.h b/build/platforms/android-5/arch-arm/usr/include/sys/resource.h index a7de6f0ac..ef325c7aa 100644 --- a/build/platforms/android-5/arch-arm/usr/include/sys/resource.h +++ b/build/platforms/android-5/arch-arm/usr/include/sys/resource.h @@ -40,6 +40,8 @@ #include <linux/resource.h> #undef getrusage +typedef unsigned long rlim_t; + __BEGIN_DECLS extern int getpriority(int, int); diff --git a/build/platforms/android-5/arch-arm/usr/include/sys/system_properties.h b/build/platforms/android-5/arch-arm/usr/include/sys/system_properties.h index 2eb00cdc0..4fdc9447f 100644 --- a/build/platforms/android-5/arch-arm/usr/include/sys/system_properties.h +++ b/build/platforms/android-5/arch-arm/usr/include/sys/system_properties.h @@ -29,6 +29,10 @@ #ifndef _INCLUDE_SYS_SYSTEM_PROPERTIES_H #define _INCLUDE_SYS_SYSTEM_PROPERTIES_H +#include <sys/cdefs.h> + +__BEGIN_DECLS + typedef struct prop_info prop_info; #define PROP_NAME_MAX 32 @@ -76,4 +80,6 @@ int __system_property_read(const prop_info *pi, char *name, char *value); */ const prop_info *__system_property_find_nth(unsigned n); +__END_DECLS + #endif diff --git a/build/platforms/android-5/arch-arm/usr/include/time64.h b/build/platforms/android-5/arch-arm/usr/include/time64.h index 9da4bc702..7ec05af65 100644 --- a/build/platforms/android-5/arch-arm/usr/include/time64.h +++ b/build/platforms/android-5/arch-arm/usr/include/time64.h @@ -31,9 +31,12 @@ Modified for Bionic by the Android Open Source Project #ifndef TIME64_H #define TIME64_H +#include <sys/cdefs.h> #include <time.h> #include <stdint.h> +__BEGIN_DECLS + typedef int64_t time64_t; struct tm *gmtime64_r (const time64_t *, struct tm *); @@ -51,4 +54,6 @@ time64_t timegm64 (const struct tm *); time64_t mktime64 (const struct tm *); time64_t timelocal64 (const struct tm *); +__END_DECLS + #endif /* TIME64_H */ diff --git a/build/platforms/android-5/arch-x86/usr/include/mntent.h b/build/platforms/android-5/arch-x86/usr/include/mntent.h index 468ff742e..b83da1f2f 100644 --- a/build/platforms/android-5/arch-x86/usr/include/mntent.h +++ b/build/platforms/android-5/arch-x86/usr/include/mntent.h @@ -28,6 +28,7 @@ #ifndef _MNTENT_H_ #define _MNTENT_H_ +#include <stdio.h> #define MNTTYPE_IGNORE "ignore" diff --git a/build/platforms/android-5/arch-x86/usr/include/netdb.h b/build/platforms/android-5/arch-x86/usr/include/netdb.h index b0c3b7275..c2e08ea87 100644 --- a/build/platforms/android-5/arch-x86/usr/include/netdb.h +++ b/build/platforms/android-5/arch-x86/usr/include/netdb.h @@ -75,10 +75,6 @@ #define MAXHOSTNAMELEN 256 -/* BIONIC-BEGIN */ -#define h_errno (*__get_h_errno()) -extern int* __get_h_errno(void); -/* BIONIC-END */ /* * Structures returned by network data base library. All addresses are @@ -203,6 +199,10 @@ struct addrinfo { #define SCOPE_DELIMITER '%' __BEGIN_DECLS +/* BIONIC-BEGIN */ +#define h_errno (*__get_h_errno()) +int* __get_h_errno(void); +/* BIONIC-END */ void endhostent(void); void endnetent(void); void endnetgrent(void); diff --git a/build/platforms/android-5/arch-x86/usr/include/stdint.h b/build/platforms/android-5/arch-x86/usr/include/stdint.h index 39a8ab8dd..237baa24c 100644 --- a/build/platforms/android-5/arch-x86/usr/include/stdint.h +++ b/build/platforms/android-5/arch-x86/usr/include/stdint.h @@ -46,13 +46,17 @@ # define __STDINT_MACROS #endif +#if !defined __STRICT_ANSI__ || __STDC_VERSION__ >= 199901L +# define __STDC_INT64__ +#endif + typedef __int8_t int8_t; typedef __uint8_t uint8_t; typedef __int16_t int16_t; typedef __uint16_t uint16_t; typedef __int32_t int32_t; typedef __uint32_t uint32_t; -#if !defined(__STRICT_ANSI__) +#if defined(__STDC_INT64__) typedef __int64_t int64_t; typedef __uint64_t uint64_t; #endif @@ -157,7 +161,7 @@ typedef uint32_t uint_fast32_t; # define UINT_FAST32_C(c) UINT32_C(c) #endif -#if !defined(__STRICT_ANSI__) +#if defined(__STDC_INT64__) /* * int64_t */ @@ -198,7 +202,7 @@ typedef uint64_t uint_fast64_t; # define __PRIFAST_RANK "" # define __PRIPTR_RANK "" -#endif /* !__STRICT_ANSI__ */ +#endif /* __STDC_INT64__ */ /* * intptr_t & uintptr_t @@ -221,7 +225,7 @@ typedef unsigned int uintptr_t; * intmax_t & uintmax_t */ -#if !defined(__STRICT_ANSI__) +#if defined(__STDC_INT64__) typedef uint64_t uintmax_t; typedef int64_t intmax_t; @@ -233,7 +237,7 @@ typedef int64_t intmax_t; #define INTMAX_C(c) INT64_C(c) #define UINTMAX_C(c) UINT64_C(c) -#else /* __STRICT_ANSI__ */ +#else /* !__STDC_INT64__ */ typedef uint32_t uintmax_t; typedef int32_t intmax_t; @@ -245,7 +249,7 @@ typedef int32_t intmax_t; #define INTMAX_C(c) INT32_C(c) #define UINTMAX_C(c) UINT32_C(c) -#endif /* __STRICT_ANSI__ */ +#endif /* !__STDC_INT64__ */ /* size_t is defined by the GCC-specific <stddef.h> */ diff --git a/build/platforms/android-5/arch-x86/usr/include/stdio.h b/build/platforms/android-5/arch-x86/usr/include/stdio.h index 79e526b7c..791b26083 100644 --- a/build/platforms/android-5/arch-x86/usr/include/stdio.h +++ b/build/platforms/android-5/arch-x86/usr/include/stdio.h @@ -112,6 +112,9 @@ struct __sbuf { * that does not match the previous one in _bf. When this happens, * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NOTE: if you change this structure, you also need to update the + * std() initializer in findfp.c. */ typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ diff --git a/build/platforms/android-5/arch-x86/usr/include/strings.h b/build/platforms/android-5/arch-x86/usr/include/strings.h index 1f73e21a2..fee7dc4f7 100644 --- a/build/platforms/android-5/arch-x86/usr/include/strings.h +++ b/build/platforms/android-5/arch-x86/usr/include/strings.h @@ -39,6 +39,7 @@ #ifndef _STRINGS_H_ #define _STRINGS_H_ +#include <sys/types.h> #include <sys/cdefs.h> __BEGIN_DECLS diff --git a/build/platforms/android-5/arch-x86/usr/include/sys/epoll.h b/build/platforms/android-5/arch-x86/usr/include/sys/epoll.h index 1478caa6c..decdb4649 100644 --- a/build/platforms/android-5/arch-x86/usr/include/sys/epoll.h +++ b/build/platforms/android-5/arch-x86/usr/include/sys/epoll.h @@ -28,6 +28,10 @@ #ifndef _SYS_EPOLL_H_ #define _SYS_EPOLL_H_ +#include <sys/cdefs.h> + +__BEGIN_DECLS + #define EPOLLIN 0x00000001 #define EPOLLPRI 0x00000002 #define EPOLLOUT 0x00000004 @@ -62,5 +66,7 @@ int epoll_create(int size); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); +__END_DECLS + #endif /* _SYS_EPOLL_H_ */ diff --git a/build/platforms/android-5/arch-x86/usr/include/sys/resource.h b/build/platforms/android-5/arch-x86/usr/include/sys/resource.h index a7de6f0ac..ef325c7aa 100644 --- a/build/platforms/android-5/arch-x86/usr/include/sys/resource.h +++ b/build/platforms/android-5/arch-x86/usr/include/sys/resource.h @@ -40,6 +40,8 @@ #include <linux/resource.h> #undef getrusage +typedef unsigned long rlim_t; + __BEGIN_DECLS extern int getpriority(int, int); diff --git a/build/platforms/android-5/arch-x86/usr/include/sys/system_properties.h b/build/platforms/android-5/arch-x86/usr/include/sys/system_properties.h index 2eb00cdc0..4fdc9447f 100644 --- a/build/platforms/android-5/arch-x86/usr/include/sys/system_properties.h +++ b/build/platforms/android-5/arch-x86/usr/include/sys/system_properties.h @@ -29,6 +29,10 @@ #ifndef _INCLUDE_SYS_SYSTEM_PROPERTIES_H #define _INCLUDE_SYS_SYSTEM_PROPERTIES_H +#include <sys/cdefs.h> + +__BEGIN_DECLS + typedef struct prop_info prop_info; #define PROP_NAME_MAX 32 @@ -76,4 +80,6 @@ int __system_property_read(const prop_info *pi, char *name, char *value); */ const prop_info *__system_property_find_nth(unsigned n); +__END_DECLS + #endif diff --git a/build/platforms/android-5/arch-x86/usr/include/time.h b/build/platforms/android-5/arch-x86/usr/include/time.h index 5d1a0e268..6163c6d5f 100644 --- a/build/platforms/android-5/arch-x86/usr/include/time.h +++ b/build/platforms/android-5/arch-x86/usr/include/time.h @@ -79,24 +79,6 @@ extern struct tm* gmtime_r(const time_t *timep, struct tm *result); extern char* strptime(const char *buf, const char *fmt, struct tm *tm); extern size_t strftime(char *s, size_t max, const char *format, const struct tm *tm); -/* ANDROID-BEGIN */ -struct strftime_locale { - const char * mon[12]; - const char * month[12]; - const char * standalone_month[12]; - const char * wday[7]; - const char * weekday[7]; - const char * X_fmt; - const char * x_fmt; - const char * c_fmt; - const char * am; - const char * pm; - const char * date_fmt; -}; - -extern size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale* lc); -/* ANDROID-END */ - extern char *ctime(const time_t *timep); extern char *ctime_r(const time_t *timep, char *buf); diff --git a/build/platforms/android-5/arch-x86/usr/include/time64.h b/build/platforms/android-5/arch-x86/usr/include/time64.h index 9da4bc702..7ec05af65 100644 --- a/build/platforms/android-5/arch-x86/usr/include/time64.h +++ b/build/platforms/android-5/arch-x86/usr/include/time64.h @@ -31,9 +31,12 @@ Modified for Bionic by the Android Open Source Project #ifndef TIME64_H #define TIME64_H +#include <sys/cdefs.h> #include <time.h> #include <stdint.h> +__BEGIN_DECLS + typedef int64_t time64_t; struct tm *gmtime64_r (const time64_t *, struct tm *); @@ -51,4 +54,6 @@ time64_t timegm64 (const struct tm *); time64_t mktime64 (const struct tm *); time64_t timelocal64 (const struct tm *); +__END_DECLS + #endif /* TIME64_H */ diff --git a/build/platforms/android-8/arch-arm/usr/include/arpa/inet.h b/build/platforms/android-8/arch-arm/usr/include/arpa/inet.h index 3ebb872ec..e78e7c5b7 100644 --- a/build/platforms/android-8/arch-arm/usr/include/arpa/inet.h +++ b/build/platforms/android-8/arch-arm/usr/include/arpa/inet.h @@ -31,7 +31,6 @@ #include <stdint.h> #include <sys/types.h> #include <netinet/in.h> -#include <netinet/in6.h> __BEGIN_DECLS diff --git a/build/platforms/android-8/arch-arm/usr/include/ctype.h b/build/platforms/android-8/arch-arm/usr/include/ctype.h index b5f9ff4f8..58b76eae6 100644 --- a/build/platforms/android-8/arch-arm/usr/include/ctype.h +++ b/build/platforms/android-8/arch-arm/usr/include/ctype.h @@ -59,7 +59,11 @@ extern const short *_toupper_tab_; /* extern __inline is a GNU C extension */ #ifdef __GNUC__ +# if defined(__GNUC_STDC_INLINE__) +#define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__)) +# else #define __CTYPE_INLINE extern __inline +# endif #else #define __CTYPE_INLINE static __inline #endif diff --git a/build/platforms/android-8/arch-arm/usr/include/dlfcn.h b/build/platforms/android-8/arch-arm/usr/include/dlfcn.h index 958279687..f84d1d183 100644 --- a/build/platforms/android-8/arch-arm/usr/include/dlfcn.h +++ b/build/platforms/android-8/arch-arm/usr/include/dlfcn.h @@ -32,10 +32,22 @@ __BEGIN_DECLS +typedef struct { + const char *dli_fname; /* Pathname of shared object that + contains address */ + void *dli_fbase; /* Address at which shared object + is loaded */ + const char *dli_sname; /* Name of nearest symbol with address + lower than addr */ + void *dli_saddr; /* Exact address of symbol named + in dli_sname */ +} Dl_info; + extern void* dlopen(const char* filename, int flag); extern int dlclose(void* handle); extern const char* dlerror(void); extern void* dlsym(void* handle, const char* symbol); +extern int dladdr(void* addr, Dl_info *info); enum { RTLD_NOW = 0, diff --git a/build/platforms/android-8/arch-arm/usr/include/err.h b/build/platforms/android-8/arch-arm/usr/include/err.h index e69de29bb..1636efe92 100644 --- a/build/platforms/android-8/arch-arm/usr/include/err.h +++ b/build/platforms/android-8/arch-arm/usr/include/err.h @@ -0,0 +1,90 @@ +/* $OpenBSD: err.h,v 1.10 2006/01/06 18:53:04 millert Exp $ */ +/* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)err.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _ERR_H_ +#define _ERR_H_ + +/* + * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two + * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one + * of them here we may collide with the utility's includes. It's unreasonable + * for utilities to have to include one of them to include err.h, so we get + * __va_list from <machine/_types.h> and use it. + */ +#include <sys/cdefs.h> +#include <machine/_types.h> + +__BEGIN_DECLS + +__noreturn void err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void verr(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +__noreturn void errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void verrx(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +void warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarn(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); +void warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarnx(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); + +/* + * The _* versions are for use in library functions so user-defined + * versions of err*,warn* do not get used. + */ +__noreturn void _err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void _verr(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +__noreturn void _errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void _verrx(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +void _warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void _vwarn(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); +void _warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void _vwarnx(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); + +__END_DECLS + +#endif /* !_ERR_H_ */ diff --git a/build/platforms/android-8/arch-arm/usr/include/fts.h b/build/platforms/android-8/arch-arm/usr/include/fts.h new file mode 100644 index 000000000..da26a8823 --- /dev/null +++ b/build/platforms/android-8/arch-arm/usr/include/fts.h @@ -0,0 +1,125 @@ +/* $OpenBSD: fts.h,v 1.12 2009/08/27 16:19:27 millert Exp $ */ +/* $NetBSD: fts.h,v 1.5 1994/12/28 01:41:50 mycroft Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)fts.h 8.3 (Berkeley) 8/14/94 + */ + +#ifndef _FTS_H_ +#define _FTS_H_ + +typedef struct { + struct _ftsent *fts_cur; /* current node */ + struct _ftsent *fts_child; /* linked list of children */ + struct _ftsent **fts_array; /* sort array */ + dev_t fts_dev; /* starting device # */ + char *fts_path; /* path for this descent */ + int fts_rfd; /* fd for root */ + size_t fts_pathlen; /* sizeof(path) */ + int fts_nitems; /* elements in the sort array */ + int (*fts_compar)(); /* compare function */ + +#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */ +#define FTS_LOGICAL 0x0002 /* logical walk */ +#define FTS_NOCHDIR 0x0004 /* don't change directories */ +#define FTS_NOSTAT 0x0008 /* don't get stat info */ +#define FTS_PHYSICAL 0x0010 /* physical walk */ +#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */ +#define FTS_XDEV 0x0040 /* don't cross devices */ +#define FTS_OPTIONMASK 0x00ff /* valid user option mask */ + +#define FTS_NAMEONLY 0x1000 /* (private) child names only */ +#define FTS_STOP 0x2000 /* (private) unrecoverable error */ + int fts_options; /* fts_open options, global flags */ +} FTS; + +typedef struct _ftsent { + struct _ftsent *fts_cycle; /* cycle node */ + struct _ftsent *fts_parent; /* parent directory */ + struct _ftsent *fts_link; /* next file in directory */ + long fts_number; /* local numeric value */ + void *fts_pointer; /* local address value */ + char *fts_accpath; /* access path */ + char *fts_path; /* root path */ + int fts_errno; /* errno for this node */ + int fts_symfd; /* fd for symlink */ + size_t fts_pathlen; /* strlen(fts_path) */ + size_t fts_namelen; /* strlen(fts_name) */ + + ino_t fts_ino; /* inode */ + dev_t fts_dev; /* device */ + nlink_t fts_nlink; /* link count */ + +#define FTS_ROOTPARENTLEVEL -1 +#define FTS_ROOTLEVEL 0 +#define FTS_MAXLEVEL 0x7fff + short fts_level; /* depth (-1 to N) */ + +#define FTS_D 1 /* preorder directory */ +#define FTS_DC 2 /* directory that causes cycles */ +#define FTS_DEFAULT 3 /* none of the above */ +#define FTS_DNR 4 /* unreadable directory */ +#define FTS_DOT 5 /* dot or dot-dot */ +#define FTS_DP 6 /* postorder directory */ +#define FTS_ERR 7 /* error; errno is set */ +#define FTS_F 8 /* regular file */ +#define FTS_INIT 9 /* initialized only */ +#define FTS_NS 10 /* stat(2) failed */ +#define FTS_NSOK 11 /* no stat(2) requested */ +#define FTS_SL 12 /* symbolic link */ +#define FTS_SLNONE 13 /* symbolic link without target */ + unsigned short fts_info; /* user flags for FTSENT structure */ + +#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ +#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ + unsigned short fts_flags; /* private flags for FTSENT structure */ + +#define FTS_AGAIN 1 /* read node again */ +#define FTS_FOLLOW 2 /* follow symbolic link */ +#define FTS_NOINSTR 3 /* no instructions */ +#define FTS_SKIP 4 /* discard node */ + unsigned short fts_instr; /* fts_set() instructions */ + + struct stat *fts_statp; /* stat(2) information */ + char fts_name[1]; /* file name */ +} FTSENT; + +#include <sys/cdefs.h> + +__BEGIN_DECLS +FTSENT *fts_children(FTS *, int); +int fts_close(FTS *); +FTS *fts_open(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)); +FTSENT *fts_read(FTS *); +int fts_set(FTS *, FTSENT *, int); +__END_DECLS + +#endif /* !_FTS_H_ */ diff --git a/build/platforms/android-8/arch-arm/usr/include/mntent.h b/build/platforms/android-8/arch-arm/usr/include/mntent.h index 468ff742e..b83da1f2f 100644 --- a/build/platforms/android-8/arch-arm/usr/include/mntent.h +++ b/build/platforms/android-8/arch-arm/usr/include/mntent.h @@ -28,6 +28,7 @@ #ifndef _MNTENT_H_ #define _MNTENT_H_ +#include <stdio.h> #define MNTTYPE_IGNORE "ignore" diff --git a/build/platforms/android-8/arch-arm/usr/include/netdb.h b/build/platforms/android-8/arch-arm/usr/include/netdb.h index b0c3b7275..c2e08ea87 100644 --- a/build/platforms/android-8/arch-arm/usr/include/netdb.h +++ b/build/platforms/android-8/arch-arm/usr/include/netdb.h @@ -75,10 +75,6 @@ #define MAXHOSTNAMELEN 256 -/* BIONIC-BEGIN */ -#define h_errno (*__get_h_errno()) -extern int* __get_h_errno(void); -/* BIONIC-END */ /* * Structures returned by network data base library. All addresses are @@ -203,6 +199,10 @@ struct addrinfo { #define SCOPE_DELIMITER '%' __BEGIN_DECLS +/* BIONIC-BEGIN */ +#define h_errno (*__get_h_errno()) +int* __get_h_errno(void); +/* BIONIC-END */ void endhostent(void); void endnetent(void); void endnetgrent(void); diff --git a/build/platforms/android-8/arch-arm/usr/include/netinet/in.h b/build/platforms/android-8/arch-arm/usr/include/netinet/in.h index 77ae50654..0ebd926fe 100644 --- a/build/platforms/android-8/arch-arm/usr/include/netinet/in.h +++ b/build/platforms/android-8/arch-arm/usr/include/netinet/in.h @@ -32,6 +32,7 @@ #include <linux/socket.h> #include <linux/in.h> #include <linux/in6.h> +#include <netinet/in6.h> __BEGIN_DECLS @@ -39,6 +40,9 @@ __BEGIN_DECLS extern int bindresvport (int sd, struct sockaddr_in *sin); +static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +static const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; + __END_DECLS #endif /* _NETINET_IN_H_ */ diff --git a/build/platforms/android-8/arch-arm/usr/include/netinet/in6.h b/build/platforms/android-8/arch-arm/usr/include/netinet/in6.h index e645c4877..2f5fee116 100644 --- a/build/platforms/android-8/arch-arm/usr/include/netinet/in6.h +++ b/build/platforms/android-8/arch-arm/usr/include/netinet/in6.h @@ -90,4 +90,12 @@ #define INET6_ADDRSTRLEN 46 +#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP +#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP + +#define IN6ADDR_ANY_INIT {{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}} + +#define ipv6mr_interface ipv6mr_ifindex + + #endif /* _NETINET_IN6_H */ diff --git a/build/platforms/android-8/arch-arm/usr/include/pthread.h b/build/platforms/android-8/arch-arm/usr/include/pthread.h index e3afdaede..eb2d16997 100644 --- a/build/platforms/android-8/arch-arm/usr/include/pthread.h +++ b/build/platforms/android-8/arch-arm/usr/include/pthread.h @@ -165,6 +165,11 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex); int pthread_mutex_trylock(pthread_mutex_t *mutex); int pthread_mutex_timedlock(pthread_mutex_t *mutex, struct timespec* ts); +int pthread_condattr_init(pthread_condattr_t *attr); +int pthread_condattr_getpshared(pthread_condattr_t *attr, int *pshared); +int pthread_condattr_setpshared(pthread_condattr_t* attr, int pshared); +int pthread_condattr_destroy(pthread_condattr_t *attr); + int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); int pthread_cond_destroy(pthread_cond_t *cond); @@ -179,14 +184,41 @@ int pthread_cond_timedwait(pthread_cond_t *cond, * to the CLOCK_MONOTONIC clock instead, to avoid any problems when * the wall-clock time is changed brutally */ +int pthread_cond_timedwait_monotonic_np(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const struct timespec *abstime); + +/* BIONIC: DEPRECATED. same as pthread_cond_timedwait_monotonic_np() + * unfortunately pthread_cond_timedwait_monotonic has shipped already + */ int pthread_cond_timedwait_monotonic(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime); +#define HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC 1 + +/* BIONIC: same as pthread_cond_timedwait, except the 'reltime' given refers + * is relative to the current time. + */ +int pthread_cond_timedwait_relative_np(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const struct timespec *reltime); + +#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE 1 + + + int pthread_cond_timeout_np(pthread_cond_t *cond, pthread_mutex_t * mutex, unsigned msecs); +/* same as pthread_mutex_lock(), but will wait up to 'msecs' milli-seconds + * before returning. same return values than pthread_mutex_trylock though, i.e. + * returns EBUSY if the lock could not be acquired after the timeout + * expired. + */ +int pthread_mutex_lock_timeout_np(pthread_mutex_t *mutex, unsigned msecs); + int pthread_key_create(pthread_key_t *key, void (*destructor_function)(void *)); int pthread_key_delete (pthread_key_t); int pthread_setspecific(pthread_key_t key, const void *value); diff --git a/build/platforms/android-8/arch-arm/usr/include/regex.h b/build/platforms/android-8/arch-arm/usr/include/regex.h new file mode 100644 index 000000000..aec38e334 --- /dev/null +++ b/build/platforms/android-8/arch-arm/usr/include/regex.h @@ -0,0 +1,105 @@ +/* $OpenBSD: regex.h,v 1.6 2003/06/02 19:34:12 millert Exp $ */ +/* $NetBSD: regex.h,v 1.4.6.1 1996/06/10 18:57:07 explorer Exp $ */ + +/*- + * Copyright (c) 1992 Henry Spencer. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer of the University of Toronto. + * + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)regex.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _REGEX_H_ +#define _REGEX_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +/* types */ +typedef off_t regoff_t; + +typedef struct { + int re_magic; + size_t re_nsub; /* number of parenthesized subexpressions */ + const char *re_endp; /* end pointer for REG_PEND */ + struct re_guts *re_g; /* none of your business :-) */ +} regex_t; + +typedef struct { + regoff_t rm_so; /* start of match */ + regoff_t rm_eo; /* end of match */ +} regmatch_t; + +/* regcomp() flags */ +#define REG_BASIC 0000 +#define REG_EXTENDED 0001 +#define REG_ICASE 0002 +#define REG_NOSUB 0004 +#define REG_NEWLINE 0010 +#define REG_NOSPEC 0020 +#define REG_PEND 0040 +#define REG_DUMP 0200 + +/* regerror() flags */ +#define REG_NOMATCH 1 +#define REG_BADPAT 2 +#define REG_ECOLLATE 3 +#define REG_ECTYPE 4 +#define REG_EESCAPE 5 +#define REG_ESUBREG 6 +#define REG_EBRACK 7 +#define REG_EPAREN 8 +#define REG_EBRACE 9 +#define REG_BADBR 10 +#define REG_ERANGE 11 +#define REG_ESPACE 12 +#define REG_BADRPT 13 +#define REG_EMPTY 14 +#define REG_ASSERT 15 +#define REG_INVARG 16 +#define REG_ATOI 255 /* convert name to number (!) */ +#define REG_ITOA 0400 /* convert number to name (!) */ + +/* regexec() flags */ +#define REG_NOTBOL 00001 +#define REG_NOTEOL 00002 +#define REG_STARTEND 00004 +#define REG_TRACE 00400 /* tracing of execution */ +#define REG_LARGE 01000 /* force large representation */ +#define REG_BACKR 02000 /* force use of backref code */ + +__BEGIN_DECLS +int regcomp(regex_t *, const char *, int); +size_t regerror(int, const regex_t *, char *, size_t); +int regexec(const regex_t *, const char *, size_t, regmatch_t [], int); +void regfree(regex_t *); +__END_DECLS + +#endif /* !_REGEX_H_ */ diff --git a/build/platforms/android-8/arch-arm/usr/include/sched.h b/build/platforms/android-8/arch-arm/usr/include/sched.h index 6600bae64..e70247005 100644 --- a/build/platforms/android-8/arch-arm/usr/include/sched.h +++ b/build/platforms/android-8/arch-arm/usr/include/sched.h @@ -69,8 +69,9 @@ extern int sched_rr_get_interval(pid_t pid, struct timespec *tp); #define CLONE_CHILD_SETTID 0x01000000 #define CLONE_STOPPED 0x02000000 -extern int clone(int (*fn)(void*), void *child_stack, int flags, void *arg); -extern pid_t __clone(int, void *); +#ifdef _GNU_SOURCE +extern int clone(int (*fn)(void *), void *child_stack, int flags, void* arg, ...); +#endif __END_DECLS diff --git a/build/platforms/android-8/arch-arm/usr/include/signal.h b/build/platforms/android-8/arch-arm/usr/include/signal.h index 55408478b..9e5ce6116 100644 --- a/build/platforms/android-8/arch-arm/usr/include/signal.h +++ b/build/platforms/android-8/arch-arm/usr/include/signal.h @@ -118,6 +118,7 @@ extern int siginterrupt(int sig, int flag); extern int raise(int); extern int kill(pid_t, int); +extern int killpg(int pgrp, int sig); __END_DECLS diff --git a/build/platforms/android-8/arch-arm/usr/include/stdio.h b/build/platforms/android-8/arch-arm/usr/include/stdio.h index 79e526b7c..f0e103e0f 100644 --- a/build/platforms/android-8/arch-arm/usr/include/stdio.h +++ b/build/platforms/android-8/arch-arm/usr/include/stdio.h @@ -112,6 +112,9 @@ struct __sbuf { * that does not match the previous one in _bf. When this happens, * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NOTE: if you change this structure, you also need to update the + * std() initializer in findfp.c. */ typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ @@ -434,4 +437,15 @@ static __inline int __sputc(int _c, FILE *_p) { #define getchar_unlocked() getc_unlocked(stdin) #define putchar_unlocked(c) putc_unlocked(c, stdout) +#ifdef _GNU_SOURCE +/* + * glibc defines dprintf(int, const char*, ...), which is poorly named + * and likely to conflict with locally defined debugging printfs + * fdprintf is a better name, and some programs that use fdprintf use a + * #define fdprintf dprintf for compatibility + */ +int fdprintf(int, const char*, ...); +int vfdprintf(int, const char*, __va_list); +#endif /* _GNU_SOURCE */ + #endif /* _STDIO_H_ */ diff --git a/build/platforms/android-8/arch-arm/usr/include/stdlib.h b/build/platforms/android-8/arch-arm/usr/include/stdlib.h index acfe69424..41e8d26c4 100644 --- a/build/platforms/android-8/arch-arm/usr/include/stdlib.h +++ b/build/platforms/android-8/arch-arm/usr/include/stdlib.h @@ -132,7 +132,7 @@ static __inline__ void srandom(unsigned int __s) extern int unlockpt(int); extern char* ptsname(int); -extern char* ptsname_r(int, char*, size_t); +extern int ptsname_r(int, char*, size_t); extern int getpt(void); static __inline__ int grantpt(int __fd) diff --git a/build/platforms/android-8/arch-arm/usr/include/sys/epoll.h b/build/platforms/android-8/arch-arm/usr/include/sys/epoll.h index 1478caa6c..decdb4649 100644 --- a/build/platforms/android-8/arch-arm/usr/include/sys/epoll.h +++ b/build/platforms/android-8/arch-arm/usr/include/sys/epoll.h @@ -28,6 +28,10 @@ #ifndef _SYS_EPOLL_H_ #define _SYS_EPOLL_H_ +#include <sys/cdefs.h> + +__BEGIN_DECLS + #define EPOLLIN 0x00000001 #define EPOLLPRI 0x00000002 #define EPOLLOUT 0x00000004 @@ -62,5 +66,7 @@ int epoll_create(int size); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); +__END_DECLS + #endif /* _SYS_EPOLL_H_ */ diff --git a/build/platforms/android-8/arch-arm/usr/include/sys/queue.h b/build/platforms/android-8/arch-arm/usr/include/sys/queue.h new file mode 100644 index 000000000..b0e6b38c1 --- /dev/null +++ b/build/platforms/android-8/arch-arm/usr/include/sys/queue.h @@ -0,0 +1,557 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines five types of data structures: singly-linked lists, + * lists, simple queues, tail queues, and circular queues. + * + * A singly-linked list is headed by a single forward pointer. The + * elements are singly linked for minimum space and pointer manipulation + * overhead at the expense of O(n) removal for arbitrary elements. New + * elements can be added to the list after an existing element or at the + * head of the list. Elements being removed from the head of the list + * should use the explicit macro for this purpose for optimum + * efficiency. A singly-linked list may only be traversed in the forward + * direction. Singly-linked lists are ideal for applications with large + * datasets and few or no removals or for implementing a LIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A simple queue is headed by a pair of pointers, one the head of the + * list and the other to the tail of the list. The elements are singly + * linked to save space, so elements can only be removed from the + * head of the list. New elements can be added to the list after + * an existing element, at the head of the list, or at the end of the + * list. A simple queue may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + */ + +/* + * List definitions. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +/* + * List functions. + */ +#define LIST_INIT(head) do { \ + (head)->lh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.le_next = (head)->lh_first) != NULL) \ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ +} while (/*CONSTCOND*/0) + +#define LIST_REMOVE(elm, field) do { \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_FOREACH(var, head, field) \ + for ((var) = ((head)->lh_first); \ + (var); \ + (var) = ((var)->field.le_next)) + +/* + * List access methods. + */ +#define LIST_EMPTY(head) ((head)->lh_first == NULL) +#define LIST_FIRST(head) ((head)->lh_first) +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + + +/* + * Singly-linked List definitions. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List functions. + */ +#define SLIST_INIT(head) do { \ + (head)->slh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while(curelm->field.sle_next != (elm)) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SLIST_FOREACH(var, head, field) \ + for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) + +/* + * Singly-linked List access methods. + */ +#define SLIST_EMPTY(head) ((head)->slh_first == NULL) +#define SLIST_FIRST(head) ((head)->slh_first) +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + + +/* + * Singly-linked Tail queue declarations. + */ +#define STAILQ_HEAD(name, type) \ +struct name { \ + struct type *stqh_first; /* first element */ \ + struct type **stqh_last; /* addr of last next element */ \ +} + +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + +#define STAILQ_ENTRY(type) \ +struct { \ + struct type *stqe_next; /* next element */ \ +} + +/* + * Singly-linked Tail queue functions. + */ +#define STAILQ_INIT(head) do { \ + (head)->stqh_first = NULL; \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (head)->stqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.stqe_next = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &(elm)->field.stqe_next; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (listelm)->field.stqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE(head, elm, type, field) do { \ + if ((head)->stqh_first == (elm)) { \ + STAILQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->stqh_first; \ + while (curelm->field.stqe_next != (elm)) \ + curelm = curelm->field.stqe_next; \ + if ((curelm->field.stqe_next = \ + curelm->field.stqe_next->field.stqe_next) == NULL) \ + (head)->stqh_last = &(curelm)->field.stqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define STAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->stqh_first); \ + (var); \ + (var) = ((var)->field.stqe_next)) + +/* + * Singly-linked Tail queue access methods. + */ +#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) +#define STAILQ_FIRST(head) ((head)->stqh_first) +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + + +/* + * Simple queue definitions. + */ +#define SIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqh_first; /* first element */ \ + struct type **sqh_last; /* addr of last next element */ \ +} + +#define SIMPLEQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).sqh_first } + +#define SIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqe_next; /* next element */ \ +} + +/* + * Simple queue functions. + */ +#define SIMPLEQ_INIT(head) do { \ + (head)->sqh_first = NULL; \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (head)->sqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqe_next = NULL; \ + *(head)->sqh_last = (elm); \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (listelm)->field.sqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ + if ((head)->sqh_first == (elm)) { \ + SIMPLEQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->sqh_first; \ + while (curelm->field.sqe_next != (elm)) \ + curelm = curelm->field.sqe_next; \ + if ((curelm->field.sqe_next = \ + curelm->field.sqe_next->field.sqe_next) == NULL) \ + (head)->sqh_last = &(curelm)->field.sqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->sqh_first); \ + (var); \ + (var) = ((var)->field.sqe_next)) + +/* + * Simple queue access methods. + */ +#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) +#define SIMPLEQ_FIRST(head) ((head)->sqh_first) +#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) + + +/* + * Tail queue definitions. + */ +#define _TAILQ_HEAD(name, type, qual) \ +struct name { \ + qual type *tqh_first; /* first element */ \ + qual type *qual *tqh_last; /* addr of last next element */ \ +} +#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) + +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + +#define _TAILQ_ENTRY(type, qual) \ +struct { \ + qual type *tqe_next; /* next element */ \ + qual type *qual *tqe_prev; /* address of previous next element */\ +} +#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) + +/* + * Tail queue functions. + */ +#define TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->tqh_first); \ + (var); \ + (var) = ((var)->field.tqe_next)) + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ + (var); \ + (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) + +/* + * Tail queue access methods. + */ +#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) +#define TAILQ_FIRST(head) ((head)->tqh_first) +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) + +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) + + +/* + * Circular queue definitions. + */ +#define CIRCLEQ_HEAD(name, type) \ +struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ +} + +#define CIRCLEQ_HEAD_INITIALIZER(head) \ + { (void *)&head, (void *)&head } + +#define CIRCLEQ_ENTRY(type) \ +struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ +} + +/* + * Circular queue functions. + */ +#define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = (void *)(head); \ + (head)->cqh_last = (void *)(head); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = (void *)(head); \ + if ((head)->cqh_last == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.cqe_next = (void *)(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_REMOVE(head, elm, field) do { \ + if ((elm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->cqh_first); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_next)) + +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ + for ((var) = ((head)->cqh_last); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_prev)) + +/* + * Circular queue access methods. + */ +#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) +#define CIRCLEQ_FIRST(head) ((head)->cqh_first) +#define CIRCLEQ_LAST(head) ((head)->cqh_last) +#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) +#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) + +#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ + (((elm)->field.cqe_next == (void *)(head)) \ + ? ((head)->cqh_first) \ + : (elm->field.cqe_next)) +#define CIRCLEQ_LOOP_PREV(head, elm, field) \ + (((elm)->field.cqe_prev == (void *)(head)) \ + ? ((head)->cqh_last) \ + : (elm->field.cqe_prev)) + +#endif /* sys/queue.h */ diff --git a/build/platforms/android-8/arch-arm/usr/include/sys/resource.h b/build/platforms/android-8/arch-arm/usr/include/sys/resource.h index a7de6f0ac..ef325c7aa 100644 --- a/build/platforms/android-8/arch-arm/usr/include/sys/resource.h +++ b/build/platforms/android-8/arch-arm/usr/include/sys/resource.h @@ -40,6 +40,8 @@ #include <linux/resource.h> #undef getrusage +typedef unsigned long rlim_t; + __BEGIN_DECLS extern int getpriority(int, int); diff --git a/build/platforms/android-8/arch-arm/usr/include/sys/system_properties.h b/build/platforms/android-8/arch-arm/usr/include/sys/system_properties.h index 2eb00cdc0..4fdc9447f 100644 --- a/build/platforms/android-8/arch-arm/usr/include/sys/system_properties.h +++ b/build/platforms/android-8/arch-arm/usr/include/sys/system_properties.h @@ -29,6 +29,10 @@ #ifndef _INCLUDE_SYS_SYSTEM_PROPERTIES_H #define _INCLUDE_SYS_SYSTEM_PROPERTIES_H +#include <sys/cdefs.h> + +__BEGIN_DECLS + typedef struct prop_info prop_info; #define PROP_NAME_MAX 32 @@ -76,4 +80,6 @@ int __system_property_read(const prop_info *pi, char *name, char *value); */ const prop_info *__system_property_find_nth(unsigned n); +__END_DECLS + #endif diff --git a/build/platforms/android-8/arch-arm/usr/include/time64.h b/build/platforms/android-8/arch-arm/usr/include/time64.h index 9da4bc702..7ec05af65 100644 --- a/build/platforms/android-8/arch-arm/usr/include/time64.h +++ b/build/platforms/android-8/arch-arm/usr/include/time64.h @@ -31,9 +31,12 @@ Modified for Bionic by the Android Open Source Project #ifndef TIME64_H #define TIME64_H +#include <sys/cdefs.h> #include <time.h> #include <stdint.h> +__BEGIN_DECLS + typedef int64_t time64_t; struct tm *gmtime64_r (const time64_t *, struct tm *); @@ -51,4 +54,6 @@ time64_t timegm64 (const struct tm *); time64_t mktime64 (const struct tm *); time64_t timelocal64 (const struct tm *); +__END_DECLS + #endif /* TIME64_H */ diff --git a/build/platforms/android-8/arch-arm/usr/include/unistd.h b/build/platforms/android-8/arch-arm/usr/include/unistd.h index 1ada37e51..b4f1dda17 100644 --- a/build/platforms/android-8/arch-arm/usr/include/unistd.h +++ b/build/platforms/android-8/arch-arm/usr/include/unistd.h @@ -99,6 +99,10 @@ extern int setfsuid(uid_t); extern int issetugid(void); extern char* getlogin(void); extern int getlogin_r(char* name, size_t namesize); +extern char* getusershell(void); +extern void setusershell(void); +extern void endusershell(void); + /* Macros for access() */ @@ -145,7 +149,7 @@ extern int ftruncate(int, off_t); extern int pause(void); extern unsigned int alarm(unsigned int); extern unsigned int sleep(unsigned int); -extern void usleep(unsigned long); +extern int usleep(unsigned long); extern int gethostname(char *, size_t); extern int sethostname(const char *, size_t); @@ -163,6 +167,8 @@ extern char *optarg; extern int optind, opterr, optopt; extern int isatty(int); +extern char* ttyname(int); +extern int ttyname_r(int, char*, size_t); extern int acct(const char* filepath); @@ -185,6 +191,14 @@ extern int cacheflush(long start, long end, long flags); extern pid_t tcgetpgrp(int fd); extern int tcsetpgrp(int fd, pid_t _pid); +/* Used to retry syscalls that can return EINTR. */ +#define TEMP_FAILURE_RETRY(exp) ({ \ + typeof (exp) _rc; \ + do { \ + _rc = (exp); \ + } while (_rc == -1 && errno == EINTR); \ + _rc; }) + __END_DECLS #endif /* _UNISTD_H_ */ diff --git a/build/platforms/android-8/arch-arm/usr/include/wchar.h b/build/platforms/android-8/arch-arm/usr/include/wchar.h index e2feb6002..97e1b5c4c 100644 --- a/build/platforms/android-8/arch-arm/usr/include/wchar.h +++ b/build/platforms/android-8/arch-arm/usr/include/wchar.h @@ -100,6 +100,7 @@ extern int mbsinit(const mbstate_t *); extern size_t mbrlen(const char *, size_t, mbstate_t *); extern size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); extern size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); +extern size_t mbstowcs(wchar_t *, const char *, size_t); extern wint_t putwc(wchar_t, FILE *); extern wint_t putwchar(wchar_t); extern int swprintf(wchar_t *, size_t, const wchar_t *, ...); @@ -130,6 +131,7 @@ extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); extern double wcstod(const wchar_t *, wchar_t **); extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **); extern long int wcstol(const wchar_t *, wchar_t **, int); +extern size_t wcstombs(char *, const wchar_t *, size_t); extern unsigned long int wcstoul(const wchar_t *, wchar_t **, int); extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); extern int wcswidth(const wchar_t *, size_t); diff --git a/build/platforms/android-8/arch-x86/usr/include/ctype.h b/build/platforms/android-8/arch-x86/usr/include/ctype.h index b5f9ff4f8..58b76eae6 100644 --- a/build/platforms/android-8/arch-x86/usr/include/ctype.h +++ b/build/platforms/android-8/arch-x86/usr/include/ctype.h @@ -59,7 +59,11 @@ extern const short *_toupper_tab_; /* extern __inline is a GNU C extension */ #ifdef __GNUC__ +# if defined(__GNUC_STDC_INLINE__) +#define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__)) +# else #define __CTYPE_INLINE extern __inline +# endif #else #define __CTYPE_INLINE static __inline #endif diff --git a/build/platforms/android-8/arch-x86/usr/include/dlfcn.h b/build/platforms/android-8/arch-x86/usr/include/dlfcn.h index 958279687..f84d1d183 100644 --- a/build/platforms/android-8/arch-x86/usr/include/dlfcn.h +++ b/build/platforms/android-8/arch-x86/usr/include/dlfcn.h @@ -32,10 +32,22 @@ __BEGIN_DECLS +typedef struct { + const char *dli_fname; /* Pathname of shared object that + contains address */ + void *dli_fbase; /* Address at which shared object + is loaded */ + const char *dli_sname; /* Name of nearest symbol with address + lower than addr */ + void *dli_saddr; /* Exact address of symbol named + in dli_sname */ +} Dl_info; + extern void* dlopen(const char* filename, int flag); extern int dlclose(void* handle); extern const char* dlerror(void); extern void* dlsym(void* handle, const char* symbol); +extern int dladdr(void* addr, Dl_info *info); enum { RTLD_NOW = 0, diff --git a/build/platforms/android-8/arch-x86/usr/include/err.h b/build/platforms/android-8/arch-x86/usr/include/err.h index e69de29bb..1636efe92 100644 --- a/build/platforms/android-8/arch-x86/usr/include/err.h +++ b/build/platforms/android-8/arch-x86/usr/include/err.h @@ -0,0 +1,90 @@ +/* $OpenBSD: err.h,v 1.10 2006/01/06 18:53:04 millert Exp $ */ +/* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)err.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _ERR_H_ +#define _ERR_H_ + +/* + * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two + * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one + * of them here we may collide with the utility's includes. It's unreasonable + * for utilities to have to include one of them to include err.h, so we get + * __va_list from <machine/_types.h> and use it. + */ +#include <sys/cdefs.h> +#include <machine/_types.h> + +__BEGIN_DECLS + +__noreturn void err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void verr(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +__noreturn void errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void verrx(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +void warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarn(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); +void warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarnx(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); + +/* + * The _* versions are for use in library functions so user-defined + * versions of err*,warn* do not get used. + */ +__noreturn void _err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void _verr(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +__noreturn void _errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__noreturn void _verrx(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +void _warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void _vwarn(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); +void _warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void _vwarnx(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); + +__END_DECLS + +#endif /* !_ERR_H_ */ diff --git a/build/platforms/android-8/arch-x86/usr/include/fts.h b/build/platforms/android-8/arch-x86/usr/include/fts.h new file mode 100644 index 000000000..da26a8823 --- /dev/null +++ b/build/platforms/android-8/arch-x86/usr/include/fts.h @@ -0,0 +1,125 @@ +/* $OpenBSD: fts.h,v 1.12 2009/08/27 16:19:27 millert Exp $ */ +/* $NetBSD: fts.h,v 1.5 1994/12/28 01:41:50 mycroft Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)fts.h 8.3 (Berkeley) 8/14/94 + */ + +#ifndef _FTS_H_ +#define _FTS_H_ + +typedef struct { + struct _ftsent *fts_cur; /* current node */ + struct _ftsent *fts_child; /* linked list of children */ + struct _ftsent **fts_array; /* sort array */ + dev_t fts_dev; /* starting device # */ + char *fts_path; /* path for this descent */ + int fts_rfd; /* fd for root */ + size_t fts_pathlen; /* sizeof(path) */ + int fts_nitems; /* elements in the sort array */ + int (*fts_compar)(); /* compare function */ + +#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */ +#define FTS_LOGICAL 0x0002 /* logical walk */ +#define FTS_NOCHDIR 0x0004 /* don't change directories */ +#define FTS_NOSTAT 0x0008 /* don't get stat info */ +#define FTS_PHYSICAL 0x0010 /* physical walk */ +#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */ +#define FTS_XDEV 0x0040 /* don't cross devices */ +#define FTS_OPTIONMASK 0x00ff /* valid user option mask */ + +#define FTS_NAMEONLY 0x1000 /* (private) child names only */ +#define FTS_STOP 0x2000 /* (private) unrecoverable error */ + int fts_options; /* fts_open options, global flags */ +} FTS; + +typedef struct _ftsent { + struct _ftsent *fts_cycle; /* cycle node */ + struct _ftsent *fts_parent; /* parent directory */ + struct _ftsent *fts_link; /* next file in directory */ + long fts_number; /* local numeric value */ + void *fts_pointer; /* local address value */ + char *fts_accpath; /* access path */ + char *fts_path; /* root path */ + int fts_errno; /* errno for this node */ + int fts_symfd; /* fd for symlink */ + size_t fts_pathlen; /* strlen(fts_path) */ + size_t fts_namelen; /* strlen(fts_name) */ + + ino_t fts_ino; /* inode */ + dev_t fts_dev; /* device */ + nlink_t fts_nlink; /* link count */ + +#define FTS_ROOTPARENTLEVEL -1 +#define FTS_ROOTLEVEL 0 +#define FTS_MAXLEVEL 0x7fff + short fts_level; /* depth (-1 to N) */ + +#define FTS_D 1 /* preorder directory */ +#define FTS_DC 2 /* directory that causes cycles */ +#define FTS_DEFAULT 3 /* none of the above */ +#define FTS_DNR 4 /* unreadable directory */ +#define FTS_DOT 5 /* dot or dot-dot */ +#define FTS_DP 6 /* postorder directory */ +#define FTS_ERR 7 /* error; errno is set */ +#define FTS_F 8 /* regular file */ +#define FTS_INIT 9 /* initialized only */ +#define FTS_NS 10 /* stat(2) failed */ +#define FTS_NSOK 11 /* no stat(2) requested */ +#define FTS_SL 12 /* symbolic link */ +#define FTS_SLNONE 13 /* symbolic link without target */ + unsigned short fts_info; /* user flags for FTSENT structure */ + +#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ +#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ + unsigned short fts_flags; /* private flags for FTSENT structure */ + +#define FTS_AGAIN 1 /* read node again */ +#define FTS_FOLLOW 2 /* follow symbolic link */ +#define FTS_NOINSTR 3 /* no instructions */ +#define FTS_SKIP 4 /* discard node */ + unsigned short fts_instr; /* fts_set() instructions */ + + struct stat *fts_statp; /* stat(2) information */ + char fts_name[1]; /* file name */ +} FTSENT; + +#include <sys/cdefs.h> + +__BEGIN_DECLS +FTSENT *fts_children(FTS *, int); +int fts_close(FTS *); +FTS *fts_open(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)); +FTSENT *fts_read(FTS *); +int fts_set(FTS *, FTSENT *, int); +__END_DECLS + +#endif /* !_FTS_H_ */ diff --git a/build/platforms/android-8/arch-x86/usr/include/mntent.h b/build/platforms/android-8/arch-x86/usr/include/mntent.h index 468ff742e..b83da1f2f 100644 --- a/build/platforms/android-8/arch-x86/usr/include/mntent.h +++ b/build/platforms/android-8/arch-x86/usr/include/mntent.h @@ -28,6 +28,7 @@ #ifndef _MNTENT_H_ #define _MNTENT_H_ +#include <stdio.h> #define MNTTYPE_IGNORE "ignore" diff --git a/build/platforms/android-8/arch-x86/usr/include/netdb.h b/build/platforms/android-8/arch-x86/usr/include/netdb.h index b0c3b7275..c2e08ea87 100644 --- a/build/platforms/android-8/arch-x86/usr/include/netdb.h +++ b/build/platforms/android-8/arch-x86/usr/include/netdb.h @@ -75,10 +75,6 @@ #define MAXHOSTNAMELEN 256 -/* BIONIC-BEGIN */ -#define h_errno (*__get_h_errno()) -extern int* __get_h_errno(void); -/* BIONIC-END */ /* * Structures returned by network data base library. All addresses are @@ -203,6 +199,10 @@ struct addrinfo { #define SCOPE_DELIMITER '%' __BEGIN_DECLS +/* BIONIC-BEGIN */ +#define h_errno (*__get_h_errno()) +int* __get_h_errno(void); +/* BIONIC-END */ void endhostent(void); void endnetent(void); void endnetgrent(void); diff --git a/build/platforms/android-8/arch-x86/usr/include/pthread.h b/build/platforms/android-8/arch-x86/usr/include/pthread.h index 6603b3f6c..eb2d16997 100644 --- a/build/platforms/android-8/arch-x86/usr/include/pthread.h +++ b/build/platforms/android-8/arch-x86/usr/include/pthread.h @@ -165,6 +165,11 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex); int pthread_mutex_trylock(pthread_mutex_t *mutex); int pthread_mutex_timedlock(pthread_mutex_t *mutex, struct timespec* ts); +int pthread_condattr_init(pthread_condattr_t *attr); +int pthread_condattr_getpshared(pthread_condattr_t *attr, int *pshared); +int pthread_condattr_setpshared(pthread_condattr_t* attr, int pshared); +int pthread_condattr_destroy(pthread_condattr_t *attr); + int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); int pthread_cond_destroy(pthread_cond_t *cond); diff --git a/build/platforms/android-8/arch-x86/usr/include/regex.h b/build/platforms/android-8/arch-x86/usr/include/regex.h new file mode 100644 index 000000000..aec38e334 --- /dev/null +++ b/build/platforms/android-8/arch-x86/usr/include/regex.h @@ -0,0 +1,105 @@ +/* $OpenBSD: regex.h,v 1.6 2003/06/02 19:34:12 millert Exp $ */ +/* $NetBSD: regex.h,v 1.4.6.1 1996/06/10 18:57:07 explorer Exp $ */ + +/*- + * Copyright (c) 1992 Henry Spencer. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer of the University of Toronto. + * + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)regex.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _REGEX_H_ +#define _REGEX_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +/* types */ +typedef off_t regoff_t; + +typedef struct { + int re_magic; + size_t re_nsub; /* number of parenthesized subexpressions */ + const char *re_endp; /* end pointer for REG_PEND */ + struct re_guts *re_g; /* none of your business :-) */ +} regex_t; + +typedef struct { + regoff_t rm_so; /* start of match */ + regoff_t rm_eo; /* end of match */ +} regmatch_t; + +/* regcomp() flags */ +#define REG_BASIC 0000 +#define REG_EXTENDED 0001 +#define REG_ICASE 0002 +#define REG_NOSUB 0004 +#define REG_NEWLINE 0010 +#define REG_NOSPEC 0020 +#define REG_PEND 0040 +#define REG_DUMP 0200 + +/* regerror() flags */ +#define REG_NOMATCH 1 +#define REG_BADPAT 2 +#define REG_ECOLLATE 3 +#define REG_ECTYPE 4 +#define REG_EESCAPE 5 +#define REG_ESUBREG 6 +#define REG_EBRACK 7 +#define REG_EPAREN 8 +#define REG_EBRACE 9 +#define REG_BADBR 10 +#define REG_ERANGE 11 +#define REG_ESPACE 12 +#define REG_BADRPT 13 +#define REG_EMPTY 14 +#define REG_ASSERT 15 +#define REG_INVARG 16 +#define REG_ATOI 255 /* convert name to number (!) */ +#define REG_ITOA 0400 /* convert number to name (!) */ + +/* regexec() flags */ +#define REG_NOTBOL 00001 +#define REG_NOTEOL 00002 +#define REG_STARTEND 00004 +#define REG_TRACE 00400 /* tracing of execution */ +#define REG_LARGE 01000 /* force large representation */ +#define REG_BACKR 02000 /* force use of backref code */ + +__BEGIN_DECLS +int regcomp(regex_t *, const char *, int); +size_t regerror(int, const regex_t *, char *, size_t); +int regexec(const regex_t *, const char *, size_t, regmatch_t [], int); +void regfree(regex_t *); +__END_DECLS + +#endif /* !_REGEX_H_ */ diff --git a/build/platforms/android-8/arch-x86/usr/include/sched.h b/build/platforms/android-8/arch-x86/usr/include/sched.h index 6600bae64..e70247005 100644 --- a/build/platforms/android-8/arch-x86/usr/include/sched.h +++ b/build/platforms/android-8/arch-x86/usr/include/sched.h @@ -69,8 +69,9 @@ extern int sched_rr_get_interval(pid_t pid, struct timespec *tp); #define CLONE_CHILD_SETTID 0x01000000 #define CLONE_STOPPED 0x02000000 -extern int clone(int (*fn)(void*), void *child_stack, int flags, void *arg); -extern pid_t __clone(int, void *); +#ifdef _GNU_SOURCE +extern int clone(int (*fn)(void *), void *child_stack, int flags, void* arg, ...); +#endif __END_DECLS diff --git a/build/platforms/android-8/arch-x86/usr/include/signal.h b/build/platforms/android-8/arch-x86/usr/include/signal.h index 55408478b..9e5ce6116 100644 --- a/build/platforms/android-8/arch-x86/usr/include/signal.h +++ b/build/platforms/android-8/arch-x86/usr/include/signal.h @@ -118,6 +118,7 @@ extern int siginterrupt(int sig, int flag); extern int raise(int); extern int kill(pid_t, int); +extern int killpg(int pgrp, int sig); __END_DECLS diff --git a/build/platforms/android-8/arch-x86/usr/include/stdint.h b/build/platforms/android-8/arch-x86/usr/include/stdint.h index 39a8ab8dd..237baa24c 100644 --- a/build/platforms/android-8/arch-x86/usr/include/stdint.h +++ b/build/platforms/android-8/arch-x86/usr/include/stdint.h @@ -46,13 +46,17 @@ # define __STDINT_MACROS #endif +#if !defined __STRICT_ANSI__ || __STDC_VERSION__ >= 199901L +# define __STDC_INT64__ +#endif + typedef __int8_t int8_t; typedef __uint8_t uint8_t; typedef __int16_t int16_t; typedef __uint16_t uint16_t; typedef __int32_t int32_t; typedef __uint32_t uint32_t; -#if !defined(__STRICT_ANSI__) +#if defined(__STDC_INT64__) typedef __int64_t int64_t; typedef __uint64_t uint64_t; #endif @@ -157,7 +161,7 @@ typedef uint32_t uint_fast32_t; # define UINT_FAST32_C(c) UINT32_C(c) #endif -#if !defined(__STRICT_ANSI__) +#if defined(__STDC_INT64__) /* * int64_t */ @@ -198,7 +202,7 @@ typedef uint64_t uint_fast64_t; # define __PRIFAST_RANK "" # define __PRIPTR_RANK "" -#endif /* !__STRICT_ANSI__ */ +#endif /* __STDC_INT64__ */ /* * intptr_t & uintptr_t @@ -221,7 +225,7 @@ typedef unsigned int uintptr_t; * intmax_t & uintmax_t */ -#if !defined(__STRICT_ANSI__) +#if defined(__STDC_INT64__) typedef uint64_t uintmax_t; typedef int64_t intmax_t; @@ -233,7 +237,7 @@ typedef int64_t intmax_t; #define INTMAX_C(c) INT64_C(c) #define UINTMAX_C(c) UINT64_C(c) -#else /* __STRICT_ANSI__ */ +#else /* !__STDC_INT64__ */ typedef uint32_t uintmax_t; typedef int32_t intmax_t; @@ -245,7 +249,7 @@ typedef int32_t intmax_t; #define INTMAX_C(c) INT32_C(c) #define UINTMAX_C(c) UINT32_C(c) -#endif /* __STRICT_ANSI__ */ +#endif /* !__STDC_INT64__ */ /* size_t is defined by the GCC-specific <stddef.h> */ diff --git a/build/platforms/android-8/arch-x86/usr/include/stdio.h b/build/platforms/android-8/arch-x86/usr/include/stdio.h index 79e526b7c..f0e103e0f 100644 --- a/build/platforms/android-8/arch-x86/usr/include/stdio.h +++ b/build/platforms/android-8/arch-x86/usr/include/stdio.h @@ -112,6 +112,9 @@ struct __sbuf { * that does not match the previous one in _bf. When this happens, * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NOTE: if you change this structure, you also need to update the + * std() initializer in findfp.c. */ typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ @@ -434,4 +437,15 @@ static __inline int __sputc(int _c, FILE *_p) { #define getchar_unlocked() getc_unlocked(stdin) #define putchar_unlocked(c) putc_unlocked(c, stdout) +#ifdef _GNU_SOURCE +/* + * glibc defines dprintf(int, const char*, ...), which is poorly named + * and likely to conflict with locally defined debugging printfs + * fdprintf is a better name, and some programs that use fdprintf use a + * #define fdprintf dprintf for compatibility + */ +int fdprintf(int, const char*, ...); +int vfdprintf(int, const char*, __va_list); +#endif /* _GNU_SOURCE */ + #endif /* _STDIO_H_ */ diff --git a/build/platforms/android-8/arch-x86/usr/include/stdlib.h b/build/platforms/android-8/arch-x86/usr/include/stdlib.h index acfe69424..41e8d26c4 100644 --- a/build/platforms/android-8/arch-x86/usr/include/stdlib.h +++ b/build/platforms/android-8/arch-x86/usr/include/stdlib.h @@ -132,7 +132,7 @@ static __inline__ void srandom(unsigned int __s) extern int unlockpt(int); extern char* ptsname(int); -extern char* ptsname_r(int, char*, size_t); +extern int ptsname_r(int, char*, size_t); extern int getpt(void); static __inline__ int grantpt(int __fd) diff --git a/build/platforms/android-8/arch-x86/usr/include/strings.h b/build/platforms/android-8/arch-x86/usr/include/strings.h index 1f73e21a2..fee7dc4f7 100644 --- a/build/platforms/android-8/arch-x86/usr/include/strings.h +++ b/build/platforms/android-8/arch-x86/usr/include/strings.h @@ -39,6 +39,7 @@ #ifndef _STRINGS_H_ #define _STRINGS_H_ +#include <sys/types.h> #include <sys/cdefs.h> __BEGIN_DECLS diff --git a/build/platforms/android-8/arch-x86/usr/include/sys/epoll.h b/build/platforms/android-8/arch-x86/usr/include/sys/epoll.h index 1478caa6c..decdb4649 100644 --- a/build/platforms/android-8/arch-x86/usr/include/sys/epoll.h +++ b/build/platforms/android-8/arch-x86/usr/include/sys/epoll.h @@ -28,6 +28,10 @@ #ifndef _SYS_EPOLL_H_ #define _SYS_EPOLL_H_ +#include <sys/cdefs.h> + +__BEGIN_DECLS + #define EPOLLIN 0x00000001 #define EPOLLPRI 0x00000002 #define EPOLLOUT 0x00000004 @@ -62,5 +66,7 @@ int epoll_create(int size); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout); +__END_DECLS + #endif /* _SYS_EPOLL_H_ */ diff --git a/build/platforms/android-8/arch-x86/usr/include/sys/queue.h b/build/platforms/android-8/arch-x86/usr/include/sys/queue.h new file mode 100644 index 000000000..b0e6b38c1 --- /dev/null +++ b/build/platforms/android-8/arch-x86/usr/include/sys/queue.h @@ -0,0 +1,557 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines five types of data structures: singly-linked lists, + * lists, simple queues, tail queues, and circular queues. + * + * A singly-linked list is headed by a single forward pointer. The + * elements are singly linked for minimum space and pointer manipulation + * overhead at the expense of O(n) removal for arbitrary elements. New + * elements can be added to the list after an existing element or at the + * head of the list. Elements being removed from the head of the list + * should use the explicit macro for this purpose for optimum + * efficiency. A singly-linked list may only be traversed in the forward + * direction. Singly-linked lists are ideal for applications with large + * datasets and few or no removals or for implementing a LIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A simple queue is headed by a pair of pointers, one the head of the + * list and the other to the tail of the list. The elements are singly + * linked to save space, so elements can only be removed from the + * head of the list. New elements can be added to the list after + * an existing element, at the head of the list, or at the end of the + * list. A simple queue may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + */ + +/* + * List definitions. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +/* + * List functions. + */ +#define LIST_INIT(head) do { \ + (head)->lh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.le_next = (head)->lh_first) != NULL) \ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ +} while (/*CONSTCOND*/0) + +#define LIST_REMOVE(elm, field) do { \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_FOREACH(var, head, field) \ + for ((var) = ((head)->lh_first); \ + (var); \ + (var) = ((var)->field.le_next)) + +/* + * List access methods. + */ +#define LIST_EMPTY(head) ((head)->lh_first == NULL) +#define LIST_FIRST(head) ((head)->lh_first) +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + + +/* + * Singly-linked List definitions. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List functions. + */ +#define SLIST_INIT(head) do { \ + (head)->slh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while(curelm->field.sle_next != (elm)) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SLIST_FOREACH(var, head, field) \ + for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) + +/* + * Singly-linked List access methods. + */ +#define SLIST_EMPTY(head) ((head)->slh_first == NULL) +#define SLIST_FIRST(head) ((head)->slh_first) +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + + +/* + * Singly-linked Tail queue declarations. + */ +#define STAILQ_HEAD(name, type) \ +struct name { \ + struct type *stqh_first; /* first element */ \ + struct type **stqh_last; /* addr of last next element */ \ +} + +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + +#define STAILQ_ENTRY(type) \ +struct { \ + struct type *stqe_next; /* next element */ \ +} + +/* + * Singly-linked Tail queue functions. + */ +#define STAILQ_INIT(head) do { \ + (head)->stqh_first = NULL; \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (head)->stqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.stqe_next = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &(elm)->field.stqe_next; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (listelm)->field.stqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE(head, elm, type, field) do { \ + if ((head)->stqh_first == (elm)) { \ + STAILQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->stqh_first; \ + while (curelm->field.stqe_next != (elm)) \ + curelm = curelm->field.stqe_next; \ + if ((curelm->field.stqe_next = \ + curelm->field.stqe_next->field.stqe_next) == NULL) \ + (head)->stqh_last = &(curelm)->field.stqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define STAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->stqh_first); \ + (var); \ + (var) = ((var)->field.stqe_next)) + +/* + * Singly-linked Tail queue access methods. + */ +#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) +#define STAILQ_FIRST(head) ((head)->stqh_first) +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + + +/* + * Simple queue definitions. + */ +#define SIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqh_first; /* first element */ \ + struct type **sqh_last; /* addr of last next element */ \ +} + +#define SIMPLEQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).sqh_first } + +#define SIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqe_next; /* next element */ \ +} + +/* + * Simple queue functions. + */ +#define SIMPLEQ_INIT(head) do { \ + (head)->sqh_first = NULL; \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (head)->sqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqe_next = NULL; \ + *(head)->sqh_last = (elm); \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (listelm)->field.sqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ + if ((head)->sqh_first == (elm)) { \ + SIMPLEQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->sqh_first; \ + while (curelm->field.sqe_next != (elm)) \ + curelm = curelm->field.sqe_next; \ + if ((curelm->field.sqe_next = \ + curelm->field.sqe_next->field.sqe_next) == NULL) \ + (head)->sqh_last = &(curelm)->field.sqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->sqh_first); \ + (var); \ + (var) = ((var)->field.sqe_next)) + +/* + * Simple queue access methods. + */ +#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) +#define SIMPLEQ_FIRST(head) ((head)->sqh_first) +#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) + + +/* + * Tail queue definitions. + */ +#define _TAILQ_HEAD(name, type, qual) \ +struct name { \ + qual type *tqh_first; /* first element */ \ + qual type *qual *tqh_last; /* addr of last next element */ \ +} +#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) + +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + +#define _TAILQ_ENTRY(type, qual) \ +struct { \ + qual type *tqe_next; /* next element */ \ + qual type *qual *tqe_prev; /* address of previous next element */\ +} +#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) + +/* + * Tail queue functions. + */ +#define TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->tqh_first); \ + (var); \ + (var) = ((var)->field.tqe_next)) + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ + (var); \ + (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) + +/* + * Tail queue access methods. + */ +#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) +#define TAILQ_FIRST(head) ((head)->tqh_first) +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) + +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) + + +/* + * Circular queue definitions. + */ +#define CIRCLEQ_HEAD(name, type) \ +struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ +} + +#define CIRCLEQ_HEAD_INITIALIZER(head) \ + { (void *)&head, (void *)&head } + +#define CIRCLEQ_ENTRY(type) \ +struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ +} + +/* + * Circular queue functions. + */ +#define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = (void *)(head); \ + (head)->cqh_last = (void *)(head); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = (void *)(head); \ + if ((head)->cqh_last == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.cqe_next = (void *)(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_REMOVE(head, elm, field) do { \ + if ((elm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->cqh_first); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_next)) + +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ + for ((var) = ((head)->cqh_last); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_prev)) + +/* + * Circular queue access methods. + */ +#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) +#define CIRCLEQ_FIRST(head) ((head)->cqh_first) +#define CIRCLEQ_LAST(head) ((head)->cqh_last) +#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) +#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) + +#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ + (((elm)->field.cqe_next == (void *)(head)) \ + ? ((head)->cqh_first) \ + : (elm->field.cqe_next)) +#define CIRCLEQ_LOOP_PREV(head, elm, field) \ + (((elm)->field.cqe_prev == (void *)(head)) \ + ? ((head)->cqh_last) \ + : (elm->field.cqe_prev)) + +#endif /* sys/queue.h */ diff --git a/build/platforms/android-8/arch-x86/usr/include/sys/resource.h b/build/platforms/android-8/arch-x86/usr/include/sys/resource.h index a7de6f0ac..ef325c7aa 100644 --- a/build/platforms/android-8/arch-x86/usr/include/sys/resource.h +++ b/build/platforms/android-8/arch-x86/usr/include/sys/resource.h @@ -40,6 +40,8 @@ #include <linux/resource.h> #undef getrusage +typedef unsigned long rlim_t; + __BEGIN_DECLS extern int getpriority(int, int); diff --git a/build/platforms/android-8/arch-x86/usr/include/sys/system_properties.h b/build/platforms/android-8/arch-x86/usr/include/sys/system_properties.h index 2eb00cdc0..4fdc9447f 100644 --- a/build/platforms/android-8/arch-x86/usr/include/sys/system_properties.h +++ b/build/platforms/android-8/arch-x86/usr/include/sys/system_properties.h @@ -29,6 +29,10 @@ #ifndef _INCLUDE_SYS_SYSTEM_PROPERTIES_H #define _INCLUDE_SYS_SYSTEM_PROPERTIES_H +#include <sys/cdefs.h> + +__BEGIN_DECLS + typedef struct prop_info prop_info; #define PROP_NAME_MAX 32 @@ -76,4 +80,6 @@ int __system_property_read(const prop_info *pi, char *name, char *value); */ const prop_info *__system_property_find_nth(unsigned n); +__END_DECLS + #endif diff --git a/build/platforms/android-8/arch-x86/usr/include/time.h b/build/platforms/android-8/arch-x86/usr/include/time.h index 5d1a0e268..6163c6d5f 100644 --- a/build/platforms/android-8/arch-x86/usr/include/time.h +++ b/build/platforms/android-8/arch-x86/usr/include/time.h @@ -79,24 +79,6 @@ extern struct tm* gmtime_r(const time_t *timep, struct tm *result); extern char* strptime(const char *buf, const char *fmt, struct tm *tm); extern size_t strftime(char *s, size_t max, const char *format, const struct tm *tm); -/* ANDROID-BEGIN */ -struct strftime_locale { - const char * mon[12]; - const char * month[12]; - const char * standalone_month[12]; - const char * wday[7]; - const char * weekday[7]; - const char * X_fmt; - const char * x_fmt; - const char * c_fmt; - const char * am; - const char * pm; - const char * date_fmt; -}; - -extern size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale* lc); -/* ANDROID-END */ - extern char *ctime(const time_t *timep); extern char *ctime_r(const time_t *timep, char *buf); diff --git a/build/platforms/android-8/arch-x86/usr/include/time64.h b/build/platforms/android-8/arch-x86/usr/include/time64.h index 9da4bc702..7ec05af65 100644 --- a/build/platforms/android-8/arch-x86/usr/include/time64.h +++ b/build/platforms/android-8/arch-x86/usr/include/time64.h @@ -31,9 +31,12 @@ Modified for Bionic by the Android Open Source Project #ifndef TIME64_H #define TIME64_H +#include <sys/cdefs.h> #include <time.h> #include <stdint.h> +__BEGIN_DECLS + typedef int64_t time64_t; struct tm *gmtime64_r (const time64_t *, struct tm *); @@ -51,4 +54,6 @@ time64_t timegm64 (const struct tm *); time64_t mktime64 (const struct tm *); time64_t timelocal64 (const struct tm *); +__END_DECLS + #endif /* TIME64_H */ diff --git a/build/platforms/android-8/arch-x86/usr/include/unistd.h b/build/platforms/android-8/arch-x86/usr/include/unistd.h index 1ada37e51..b4f1dda17 100644 --- a/build/platforms/android-8/arch-x86/usr/include/unistd.h +++ b/build/platforms/android-8/arch-x86/usr/include/unistd.h @@ -99,6 +99,10 @@ extern int setfsuid(uid_t); extern int issetugid(void); extern char* getlogin(void); extern int getlogin_r(char* name, size_t namesize); +extern char* getusershell(void); +extern void setusershell(void); +extern void endusershell(void); + /* Macros for access() */ @@ -145,7 +149,7 @@ extern int ftruncate(int, off_t); extern int pause(void); extern unsigned int alarm(unsigned int); extern unsigned int sleep(unsigned int); -extern void usleep(unsigned long); +extern int usleep(unsigned long); extern int gethostname(char *, size_t); extern int sethostname(const char *, size_t); @@ -163,6 +167,8 @@ extern char *optarg; extern int optind, opterr, optopt; extern int isatty(int); +extern char* ttyname(int); +extern int ttyname_r(int, char*, size_t); extern int acct(const char* filepath); @@ -185,6 +191,14 @@ extern int cacheflush(long start, long end, long flags); extern pid_t tcgetpgrp(int fd); extern int tcsetpgrp(int fd, pid_t _pid); +/* Used to retry syscalls that can return EINTR. */ +#define TEMP_FAILURE_RETRY(exp) ({ \ + typeof (exp) _rc; \ + do { \ + _rc = (exp); \ + } while (_rc == -1 && errno == EINTR); \ + _rc; }) + __END_DECLS #endif /* _UNISTD_H_ */ diff --git a/build/platforms/android-8/arch-x86/usr/include/wchar.h b/build/platforms/android-8/arch-x86/usr/include/wchar.h index e2feb6002..97e1b5c4c 100644 --- a/build/platforms/android-8/arch-x86/usr/include/wchar.h +++ b/build/platforms/android-8/arch-x86/usr/include/wchar.h @@ -100,6 +100,7 @@ extern int mbsinit(const mbstate_t *); extern size_t mbrlen(const char *, size_t, mbstate_t *); extern size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); extern size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); +extern size_t mbstowcs(wchar_t *, const char *, size_t); extern wint_t putwc(wchar_t, FILE *); extern wint_t putwchar(wchar_t); extern int swprintf(wchar_t *, size_t, const wchar_t *, ...); @@ -130,6 +131,7 @@ extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); extern double wcstod(const wchar_t *, wchar_t **); extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **); extern long int wcstol(const wchar_t *, wchar_t **, int); +extern size_t wcstombs(char *, const wchar_t *, size_t); extern unsigned long int wcstoul(const wchar_t *, wchar_t **, int); extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); extern int wcswidth(const wchar_t *, size_t); diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index 84e1d3473..dc46b6ca0 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -119,6 +119,43 @@ OTHER FIXES & CHANGES: - removed the annoying 'the mangling of 'va_list' has changed in GCC 4.4' warning when building with GCC 4.4.0 for ARM. +- C Library header fixes: + + For all platforms: + + - <arpa/inet.h>: no longer includes <netinet/in6.h>. + - <ctype.h>: better inlining with -ansi option. + - <mntent.h>: add missing include for <stdio.h>. + - <netinet/in.h>: include <netinet/in6.h> and define in6addr_any + + in6addr_loopback. + - <netinet/in6.h>: add IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP, + IN6ADDR_ANY_INIT, ipv6mr_interface. + - <sys/epoll.h>: add missing C++ inclusion guards. + - <sys/resource.h>: add missing rlim_t declaration. + - <sys/system_properties.h>: add missing C++ inclusion guards. + - <time64.h>: add missing C++ inclusion guards. + - <netdb.h>: move h_errno declaration inside C++ inclusion guards. + +- C Library changes: + + For android-8 (a.k.a. Android 2.2): + + - <dlfcn.h>: add DL_info and dladdr(). + - <err.h>: add err(), warn() and other variants. + - <regex.h>, <fts.h>, <sys/queue.h>: added + - <pthread.h>: add pthread_condattr_t + - <sched.h>: added proper clone() declaration (and implementation). + - <signal.h>: added killpg(). + - <stdio.h>: add fdprintf() and vfdprintf(). + - <stdlib.h>: fix ptsname_r() signature in declaration. previous + implementation was broken anyway. + - <unistd.h>: add getusershell(), setusershell(), endusershell(), + ttyname(), ttyname_r(), TEMP_FAILURE_RETRY. Fix usleep() signature + (now returns int). + - <wchar.h>: add fake mbstowcs() and wcstombs(). + + More details available under docs/system/libc/CHANGES.TXT + ------------------------------------------------------------------------------- android-ndk-r3 diff --git a/docs/system/libc/CHANGES.TXT b/docs/system/libc/CHANGES.TXT new file mode 100644 index 000000000..90806851a --- /dev/null +++ b/docs/system/libc/CHANGES.TXT @@ -0,0 +1,174 @@ +Bionic ChangeLog: +----------------- + +Differences between current and Android 2.1: + +- Add support for SH-4 CPU architecture ! + +- __atomic_swap(): use LDREX/STREX CPU instructions on ARMv6 and higher. + +- <arpa/telnet.h>: New header (declarations only, no implementation). + +- <err.h>: New header + implementation. GLibc compatibility. + +- <warn.h>: New header + implementation. GLibc compatibility. + +- <fts.h>: New header + implementation. + +- <mntent.h>: Add missing <stdio.h> include. + +- <regex.h>: New header + implementation. + +- <signal.h>: Added killpg() + +- <stdint.h>: Allow 64-bit type declarations on C99 builds. + +- <stdio.h>: Add fdprintf() and vfdprintf(). Note that GLibc provides + the confusing 'dprintf' and 'vdprintf()' functions instead. + +- <stdlib.h>: Fix ptsname_r(): the return type is int instead of char*. + The mistake comes from a GLibc man page bug (the man page listed a return + type of char*, while the implementation used int. Fixed in late 2009 only). + The Bionic implementation was incorrect. Technically, this is an ABI + breakage, but code that used this function probably never worked or + compiled properly anyway. + +- <strings.h>: Add missing <sys/types.h> include. + +- <sys/queue.h>: Added new header (no implementation - macro templates). + +- <sys/resource.h>: Add rlim_t proper definition. + +- <time64.h>: Add missing C++ header inclusion guards. + +- <unistd.h>: Add getusershell(), setusershell() and endusershell(), though + implementation are bogus. GLibc compatibility. + +- <wchar.h>: Add mbstowcs() and wcstombs() + +- add clone() implementation for ARM (x86 and SH-4 not working yet). + +- <sys/epoll.h>: <sys/system_properties.h>: Add missing C++ inclusion guards + +- fix getpwnam() and getpwgrp() to accept "app_0" as a valid user name. + +- fix sem_trywait() to return -1 and set errno to EAGAIN, instead of + returning EAGAIN directly. + +- fix sem_post() to wake up multiple threads when called rapidly in + succession. + +- DNS: partial implementation of RFC3484 (rule 1, 2, 5, 6, 8, 10 and + modified rule 9), for better address selection/sorting. + In the process, removed code that was previously used for "sortlist" + in /etc/resolv.conf. (resolv.conf is already ignored, so the latter + is a no-op for actual functionality.) + +- fix pthread_sigmask() to properly return an error code without touching + errno. Previous implementation returned -1 on error, setting errno, which + is not Posix compliant. + +- add sigaltstack() implementation for ARM. + +- <time.h>: Properly implement the 'timezone' and 'daylight' global variables + (they were not defined previously, though declared in the header). + +- <time.h>: Fix timezone management implementation to properly update + 'tm_gmtoff' field in 'struct tm' structure. + +- DNS: get rid of spurious random DNS queries when trying to resolve + an unknown domain name. Due to an initialization bug, a random DNS search + list was generated for each thread if net.dns.search is not defined. + +- <pthread.h>: Add pthread_condattr_init/destroy/setpshared/getpshared functions + to enable proper shared conditional variable initialization. + + Modify the pthread_mutex_t and pthread_cond_t implementation to use private + futexes for performance reasons. Mutexes and Condvars are no longer shareable + between processes by default anymore, unless you use PTHREAD_PROCESS_SHARED + with pthread_mutexattr_setpshared() and/or pthread_condattr_setpshared(). + +------------------------------------------------------------------------------- +Differences between Android 2.1 and 2.0.1: + +- zoneinfo: updated data tables to version 2009s + + +------------------------------------------------------------------------------- +Differences between Android 2.0.1 and 2.0: + +- abort(): ARM-specific hack to preserve the 'lr' register when abort() + is called (GCC does not preserve it by default since it thinks that + abort() never returns). This improves stack traces considerably. + + +------------------------------------------------------------------------------- +Differences between Android 2.0 and 1.6: + +- memcmp(), memcpy(): ARMv7 optimized versions. + +- pthread_mutexattr_setpshared(): implementation will not return ENOTSUP + if PTHREAD_PROCESS_SHARED is used, because our Mutex implementation can + work across multiple processes. + + *HOWEVER* it does not use "robust futexes" which means that held mutexes + *are not* automatically released by the kernel when the owner process + crashes or exits. This is only done to simplify communication between + two always-live system processes, DO NOT USE THIS IN APPLICATIONS ! + +- pthread_mutex_lock_timeout_np(): New Android-specific function to + perform a timed lock (). In case of timeout, it returns EBUSY. + +- pthread_cond_timedwait_monotonic_np(): Same as pthread_cond_timedwait() + but uses the monotonic clock(). Android-specific. + +- pthread_cond_timedwait_relative_np(): Same as pthread_cond_timedwait() + but uses a relative timeout instead. Android-specific. + +- <netinet/in.h>: Now includes <netinet/in6.h>. + +- <netinet/in6.h>: Added IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP, IN6ADDR_ANY_INIT + and ipv6mr_interface definitions. + +- <time.h>: + * Add missing tzset() declaration. + * Add Android-specific strftime_tz(). + +- getaddrinfo(): + Only perform IPv6 lookup for AF_UNSPEC if we have IPv6 connectivity. + This saves one DNS query per lookup on non-IPv6 systems. + +- mktime(): Fix an infinite loop problen that appeared when switching to + GCC 4.4.0. + +- strftime(): fix incorrect handling of dates > 2038 due to 64-bit issue + in original code. + +------------------------------------------------------------------------------- +Differences between Android 1.6 and 1.5: + +- C runtime: Fix runtime initialization to be called before any static C++ + constructors. This allows these to use pthread functions properly. + +- __aeabi_atexit(): Fix implementation to properly call C++ static destructors + when the program exits (or when a shared library is unloaded). + +- <sys/stat.h>: added GLibc compatibility macros definitions: + + #define st_atimensec st_atime_nsec + #define st_mtimensec st_mtime_nsec + #define st_ctimensec st_ctime_nsec + +- getaddrinfo(): implementation will now allow numeric ports if ai_socktype is + set to ANY. This is to match the GLibc behaviour. + +- getservent(): and getservent_r() incorrectly returned the port in host-endian + order in the s_port field. It now returns it in big-endian order. + +- DNS: Allow underscore in the middle of DNS labels. While not really + standard, this extension is needed for some VPN configurations and is + supported by other operating systems. + +- DNS: Support for DNS domain search lists through the new net.dns.search + system property. The corresponding value must be a space-separated list of + domain suffixes. |