diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-01-28 21:07:49 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2014-01-28 21:47:33 +0800 |
commit | cf138744ee2efefa4cd02ace5bedcdc56d750ad5 (patch) | |
tree | 89941b8b347192f6ddb45514612ac0e768892282 /9/platforms/android-19/arch-arm64/usr/include/sys | |
parent | 0fe85d4f67353d8f616fabc9ea20252e41b2d606 (diff) | |
download | prebuilts_ndk-cf138744ee2efefa4cd02ace5bedcdc56d750ad5.zip prebuilts_ndk-cf138744ee2efefa4cd02ace5bedcdc56d750ad5.tar.gz prebuilts_ndk-cf138744ee2efefa4cd02ace5bedcdc56d750ad5.tar.bz2 |
Add experimental arm64 and x86_64 headers and stlport
Change-Id: If40f9c1f36d56dbf251a3bfd0be6818c1ea1b958
Diffstat (limited to '9/platforms/android-19/arch-arm64/usr/include/sys')
76 files changed, 9417 insertions, 0 deletions
diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/_errdefs.h b/9/platforms/android-19/arch-arm64/usr/include/sys/_errdefs.h new file mode 100644 index 0000000..3eeadf4 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/_errdefs.h @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* the following corresponds to the error codes of the Linux kernel used by the Android platform + * these are distinct from the OpenBSD ones, which is why we need to redeclare them here + * + * this file may be included several times to define either error constants or their + * string representation + */ + +#ifndef __BIONIC_ERRDEF +#error "__BIONIC_ERRDEF must be defined before including this file" +#endif +__BIONIC_ERRDEF( 0 , 0, "Success" ) +__BIONIC_ERRDEF( EPERM , 1, "Operation not permitted" ) +__BIONIC_ERRDEF( ENOENT , 2, "No such file or directory" ) +__BIONIC_ERRDEF( ESRCH , 3, "No such process" ) +__BIONIC_ERRDEF( EINTR , 4, "Interrupted system call" ) +__BIONIC_ERRDEF( EIO , 5, "I/O error" ) +__BIONIC_ERRDEF( ENXIO , 6, "No such device or address" ) +__BIONIC_ERRDEF( E2BIG , 7, "Argument list too long" ) +__BIONIC_ERRDEF( ENOEXEC , 8, "Exec format error" ) +__BIONIC_ERRDEF( EBADF , 9, "Bad file number" ) +__BIONIC_ERRDEF( ECHILD , 10, "No child processes" ) +__BIONIC_ERRDEF( EAGAIN , 11, "Try again" ) +__BIONIC_ERRDEF( ENOMEM , 12, "Out of memory" ) +__BIONIC_ERRDEF( EACCES , 13, "Permission denied" ) +__BIONIC_ERRDEF( EFAULT , 14, "Bad address" ) +__BIONIC_ERRDEF( ENOTBLK , 15, "Block device required" ) +__BIONIC_ERRDEF( EBUSY , 16, "Device or resource busy" ) +__BIONIC_ERRDEF( EEXIST , 17, "File exists" ) +__BIONIC_ERRDEF( EXDEV , 18, "Cross-device link" ) +__BIONIC_ERRDEF( ENODEV , 19, "No such device" ) +__BIONIC_ERRDEF( ENOTDIR , 20, "Not a directory" ) +__BIONIC_ERRDEF( EISDIR , 21, "Is a directory" ) +__BIONIC_ERRDEF( EINVAL , 22, "Invalid argument" ) +__BIONIC_ERRDEF( ENFILE , 23, "File table overflow" ) +__BIONIC_ERRDEF( EMFILE , 24, "Too many open files" ) +__BIONIC_ERRDEF( ENOTTY , 25, "Not a typewriter" ) +__BIONIC_ERRDEF( ETXTBSY , 26, "Text file busy" ) +__BIONIC_ERRDEF( EFBIG , 27, "File too large" ) +__BIONIC_ERRDEF( ENOSPC , 28, "No space left on device" ) +__BIONIC_ERRDEF( ESPIPE , 29, "Illegal seek" ) +__BIONIC_ERRDEF( EROFS , 30, "Read-only file system" ) +__BIONIC_ERRDEF( EMLINK , 31, "Too many links" ) +__BIONIC_ERRDEF( EPIPE , 32, "Broken pipe" ) +__BIONIC_ERRDEF( EDOM , 33, "Math argument out of domain of func" ) +__BIONIC_ERRDEF( ERANGE , 34, "Math result not representable" ) +__BIONIC_ERRDEF( EDEADLK , 35, "Resource deadlock would occur" ) +__BIONIC_ERRDEF( ENAMETOOLONG , 36, "File name too long" ) +__BIONIC_ERRDEF( ENOLCK , 37, "No record locks available" ) +__BIONIC_ERRDEF( ENOSYS , 38, "Function not implemented" ) +__BIONIC_ERRDEF( ENOTEMPTY , 39, "Directory not empty" ) +__BIONIC_ERRDEF( ELOOP , 40, "Too many symbolic links encountered" ) +__BIONIC_ERRDEF( ENOMSG , 42, "No message of desired type" ) +__BIONIC_ERRDEF( EIDRM , 43, "Identifier removed" ) +__BIONIC_ERRDEF( ECHRNG , 44, "Channel number out of range" ) +__BIONIC_ERRDEF( EL2NSYNC , 45, "Level 2 not synchronized" ) +__BIONIC_ERRDEF( EL3HLT , 46, "Level 3 halted" ) +__BIONIC_ERRDEF( EL3RST , 47, "Level 3 reset" ) +__BIONIC_ERRDEF( ELNRNG , 48, "Link number out of range" ) +__BIONIC_ERRDEF( EUNATCH , 49, "Protocol driver not attached" ) +__BIONIC_ERRDEF( ENOCSI , 50, "No CSI structure available" ) +__BIONIC_ERRDEF( EL2HLT , 51, "Level 2 halted" ) +__BIONIC_ERRDEF( EBADE , 52, "Invalid exchange" ) +__BIONIC_ERRDEF( EBADR , 53, "Invalid request descriptor" ) +__BIONIC_ERRDEF( EXFULL , 54, "Exchange full" ) +__BIONIC_ERRDEF( ENOANO , 55, "No anode" ) +__BIONIC_ERRDEF( EBADRQC , 56, "Invalid request code" ) +__BIONIC_ERRDEF( EBADSLT , 57, "Invalid slot" ) +__BIONIC_ERRDEF( EBFONT , 59, "Bad font file format" ) +__BIONIC_ERRDEF( ENOSTR , 60, "Device not a stream" ) +__BIONIC_ERRDEF( ENODATA , 61, "No data available" ) +__BIONIC_ERRDEF( ETIME , 62, "Timer expired" ) +__BIONIC_ERRDEF( ENOSR , 63, "Out of streams resources" ) +__BIONIC_ERRDEF( ENONET , 64, "Machine is not on the network" ) +__BIONIC_ERRDEF( ENOPKG , 65, "Package not installed" ) +__BIONIC_ERRDEF( EREMOTE , 66, "Object is remote" ) +__BIONIC_ERRDEF( ENOLINK , 67, "Link has been severed" ) +__BIONIC_ERRDEF( EADV , 68, "Advertise error" ) +__BIONIC_ERRDEF( ESRMNT , 69, "Srmount error" ) +__BIONIC_ERRDEF( ECOMM , 70, "Communication error on send" ) +__BIONIC_ERRDEF( EPROTO , 71, "Protocol error" ) +__BIONIC_ERRDEF( EMULTIHOP , 72, "Multihop attempted" ) +__BIONIC_ERRDEF( EDOTDOT , 73, "RFS specific error" ) +__BIONIC_ERRDEF( EBADMSG , 74, "Not a data message" ) +__BIONIC_ERRDEF( EOVERFLOW , 75, "Value too large for defined data type" ) +__BIONIC_ERRDEF( ENOTUNIQ , 76, "Name not unique on network" ) +__BIONIC_ERRDEF( EBADFD , 77, "File descriptor in bad state" ) +__BIONIC_ERRDEF( EREMCHG , 78, "Remote address changed" ) +__BIONIC_ERRDEF( ELIBACC , 79, "Can not access a needed shared library" ) +__BIONIC_ERRDEF( ELIBBAD , 80, "Accessing a corrupted shared library" ) +__BIONIC_ERRDEF( ELIBSCN , 81, ".lib section in a.out corrupted" ) +__BIONIC_ERRDEF( ELIBMAX , 82, "Attempting to link in too many shared libraries" ) +__BIONIC_ERRDEF( ELIBEXEC , 83, "Cannot exec a shared library directly" ) +__BIONIC_ERRDEF( EILSEQ , 84, "Illegal byte sequence" ) +__BIONIC_ERRDEF( ERESTART , 85, "Interrupted system call should be restarted" ) +__BIONIC_ERRDEF( ESTRPIPE , 86, "Streams pipe error" ) +__BIONIC_ERRDEF( EUSERS , 87, "Too many users" ) +__BIONIC_ERRDEF( ENOTSOCK , 88, "Socket operation on non-socket" ) +__BIONIC_ERRDEF( EDESTADDRREQ , 89, "Destination address required" ) +__BIONIC_ERRDEF( EMSGSIZE , 90, "Message too long" ) +__BIONIC_ERRDEF( EPROTOTYPE , 91, "Protocol wrong type for socket" ) +__BIONIC_ERRDEF( ENOPROTOOPT , 92, "Protocol not available" ) +__BIONIC_ERRDEF( EPROTONOSUPPORT, 93, "Protocol not supported" ) +__BIONIC_ERRDEF( ESOCKTNOSUPPORT, 94, "Socket type not supported" ) +__BIONIC_ERRDEF( EOPNOTSUPP , 95, "Operation not supported on transport endpoint" ) +__BIONIC_ERRDEF( EPFNOSUPPORT , 96, "Protocol family not supported" ) +__BIONIC_ERRDEF( EAFNOSUPPORT , 97, "Address family not supported by protocol" ) +__BIONIC_ERRDEF( EADDRINUSE , 98, "Address already in use" ) +__BIONIC_ERRDEF( EADDRNOTAVAIL , 99, "Cannot assign requested address" ) +__BIONIC_ERRDEF( ENETDOWN , 100, "Network is down" ) +__BIONIC_ERRDEF( ENETUNREACH , 101, "Network is unreachable" ) +__BIONIC_ERRDEF( ENETRESET , 102, "Network dropped connection because of reset" ) +__BIONIC_ERRDEF( ECONNABORTED , 103, "Software caused connection abort" ) +__BIONIC_ERRDEF( ECONNRESET , 104, "Connection reset by peer" ) +__BIONIC_ERRDEF( ENOBUFS , 105, "No buffer space available" ) +__BIONIC_ERRDEF( EISCONN , 106, "Transport endpoint is already connected" ) +__BIONIC_ERRDEF( ENOTCONN , 107, "Transport endpoint is not connected" ) +__BIONIC_ERRDEF( ESHUTDOWN , 108, "Cannot send after transport endpoint shutdown" ) +__BIONIC_ERRDEF( ETOOMANYREFS , 109, "Too many references: cannot splice" ) +__BIONIC_ERRDEF( ETIMEDOUT , 110, "Connection timed out" ) +__BIONIC_ERRDEF( ECONNREFUSED , 111, "Connection refused" ) +__BIONIC_ERRDEF( EHOSTDOWN , 112, "Host is down" ) +__BIONIC_ERRDEF( EHOSTUNREACH , 113, "No route to host" ) +__BIONIC_ERRDEF( EALREADY , 114, "Operation already in progress" ) +__BIONIC_ERRDEF( EINPROGRESS , 115, "Operation now in progress" ) +__BIONIC_ERRDEF( ESTALE , 116, "Stale NFS file handle" ) +__BIONIC_ERRDEF( EUCLEAN , 117, "Structure needs cleaning" ) +__BIONIC_ERRDEF( ENOTNAM , 118, "Not a XENIX named type file" ) +__BIONIC_ERRDEF( ENAVAIL , 119, "No XENIX semaphores available" ) +__BIONIC_ERRDEF( EISNAM , 120, "Is a named type file" ) +__BIONIC_ERRDEF( EREMOTEIO , 121, "Remote I/O error" ) +__BIONIC_ERRDEF( EDQUOT , 122, "Quota exceeded" ) +__BIONIC_ERRDEF( ENOMEDIUM , 123, "No medium found" ) +__BIONIC_ERRDEF( EMEDIUMTYPE , 124, "Wrong medium type" ) +__BIONIC_ERRDEF( ECANCELED , 125, "Operation Canceled" ) +__BIONIC_ERRDEF( ENOKEY , 126, "Required key not available" ) +__BIONIC_ERRDEF( EKEYEXPIRED , 127, "Key has expired" ) +__BIONIC_ERRDEF( EKEYREVOKED , 128, "Key has been revoked" ) +__BIONIC_ERRDEF( EKEYREJECTED , 129, "Key was rejected by service" ) +__BIONIC_ERRDEF( EOWNERDEAD , 130, "Owner died" ) +__BIONIC_ERRDEF( ENOTRECOVERABLE, 131, "State not recoverable" ) + +#undef __BIONIC_ERRDEF diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/_sigdefs.h b/9/platforms/android-19/arch-arm64/usr/include/sys/_sigdefs.h new file mode 100644 index 0000000..eadf7b9 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/_sigdefs.h @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * this header is used to define signal constants and names; + * it might be included several times + */ + +#ifndef __BIONIC_SIGDEF +#error __BIONIC_SIGDEF not defined +#endif + +__BIONIC_SIGDEF(HUP,1,"Hangup") +__BIONIC_SIGDEF(INT,2,"Interrupt") +__BIONIC_SIGDEF(QUIT,3,"Quit") +__BIONIC_SIGDEF(ILL,4,"Illegal instruction") +__BIONIC_SIGDEF(TRAP,5,"Trap") +__BIONIC_SIGDEF(ABRT,6,"Aborted") +#ifdef __mips__ +__BIONIC_SIGDEF(EMT,7,"EMT") +#else +__BIONIC_SIGDEF(BUS,7,"Bus error") +#endif +__BIONIC_SIGDEF(FPE,8,"Floating point exception") +__BIONIC_SIGDEF(KILL,9,"Killed") +#ifdef __mips__ +__BIONIC_SIGDEF(BUS,10,"Bus error") +#else +__BIONIC_SIGDEF(USR1,10,"User signal 1") +#endif +__BIONIC_SIGDEF(SEGV,11,"Segmentation fault") +#ifdef __mips__ +__BIONIC_SIGDEF(SYS,12,"Bad system call") +#else +__BIONIC_SIGDEF(USR2,12,"User signal 2") +#endif +__BIONIC_SIGDEF(PIPE,13,"Broken pipe") +__BIONIC_SIGDEF(ALRM,14,"Alarm clock") +__BIONIC_SIGDEF(TERM,15,"Terminated") +#ifdef __mips__ +__BIONIC_SIGDEF(USR1,16,"User signal 1") +__BIONIC_SIGDEF(USR2,17,"User signal 2") +__BIONIC_SIGDEF(CHLD,18,"Child exited") +__BIONIC_SIGDEF(PWR,19,"Power failure") +__BIONIC_SIGDEF(WINCH,20,"Window size changed") +__BIONIC_SIGDEF(URG,21,"Urgent I/O condition") +__BIONIC_SIGDEF(IO,22,"I/O possible") +__BIONIC_SIGDEF(STOP,23,"Stopped (signal)") +__BIONIC_SIGDEF(TSTP,24,"Stopped") +__BIONIC_SIGDEF(CONT,25,"Continue") +__BIONIC_SIGDEF(TTIN,26,"Stopped (tty input)") +__BIONIC_SIGDEF(TTOU,27,"Stopped (tty output)") +__BIONIC_SIGDEF(VTALRM,28,"Virtual timer expired") +__BIONIC_SIGDEF(PROF,29,"Profiling timer expired") +__BIONIC_SIGDEF(XCPU,30,"CPU time limit exceeded") +__BIONIC_SIGDEF(XFSZ,31,"File size limit exceeded") +#else +__BIONIC_SIGDEF(STKFLT,16,"Stack fault") +__BIONIC_SIGDEF(CHLD,17,"Child exited") +__BIONIC_SIGDEF(CONT,18,"Continue") +__BIONIC_SIGDEF(STOP,19,"Stopped (signal)") +__BIONIC_SIGDEF(TSTP,20,"Stopped") +__BIONIC_SIGDEF(TTIN,21,"Stopped (tty input)") +__BIONIC_SIGDEF(TTOU,22,"Stopped (tty output)") +__BIONIC_SIGDEF(URG,23,"Urgent I/O condition") +__BIONIC_SIGDEF(XCPU,24,"CPU time limit exceeded") +__BIONIC_SIGDEF(XFSZ,25,"File size limit exceeded") +__BIONIC_SIGDEF(VTALRM,26,"Virtual timer expired") +__BIONIC_SIGDEF(PROF,27,"Profiling timer expired") +__BIONIC_SIGDEF(WINCH,28,"Window size changed") +__BIONIC_SIGDEF(IO,29,"I/O possible") +__BIONIC_SIGDEF(PWR,30,"Power failure") +__BIONIC_SIGDEF(SYS,31,"Bad system call") +#endif + +#undef __BIONIC_SIGDEF diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/_system_properties.h b/9/platforms/android-19/arch-arm64/usr/include/sys/_system_properties.h new file mode 100644 index 0000000..5eee7f0 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/_system_properties.h @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _INCLUDE_SYS__SYSTEM_PROPERTIES_H +#define _INCLUDE_SYS__SYSTEM_PROPERTIES_H + +#ifndef _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#error you should #include <sys/system_properties.h> instead +#else +#include <sys/system_properties.h> + +typedef struct prop_msg prop_msg; + +#define PROP_AREA_MAGIC 0x504f5250 +#define PROP_AREA_VERSION 0xfc6ed0ab +#define PROP_AREA_VERSION_COMPAT 0x45434f76 + +#define PROP_SERVICE_NAME "property_service" +#define PROP_FILENAME "/dev/__properties__" + +#define PA_SIZE (128 * 1024) + +#define SERIAL_VALUE_LEN(serial) ((serial) >> 24) +#define SERIAL_DIRTY(serial) ((serial) & 1) + +__BEGIN_DECLS + +struct prop_msg +{ + unsigned cmd; + char name[PROP_NAME_MAX]; + char value[PROP_VALUE_MAX]; +}; + +#define PROP_MSG_SETPROP 1 + +/* +** Rules: +** +** - there is only one writer, but many readers +** - prop_area.count will never decrease in value +** - once allocated, a prop_info's name will not change +** - once allocated, a prop_info's offset will not change +** - reading a value requires the following steps +** 1. serial = pi->serial +** 2. if SERIAL_DIRTY(serial), wait*, then goto 1 +** 3. memcpy(local, pi->value, SERIAL_VALUE_LEN(serial) + 1) +** 4. if pi->serial != serial, goto 2 +** +** - writing a value requires the following steps +** 1. pi->serial = pi->serial | 1 +** 2. memcpy(pi->value, local_value, value_len) +** 3. pi->serial = (value_len << 24) | ((pi->serial + 1) & 0xffffff) +*/ + +#define PROP_PATH_RAMDISK_DEFAULT "/default.prop" +#define PROP_PATH_SYSTEM_BUILD "/system/build.prop" +#define PROP_PATH_SYSTEM_DEFAULT "/system/default.prop" +#define PROP_PATH_LOCAL_OVERRIDE "/data/local.prop" +#define PROP_PATH_FACTORY "/factory/factory.prop" + +/* +** Map the property area from the specified filename. This +** method is for testing only. +*/ +int __system_property_set_filename(const char *filename); + +/* +** Initialize the area to be used to store properties. Can +** only be done by a single process that has write access to +** the property area. +*/ +int __system_property_area_init(); + +/* Add a new system property. Can only be done by a single +** process that has write access to the property area, and +** that process must handle sequencing to ensure the property +** does not already exist and that only one property is added +** or updated at a time. +** +** Returns 0 on success, -1 if the property area is full. +*/ +int __system_property_add(const char *name, unsigned int namelen, + const char *value, unsigned int valuelen); + +/* Update the value of a system property returned by +** __system_property_find. Can only be done by a single process +** that has write access to the property area, and that process +** must handle sequencing to ensure that only one property is +** updated at a time. +** +** Returns 0 on success, -1 if the parameters are incorrect. +*/ +int __system_property_update(prop_info *pi, const char *value, unsigned int len); + +/* Read the serial number of a system property returned by +** __system_property_find. +** +** Returns the serial number on success, -1 on error. +*/ +unsigned int __system_property_serial(const prop_info *pi); + +/* Wait for any system property to be updated. Caller must pass +** in 0 the first time, and the previous return value on each +** successive call. */ +unsigned int __system_property_wait_any(unsigned int serial); + +/* Compatibility functions to support using an old init with a new libc, + ** mostly for the OTA updater binary. These can be deleted once OTAs from + ** a pre-K release no longer needed to be supported. */ +const prop_info *__system_property_find_compat(const char *name); +int __system_property_read_compat(const prop_info *pi, char *name, char *value); +int __system_property_foreach_compat( + void (*propfn)(const prop_info *pi, void *cookie), + void *cookie); + +__END_DECLS + +#endif +#endif diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/_types.h b/9/platforms/android-19/arch-arm64/usr/include/sys/_types.h new file mode 100644 index 0000000..9d313d1 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/_types.h @@ -0,0 +1,68 @@ +/* $OpenBSD: _types.h,v 1.1 2006/01/06 18:53:05 millert Exp $ */ + +/*- + * Copyright (c) 1990, 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. + * + * @(#)types.h 8.3 (Berkeley) 1/5/94 + */ + +#ifndef _SYS__TYPES_H_ +#define _SYS__TYPES_H_ + +#include <machine/_types.h> + +typedef unsigned long __cpuid_t; /* CPU id */ +typedef __uint32_t __fixpt_t; /* fixed point number */ +typedef __uint32_t __gid_t; /* group id */ +typedef __uint32_t __id_t; /* may contain pid, uid or gid */ +typedef __uint32_t __in_addr_t; /* base type for internet address */ +typedef __uint16_t __in_port_t; /* IP port type */ +typedef __uint32_t __ino_t; /* inode number */ +typedef long __key_t; /* IPC key (for Sys V IPC) */ +typedef __uint32_t __mode_t; /* permissions */ +typedef __uint32_t __nlink_t; /* link count */ +typedef __int32_t __pid_t; /* process id */ +typedef __uint64_t __rlim_t; /* resource limit */ +typedef __uint16_t __sa_family_t; /* sockaddr address family type */ +typedef __int32_t __segsz_t; /* segment size */ +typedef __uint32_t __socklen_t; /* length type for network syscalls */ +typedef __int32_t __swblk_t; /* swap offset */ +typedef __uint32_t __uid_t; /* user id */ +typedef __uint32_t __useconds_t; /* microseconds */ +typedef __int32_t __suseconds_t; /* microseconds (signed) */ + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t __mbstateL; /* for alignment */ +} __mbstate_t; + +#endif /* !_SYS__TYPES_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/_wchar_limits.h b/9/platforms/android-19/arch-arm64/usr/include/sys/_wchar_limits.h new file mode 100644 index 0000000..644792f --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/_wchar_limits.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS__WCHAR_LIMITS_H +#define _SYS__WCHAR_LIMITS_H + +#include <android/api-level.h> + +/* WCHAR_MIN / WCHAR_MAX can be defined by <stdint.h> or <wchar.h>. + * Due to historical reasons, their definition is a bit complex. + * + * - In NDK r8e and older, all definitions of WCHAR_MIN and WCHAR_MAX + * where 32-bit signed values (with one exception described below), + * despite the fact that wchar_t is 'unsigned' on ARM. + * See http://b.android.com/57749 + * + * This is no longer the case, unless you define _WCHAR_IS_ALWAYS_SIGNED + * at compile time to restore the old (broken) behaviour. This doesn't + * affect other CPU ABIs. + * + * - Before API level 9, on ARM, wchar_t was typedef to 'char' when + * compiling C (not C++). Also, the definitions of WCHAR_MIN and + * WCHAR_MAX differed between <stdint.h> and <wchar.h>: + * + * <stdint.h> conditionally defined them to INT32_MIN / INT32_MAX. + * <wchar.h> conditionally defined them to 0 and 255 instead. + * + * <stdint.h> would only define WCHAR_MIN and WCHAR_MAX when: + * - Compiling C sources. + * - Compiling C++ sources with __STDC_LIMIT_MACROS being defined. + * + * <wchar.h> always ends up including <stdint.h> indirectly. This + * means that: + * + * - When compiling C sources, WCHAR_MIN / WCHAR_MAX were always + * defined as INT32_MIN / INT32_MAX. + * + * - When compiling C++ sources with __STDC_LIMIT_MACROS defined, + * they were always defined to INT32_MIN / INT32_MAX + * + * - When compiling C++ sources without __STDC_LIMIT_MACROS defined, + * they were defined by <wchar.h> as 0 and 255, respectively. + * + * Keep in mind that this was ARM-specific, only for API level < 9. + * + * If _WCHAR_IS_8BIT is defined, the same broken behaviour will + * be restored. See http://b.android.com/57267 + */ +#if !defined(WCHAR_MIN) + +# if defined(_WCHAR_IS_8BIT) && defined(__arm__) && __ANDROID_API__ < 9 +# if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS) +# define WCHAR_MIN 0 +# define WCHAR_MAX 255 +# else +# define WCHAR_MIN (-2147483647 - 1) +# define WCHAR_MAX (2147483647) +# endif +# elif defined(_WCHAR_IS_ALWAYS_SIGNED) +# define WCHAR_MIN (-2147483647 - 1) +# define WCHAR_MAX (2147483647) +# else + /* Otherwise, the value is derived from the toolchain configuration. + * to avoid putting explicit CPU checks in this header. */ +# ifndef __WCHAR_MAX__ +# error "__WCHAR_MAX__ is not defined. Check your toolchain!" +# endif + /* Clang does define __WCHAR_MAX__, but not __WCHAR_MIN__ */ +# ifndef __WCHAR_MIN__ +# if __WCHAR_MAX__ == 4294967295 +# define __WCHAR_MIN__ (0U) +# elif __WCHAR_MAX__ == 2147483647 +# define __WCHAR_MIN__ (-2147483647 - 1) +# else +# error "Invalid __WCHAR_MAX__ value. Check your toolchain!" +# endif +# endif /* !__WCHAR_MIN__ */ +# define WCHAR_MIN __WCHAR_MIN__ +# define WCHAR_MAX __WCHAR_MAX__ +# endif /* !_WCHAR_IS_ALWAYS_SIGNED */ + +#endif /* !WCHAR_MIN */ + +#endif /* _SYS__WCHAR_LIMITS_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/atomics.h b/9/platforms/android-19/arch-arm64/usr/include/sys/atomics.h new file mode 100644 index 0000000..143bc4b --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/atomics.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_ATOMICS_H +#define _SYS_ATOMICS_H + +#include <sys/cdefs.h> +#include <sys/time.h> + +__BEGIN_DECLS + +/* Note: atomic operations that were exported by the C library didn't + * provide any memory barriers, which created potential issues on + * multi-core devices. We now define them as inlined calls to + * GCC sync builtins, which always provide a full barrier. + * + * NOTE: The C library still exports atomic functions by the same + * name to ensure ABI stability for existing NDK machine code. + * + * If you are an NDK developer, we encourage you to rebuild your + * unmodified sources against this header as soon as possible. + */ +#define __ATOMIC_INLINE__ static __inline__ __attribute__((always_inline)) + +__ATOMIC_INLINE__ int +__atomic_cmpxchg(int old_value, int new_value, volatile int* ptr) +{ + /* We must return 0 on success */ + return __sync_val_compare_and_swap(ptr, old_value, new_value) != old_value; +} + +__ATOMIC_INLINE__ int +__atomic_swap(int new_value, volatile int *ptr) +{ + int old_value; + do { + old_value = *ptr; + } while (__sync_val_compare_and_swap(ptr, old_value, new_value) != old_value); + return old_value; +} + +__ATOMIC_INLINE__ int +__atomic_dec(volatile int *ptr) +{ + return __sync_fetch_and_sub (ptr, 1); +} + +__ATOMIC_INLINE__ int +__atomic_inc(volatile int *ptr) +{ + return __sync_fetch_and_add (ptr, 1); +} + + +int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout); +int __futex_wake(volatile void *ftx, int count); + +__END_DECLS + +#endif /* _SYS_ATOMICS_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/auxv.h b/9/platforms/android-19/arch-arm64/usr/include/sys/auxv.h new file mode 100644 index 0000000..0d753c3 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/auxv.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_AUXV_H_ +#define _SYS_AUXV_H_ + +#include <linux/auxvec.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +unsigned long int getauxval(unsigned long int type); + +__END_DECLS + +#endif /* _SYS_AUXV_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/cachectl.h b/9/platforms/android-19/arch-arm64/usr/include/sys/cachectl.h new file mode 100644 index 0000000..57e6ae7 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/cachectl.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#ifdef __mips__ +#include <asm/cachectl.h> +extern int __cachectl (void *addr, __const int nbytes, __const int op); +extern int _flush_cache (char *addr, __const int nbytes, __const int op); +#endif +#endif /* sys/cachectl.h */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/capability.h b/9/platforms/android-19/arch-arm64/usr/include/sys/capability.h new file mode 100644 index 0000000..7718a6c --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/capability.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _BIONIC_SYS_CAPABILITY_H +#define _BIONIC_SYS_CAPABILITY_H + +#include <sys/cdefs.h> +#include <linux/capability.h> + +__BEGIN_DECLS + +extern int capget(cap_user_header_t hdrp, cap_user_data_t datap); +extern int capset(cap_user_header_t hdrp, const cap_user_data_t datap); + +__END_DECLS + +#endif /* _BIONIC_SYS_CAPABILITY_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/cdefs.h b/9/platforms/android-19/arch-arm64/usr/include/sys/cdefs.h new file mode 100644 index 0000000..7c8f7bf --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/cdefs.h @@ -0,0 +1,568 @@ +/* $NetBSD: cdefs.h,v 1.58 2004/12/11 05:59:00 christos Exp $ */ + +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * 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. + * + * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + */ + +#ifndef _SYS_CDEFS_H_ +#define _SYS_CDEFS_H_ + +/* + * Macro to test if we're using a GNU C compiler of a specific vintage + * or later, for e.g. features that appeared in a particular version + * of GNU C. Usage: + * + * #if __GNUC_PREREQ__(major, minor) + * ...cool feature... + * #else + * ...delete feature... + * #endif + */ +#ifdef __GNUC__ +#define __GNUC_PREREQ__(x, y) \ + ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \ + (__GNUC__ > (x))) +#else +#define __GNUC_PREREQ__(x, y) 0 +#endif + +#include <sys/cdefs_elf.h> + +#if defined(__cplusplus) +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#define __static_cast(x,y) static_cast<x>(y) +#else +#define __BEGIN_DECLS +#define __END_DECLS +#define __static_cast(x,y) (x)y +#endif + +/* + * The __CONCAT macro is used to concatenate parts of symbol names, e.g. + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * The __CONCAT macro is a bit tricky -- make sure you don't put spaces + * in between its arguments. __CONCAT can also concatenate double-quoted + * strings produced by the __STRING macro, but this only works with ANSI C. + */ + +#define ___STRING(x) __STRING(x) +#define ___CONCAT(x,y) __CONCAT(x,y) + +#if defined(__STDC__) || defined(__cplusplus) +#define __P(protos) protos /* full-blown ANSI C */ +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +#define __const const /* define reserved names to standard */ +#define __signed signed +#define __volatile volatile +#if defined(__cplusplus) +#define __inline inline /* convert to C++ keyword */ +#else +#if !defined(__GNUC__) && !defined(__lint__) +#define __inline /* delete GCC keyword */ +#endif /* !__GNUC__ && !__lint__ */ +#endif /* !__cplusplus */ + +#else /* !(__STDC__ || __cplusplus) */ +#define __P(protos) () /* traditional C preprocessor */ +#define __CONCAT(x,y) x/**/y +#define __STRING(x) "x" + +#ifndef __GNUC__ +#define __const /* delete pseudo-ANSI C keywords */ +#define __inline +#define __signed +#define __volatile +#endif /* !__GNUC__ */ + +/* + * In non-ANSI C environments, new programs will want ANSI-only C keywords + * deleted from the program and old programs will want them left alone. + * Programs using the ANSI C keywords const, inline etc. as normal + * identifiers should define -DNO_ANSI_KEYWORDS. + */ +#ifndef NO_ANSI_KEYWORDS +#define const __const /* convert ANSI C keywords */ +#define inline __inline +#define signed __signed +#define volatile __volatile +#endif /* !NO_ANSI_KEYWORDS */ +#endif /* !(__STDC__ || __cplusplus) */ + +/* + * Used for internal auditing of the NetBSD source tree. + */ +#ifdef __AUDIT__ +#define __aconst __const +#else +#define __aconst +#endif + +/* + * The following macro is used to remove const cast-away warnings + * from gcc -Wcast-qual; it should be used with caution because it + * can hide valid errors; in particular most valid uses are in + * situations where the API requires it, not to cast away string + * constants. We don't use *intptr_t on purpose here and we are + * explicit about unsigned long so that we don't have additional + * dependencies. + */ +#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) + +/* + * GCC2 provides __extension__ to suppress warnings for various GNU C + * language extensions under "-ansi -pedantic". + */ +#if !__GNUC_PREREQ__(2, 0) +#define __extension__ /* delete __extension__ if non-gcc or gcc1 */ +#endif + +/* + * GCC1 and some versions of GCC2 declare dead (non-returning) and + * pure (no side effects) functions using "volatile" and "const"; + * unfortunately, these then cause warnings under "-ansi -pedantic". + * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of + * these work for GNU C++ (modulo a slight glitch in the C++ grammar + * in the distribution version of 2.5.5). + */ +#if !__GNUC_PREREQ__(2, 5) +#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#define __dead __volatile +#define __pure __const +#endif +#endif + +/* Delete pseudo-keywords wherever they are not available or needed. */ +#ifndef __dead +#define __dead +#define __pure +#endif + +#if __GNUC_PREREQ__(2, 7) +#define __unused __attribute__((__unused__)) +#else +#define __unused /* delete */ +#endif + +#define __pure2 __attribute__((__const__)) /* Android-added: used by FreeBSD libm */ + +#if __GNUC_PREREQ__(3, 1) +#define __used __attribute__((__used__)) +#else +#define __used /* delete */ +#endif + +#if __GNUC_PREREQ__(2, 7) +#define __packed __attribute__((__packed__)) +#define __aligned(x) __attribute__((__aligned__(x))) +#define __section(x) __attribute__((__section__(x))) +#elif defined(__lint__) +#define __packed /* delete */ +#define __aligned(x) /* delete */ +#define __section(x) /* delete */ +#else +#define __packed error: no __packed for this compiler +#define __aligned(x) error: no __aligned for this compiler +#define __section(x) error: no __section for this compiler +#endif + +#if !__GNUC_PREREQ__(2, 8) +#define __extension__ +#endif + +#if __GNUC_PREREQ__(2, 8) +#define __statement(x) __extension__(x) +#elif defined(lint) +#define __statement(x) (0) +#else +#define __statement(x) (x) +#endif + +#define __nonnull(args) __attribute__((__nonnull__ args)) + +#define __printflike(x, y) __attribute__((__format__(printf, x, y))) __nonnull((x)) +#define __scanflike(x, y) __attribute__((__format__(scanf, x, y))) __nonnull((x)) + +/* + * C99 defines the restrict type qualifier keyword, which was made available + * in GCC 2.92. + */ +#if defined(__STDC__VERSION__) && __STDC_VERSION__ >= 199901L +#define __restrict restrict +#else +#if !__GNUC_PREREQ__(2, 92) +#define __restrict /* delete __restrict when not supported */ +#endif +#endif + +/* + * C99 defines __func__ predefined identifier, which was made available + * in GCC 2.95. + */ +#if !defined(__STDC_VERSION__) || !(__STDC_VERSION__ >= 199901L) +#if __GNUC_PREREQ__(2, 6) +#define __func__ __PRETTY_FUNCTION__ +#elif __GNUC_PREREQ__(2, 4) +#define __func__ __FUNCTION__ +#else +#define __func__ "" +#endif +#endif /* !(__STDC_VERSION__ >= 199901L) */ + +#if defined(_KERNEL) +#if defined(NO_KERNEL_RCSIDS) +#undef __KERNEL_RCSID +#define __KERNEL_RCSID(_n, _s) /* nothing */ +#endif /* NO_KERNEL_RCSIDS */ +#endif /* _KERNEL */ + +#if !defined(_STANDALONE) && !defined(_KERNEL) +#ifdef __GNUC__ +#define __RENAME(x) ___RENAME(x) +#else +#ifdef __lint__ +#define __RENAME(x) __symbolrename(x) +#else +#error "No function renaming possible" +#endif /* __lint__ */ +#endif /* __GNUC__ */ +#else /* _STANDALONE || _KERNEL */ +#define __RENAME(x) no renaming in kernel or standalone environment +#endif + +/* + * A barrier to stop the optimizer from moving code or assume live + * register values. This is gcc specific, the version is more or less + * arbitrary, might work with older compilers. + */ +#if __GNUC_PREREQ__(2, 95) +#define __insn_barrier() __asm __volatile("":::"memory") +#else +#define __insn_barrier() /* */ +#endif + +/* + * GNU C version 2.96 adds explicit branch prediction so that + * the CPU back-end can hint the processor and also so that + * code blocks can be reordered such that the predicted path + * sees a more linear flow, thus improving cache behavior, etc. + * + * The following two macros provide us with a way to use this + * compiler feature. Use __predict_true() if you expect the expression + * to evaluate to true, and __predict_false() if you expect the + * expression to evaluate to false. + * + * A few notes about usage: + * + * * Generally, __predict_false() error condition checks (unless + * you have some _strong_ reason to do otherwise, in which case + * document it), and/or __predict_true() `no-error' condition + * checks, assuming you want to optimize for the no-error case. + * + * * Other than that, if you don't know the likelihood of a test + * succeeding from empirical or other `hard' evidence, don't + * make predictions. + * + * * These are meant to be used in places that are run `a lot'. + * It is wasteful to make predictions in code that is run + * seldomly (e.g. at subsystem initialization time) as the + * basic block reordering that this affects can often generate + * larger code. + */ +#if __GNUC_PREREQ__(2, 96) +#define __predict_true(exp) __builtin_expect((exp) != 0, 1) +#define __predict_false(exp) __builtin_expect((exp) != 0, 0) +#else +#define __predict_true(exp) (exp) +#define __predict_false(exp) (exp) +#endif + +#if __GNUC_PREREQ__(2, 96) +#define __noreturn __attribute__((__noreturn__)) +#define __mallocfunc __attribute__((malloc)) +#define __purefunc __attribute__((pure)) +#else +#define __noreturn +#define __mallocfunc +#define __purefunc +#endif + +#if __GNUC_PREREQ__(3, 1) +#define __always_inline __attribute__((__always_inline__)) +#else +#define __always_inline +#endif + +#if __GNUC_PREREQ__(3, 4) +#define __wur __attribute__((__warn_unused_result__)) +#else +#define __wur +#endif + +#if __GNUC_PREREQ__(4, 3) +#define __errordecl(name, msg) extern void name(void) __attribute__((__error__(msg))) +#define __warnattr(msg) __attribute__((__warning__(msg))) +#else +#define __errordecl(name, msg) extern void name(void) +#define __warnattr(msg) +#endif + +/* + * Macros for manipulating "link sets". Link sets are arrays of pointers + * to objects, which are gathered up by the linker. + * + * Object format-specific code has provided us with the following macros: + * + * __link_set_add_text(set, sym) + * Add a reference to the .text symbol `sym' to `set'. + * + * __link_set_add_rodata(set, sym) + * Add a reference to the .rodata symbol `sym' to `set'. + * + * __link_set_add_data(set, sym) + * Add a reference to the .data symbol `sym' to `set'. + * + * __link_set_add_bss(set, sym) + * Add a reference to the .bss symbol `sym' to `set'. + * + * __link_set_decl(set, ptype) + * Provide an extern declaration of the set `set', which + * contains an array of the pointer type `ptype'. This + * macro must be used by any code which wishes to reference + * the elements of a link set. + * + * __link_set_start(set) + * This points to the first slot in the link set. + * + * __link_set_end(set) + * This points to the (non-existent) slot after the last + * entry in the link set. + * + * __link_set_count(set) + * Count the number of entries in link set `set'. + * + * In addition, we provide the following macros for accessing link sets: + * + * __link_set_foreach(pvar, set) + * Iterate over the link set `set'. Because a link set is + * an array of pointers, pvar must be declared as "type **pvar", + * and the actual entry accessed as "*pvar". + * + * __link_set_entry(set, idx) + * Access the link set entry at index `idx' from set `set'. + */ +#define __link_set_foreach(pvar, set) \ + for (pvar = __link_set_start(set); pvar < __link_set_end(set); pvar++) + +#define __link_set_entry(set, idx) (__link_set_begin(set)[idx]) + +/* + * Some of the FreeBSD sources used in Bionic need this. + * Originally, this is used to embed the rcs versions of each source file + * in the generated binary. We certainly don't want this in Bionic. + */ +#define __FBSDID(s) /* nothing */ + +/*- + * The following definitions are an extension of the behavior originally + * implemented in <sys/_posix.h>, but with a different level of granularity. + * POSIX.1 requires that the macros we test be defined before any standard + * header file is included. + * + * Here's a quick run-down of the versions: + * defined(_POSIX_SOURCE) 1003.1-1988 + * _POSIX_C_SOURCE == 1 1003.1-1990 + * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option + * _POSIX_C_SOURCE == 199309 1003.1b-1993 + * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + * _POSIX_C_SOURCE == 200112 1003.1-2001 + * _POSIX_C_SOURCE == 200809 1003.1-2008 + * + * In addition, the X/Open Portability Guide, which is now the Single UNIX + * Specification, defines a feature-test macro which indicates the version of + * that specification, and which subsumes _POSIX_C_SOURCE. + * + * Our macros begin with two underscores to avoid namespace screwage. + */ + +/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 +#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ +#define _POSIX_C_SOURCE 199009 +#endif + +/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199209 +#endif + +/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ +#ifdef _XOPEN_SOURCE +#if _XOPEN_SOURCE - 0 >= 700 +#define __XSI_VISIBLE 700 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809 +#elif _XOPEN_SOURCE - 0 >= 600 +#define __XSI_VISIBLE 600 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112 +#elif _XOPEN_SOURCE - 0 >= 500 +#define __XSI_VISIBLE 500 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199506 +#endif +#endif + +/* + * Deal with all versions of POSIX. The ordering relative to the tests above is + * important. + */ +#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 198808 +#endif +#ifdef _POSIX_C_SOURCE +#if _POSIX_C_SOURCE >= 200809 +#define __POSIX_VISIBLE 200809 +#define __ISO_C_VISIBLE 1999 +#elif _POSIX_C_SOURCE >= 200112 +#define __POSIX_VISIBLE 200112 +#define __ISO_C_VISIBLE 1999 +#elif _POSIX_C_SOURCE >= 199506 +#define __POSIX_VISIBLE 199506 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199309 +#define __POSIX_VISIBLE 199309 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199209 +#define __POSIX_VISIBLE 199209 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199009 +#define __POSIX_VISIBLE 199009 +#define __ISO_C_VISIBLE 1990 +#else +#define __POSIX_VISIBLE 198808 +#define __ISO_C_VISIBLE 0 +#endif /* _POSIX_C_SOURCE */ +#else +/*- + * Deal with _ANSI_SOURCE: + * If it is defined, and no other compilation environment is explicitly + * requested, then define our internal feature-test macros to zero. This + * makes no difference to the preprocessor (undefined symbols in preprocessing + * expressions are defined to have value zero), but makes it more convenient for + * a test program to print out the values. + * + * If a program mistakenly defines _ANSI_SOURCE and some other macro such as + * _POSIX_C_SOURCE, we will assume that it wants the broader compilation + * environment (and in fact we will never get here). + */ +#if defined(_ANSI_SOURCE) /* Hide almost everything. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1990 +#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1999 +#else /* Default environment: show everything. */ +#define __POSIX_VISIBLE 200809 +#define __XSI_VISIBLE 700 +#define __BSD_VISIBLE 1 +#define __ISO_C_VISIBLE 1999 +#endif +#endif + +/* + * Default values. + */ +#ifndef __XPG_VISIBLE +# define __XPG_VISIBLE 700 +#endif +#ifndef __POSIX_VISIBLE +# define __POSIX_VISIBLE 200809 +#endif +#ifndef __ISO_C_VISIBLE +# define __ISO_C_VISIBLE 1999 +#endif +#ifndef __BSD_VISIBLE +# define __BSD_VISIBLE 1 +#endif + +#define __BIONIC__ 1 +#include <android/api-level.h> + +/* + * When _FORTIFY_SOURCE is defined, automatic bounds checking is + * added to commonly used libc functions. If a buffer overrun is + * detected, the program is safely aborted. + * + * See + * http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html for details. + */ +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 +#define __BIONIC_FORTIFY 1 +#if _FORTIFY_SOURCE == 2 +#define __bos(s) __builtin_object_size((s), 1) +#else +#define __bos(s) __builtin_object_size((s), 0) +#endif +#define __bos0(s) __builtin_object_size((s), 0) + +#define __BIONIC_FORTIFY_INLINE \ + extern inline \ + __attribute__ ((always_inline)) \ + __attribute__ ((gnu_inline)) +#endif +#define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1) + + +#if defined(__ANDROID__) && !__LP64__ && defined( __arm__) +#define __NDK_FPABI__ __attribute__((pcs("aapcs"))) +#else +#define __NDK_FPABI__ +#endif + +#if (!defined(_NDK_MATH_NO_SOFTFP) || _NDK_MATH_NO_SOFTFP != 1) && !defined(__clang__) +#define __NDK_FPABI_MATH__ __NDK_FPABI__ +#else +#define __NDK_FPABI_MATH__ /* nothing */ +#endif + +#endif /* !_SYS_CDEFS_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/cdefs_elf.h b/9/platforms/android-19/arch-arm64/usr/include/sys/cdefs_elf.h new file mode 100644 index 0000000..bb846b7 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/cdefs_elf.h @@ -0,0 +1,137 @@ +/* $NetBSD: cdefs_elf.h,v 1.22 2005/02/26 22:25:34 perry Exp $ */ + +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#ifndef _SYS_CDEFS_ELF_H_ +#define _SYS_CDEFS_ELF_H_ + +#ifdef __LEADING_UNDERSCORE +#define _C_LABEL(x) __CONCAT(_,x) +#define _C_LABEL_STRING(x) "_"x +#else +#define _C_LABEL(x) x +#define _C_LABEL_STRING(x) x +#endif + +#define ___RENAME(x) __asm__(___STRING(_C_LABEL(x))) + +#define __indr_reference(sym,alias) /* nada, since we do weak refs */ + +#define __strong_alias(alias,sym) \ + __asm__(".global " _C_LABEL_STRING(#alias) "\n" \ + _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym)); + +#define __weak_alias(alias,sym) \ + __asm__(".weak " _C_LABEL_STRING(#alias) "\n" \ + _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym)); +#define __weak_extern(sym) \ + __asm__(".weak " _C_LABEL_STRING(#sym)); + +/* We use __warnattr instead of __warn_references. + * TODO: remove this and put an empty definition in one of the upstream-* compatibility headers. + */ +#define __warn_references(sym,msg) \ + /*__asm__(".section .gnu.warning." #sym "\n\t.ascii \"" msg "\"\n\t.text");*/ + +#define __SECTIONSTRING(_sec, _str) \ + __asm__(".section " #_sec "\n\t.asciz \"" _str "\"\n\t.previous") + +/* GCC visibility helper macro */ +/* This must be used to tag non-static functions that are private, i.e. + * never exposed by the shared library. */ +#define __LIBC_HIDDEN__ \ + __attribute__ ((visibility ("hidden"))) + +/* This must be used to tag non-static functions that are public, i.e. + * exposed by the shared library, and part of the stable NDK ABI */ +#define __LIBC_ABI_PUBLIC__ \ + __attribute__ ((visibility ("default"))) + +/* This must be used to tag non-static functions that must be exported + * by the shared library, but whose implementation is private to the + * platform. For now this is equivalent to __LIBC_ABI_PUBLIC__, but we + * may want to change this later. + */ +#define __LIBC_ABI_PRIVATE__ \ + __attribute__ ((visibility ("default"))) + +#define __IDSTRING(_n,_s) __SECTIONSTRING(.ident,_s) + +#define __RCSID(_s) __IDSTRING(rcsid,_s) +#define __SCCSID(_s) +#define __SCCSID2(_s) +#if 0 /* XXX userland __COPYRIGHTs have \ns in them */ +#define __COPYRIGHT(_s) __SECTIONSTRING(.copyright,_s) +#else +#define __COPYRIGHT(_s) \ + static const char copyright[] \ + __attribute__((__unused__,__section__(".copyright"))) = _s +#endif + +#define __KERNEL_RCSID(_n, _s) __RCSID(_s) +#define __KERNEL_SCCSID(_n, _s) +#if 0 /* XXX see above */ +#define __KERNEL_COPYRIGHT(_n, _s) __COPYRIGHT(_s) +#else +#define __KERNEL_COPYRIGHT(_n, _s) __SECTIONSTRING(.copyright, _s) +#endif + +#ifndef __lint__ +#define __link_set_make_entry(set, sym) \ + static void const * const __link_set_##set##_sym_##sym \ + __section("link_set_" #set) __used = &sym +#define __link_set_make_entry2(set, sym, n) \ + static void const * const __link_set_##set##_sym_##sym##_##n \ + __section("link_set_" #set) __used = &sym[n] +#else +#define __link_set_make_entry(set, sym) \ + extern void const * const __link_set_##set##_sym_##sym +#define __link_set_make_entry2(set, sym, n) \ + extern void const * const __link_set_##set##_sym_##sym##_##n +#endif /* __lint__ */ + +#define __link_set_add_text(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_rodata(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_data(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_bss(set, sym) __link_set_make_entry(set, sym) +#define __link_set_add_text2(set, sym, n) __link_set_make_entry2(set, sym, n) +#define __link_set_add_rodata2(set, sym, n) __link_set_make_entry2(set, sym, n) +#define __link_set_add_data2(set, sym, n) __link_set_make_entry2(set, sym, n) +#define __link_set_add_bss2(set, sym, n) __link_set_make_entry2(set, sym, n) + +#define __link_set_decl(set, ptype) \ + extern ptype * const __start_link_set_##set[]; \ + extern ptype * const __stop_link_set_##set[] \ + +#define __link_set_start(set) (__start_link_set_##set) +#define __link_set_end(set) (__stop_link_set_##set) + +#define __link_set_count(set) \ + (__link_set_end(set) - __link_set_start(set)) + +#endif /* !_SYS_CDEFS_ELF_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/dirent.h b/9/platforms/android-19/arch-arm64/usr/include/sys/dirent.h new file mode 100644 index 0000000..da96f5e --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/dirent.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_DIRENT_H_ +#define _SYS_DIRENT_H_ + +#include <stdint.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/* this corresponds to the kernel dirent64 */ +struct dirent { + uint64_t d_ino; + int64_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[256]; +}; + +extern int getdents(unsigned int, struct dirent *, unsigned int); + +__END_DECLS + +#endif /* _SYS_DIRENT_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/endian.h b/9/platforms/android-19/arch-arm64/usr/include/sys/endian.h new file mode 100644 index 0000000..b0365d8 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/endian.h @@ -0,0 +1,274 @@ +/* $OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $ */ + +/*- + * Copyright (c) 1997 Niklas Hallqvist. 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + */ + +/* + * Generic definitions for little- and big-endian systems. Other endianesses + * has to be dealt with in the specific machine/endian.h file for that port. + * + * This file is meant to be included from a little- or big-endian port's + * machine/endian.h after setting _BYTE_ORDER to either 1234 for little endian + * or 4321 for big.. + */ + +#ifndef _SYS_ENDIAN_H_ +#define _SYS_ENDIAN_H_ + +#include <sys/cdefs.h> +#include <machine/endian.h> +#include <machine/_types.h> + +#define _LITTLE_ENDIAN 1234 +#define _BIG_ENDIAN 4321 +#define _PDP_ENDIAN 3412 + +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif + +#ifdef __GNUC__ + +#define __swap16gen(x) __statement({ \ + __uint16_t __swap16gen_x = (x); \ + \ + (__uint16_t)((__swap16gen_x & 0xff) << 8 | \ + (__swap16gen_x & 0xff00) >> 8); \ +}) + +#define __swap32gen(x) __statement({ \ + __uint32_t __swap32gen_x = (x); \ + \ + (__uint32_t)((__swap32gen_x & 0xff) << 24 | \ + (__swap32gen_x & 0xff00) << 8 | \ + (__swap32gen_x & 0xff0000) >> 8 | \ + (__swap32gen_x & 0xff000000) >> 24); \ +}) + +#define __swap64gen(x) __statement({ \ + __uint64_t __swap64gen_x = (x); \ + \ + (__uint64_t)((__swap64gen_x & 0xff) << 56 | \ + (__swap64gen_x & 0xff00ULL) << 40 | \ + (__swap64gen_x & 0xff0000ULL) << 24 | \ + (__swap64gen_x & 0xff000000ULL) << 8 | \ + (__swap64gen_x & 0xff00000000ULL) >> 8 | \ + (__swap64gen_x & 0xff0000000000ULL) >> 24 | \ + (__swap64gen_x & 0xff000000000000ULL) >> 40 | \ + (__swap64gen_x & 0xff00000000000000ULL) >> 56); \ +}) + +#else /* __GNUC__ */ + +/* Note that these macros evaluate their arguments several times. */ +#define __swap16gen(x) \ + (__uint16_t)(((__uint16_t)(x) & 0xff) << 8 | ((__uint16_t)(x) & 0xff00) >> 8) + +#define __swap32gen(x) \ + (__uint32_t)(((__uint32_t)(x) & 0xff) << 24 | \ + ((__uint32_t)(x) & 0xff00) << 8 | ((__uint32_t)(x) & 0xff0000) >> 8 |\ + ((__uint32_t)(x) & 0xff000000) >> 24) + +#define __swap64gen(x) \ + (__uint64_t)((((__uint64_t)(x) & 0xff) << 56) | \ + ((__uint64_t)(x) & 0xff00ULL) << 40 | \ + ((__uint64_t)(x) & 0xff0000ULL) << 24 | \ + ((__uint64_t)(x) & 0xff000000ULL) << 8 | \ + ((__uint64_t)(x) & 0xff00000000ULL) >> 8 | \ + ((__uint64_t)(x) & 0xff0000000000ULL) >> 24 | \ + ((__uint64_t)(x) & 0xff000000000000ULL) >> 40 | \ + ((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) + +#endif /* __GNUC__ */ + +/* + * Define MD_SWAP if you provide swap{16,32}md functions/macros that are + * optimized for your architecture, These will be used for swap{16,32} + * unless the argument is a constant and we are using GCC, where we can + * take advantage of the CSE phase much better by using the generic version. + */ +#ifdef MD_SWAP +#if __GNUC__ + +#define __swap16(x) __statement({ \ + __uint16_t __swap16_x = (x); \ + \ + __builtin_constant_p(x) ? __swap16gen(__swap16_x) : \ + __swap16md(__swap16_x); \ +}) + +#define __swap32(x) __statement({ \ + __uint32_t __swap32_x = (x); \ + \ + __builtin_constant_p(x) ? __swap32gen(__swap32_x) : \ + __swap32md(__swap32_x); \ +}) + +#define __swap64(x) __statement({ \ + __uint64_t __swap64_x = (x); \ + \ + __builtin_constant_p(x) ? __swap64gen(__swap64_x) : \ + __swap64md(__swap64_x); \ +}) + +#endif /* __GNUC__ */ + +#else /* MD_SWAP */ +#define __swap16 __swap16gen +#define __swap32 __swap32gen +#define __swap64 __swap64gen +#endif /* MD_SWAP */ + +#define __swap16_multi(v, n) do { \ + __size_t __swap16_multi_n = (n); \ + __uint16_t *__swap16_multi_v = (v); \ + \ + while (__swap16_multi_n) { \ + *__swap16_multi_v = swap16(*__swap16_multi_v); \ + __swap16_multi_v++; \ + __swap16_multi_n--; \ + } \ +} while (0) + +#if __BSD_VISIBLE +#define swap16 __swap16 +#define swap32 __swap32 +#define swap64 __swap64 +#define swap16_multi __swap16_multi +#endif /* __BSD_VISIBLE */ + +#if _BYTE_ORDER == _LITTLE_ENDIAN + +/* Can be overridden by machine/endian.h before inclusion of this file. */ +#ifndef _QUAD_HIGHWORD +#define _QUAD_HIGHWORD 1 +#endif +#ifndef _QUAD_LOWWORD +#define _QUAD_LOWWORD 0 +#endif + +#if __BSD_VISIBLE +#define htobe16 __swap16 +#define htobe32 __swap32 +#define htobe64 __swap64 +#define betoh16 __swap16 +#define betoh32 __swap32 +#define betoh64 __swap64 + +#define htole16(x) (x) +#define htole32(x) (x) +#define htole64(x) (x) +#define letoh16(x) (x) +#define letoh32(x) (x) +#define letoh64(x) (x) +#endif /* __BSD_VISIBLE */ + +#define htons(x) __swap16(x) +#define htonl(x) __swap32(x) +#define ntohs(x) __swap16(x) +#define ntohl(x) __swap32(x) + +/* Bionic additions */ +#define ntohq(x) __swap64(x) +#define htonq(x) __swap64(x) + +#define __LITTLE_ENDIAN_BITFIELD + +#endif /* _BYTE_ORDER */ + +#if _BYTE_ORDER == _BIG_ENDIAN + +/* Can be overridden by machine/endian.h before inclusion of this file. */ +#ifndef _QUAD_HIGHWORD +#define _QUAD_HIGHWORD 0 +#endif +#ifndef _QUAD_LOWWORD +#define _QUAD_LOWWORD 1 +#endif + +#if __BSD_VISIBLE +#define htole16 __swap16 +#define htole32 __swap32 +#define htole64 __swap64 +#define letoh16 __swap16 +#define letoh32 __swap32 +#define letoh64 __swap64 + +#define htobe16(x) (x) +#define htobe32(x) (x) +#define htobe64(x) (x) +#define betoh16(x) (x) +#define betoh32(x) (x) +#define betoh64(x) (x) +#endif /* __BSD_VISIBLE */ + +#define htons(x) (x) +#define htonl(x) (x) +#define ntohs(x) (x) +#define ntohl(x) (x) + +/* Bionic additions */ +#define ntohq(x) (x) +#define htonq(x) (x) + +#define __BIG_ENDIAN_BITFIELD + +#endif /* _BYTE_ORDER */ + +#if __BSD_VISIBLE +#define NTOHL(x) (x) = ntohl((u_int32_t)(x)) +#define NTOHS(x) (x) = ntohs((u_int16_t)(x)) +#define HTONL(x) (x) = htonl((u_int32_t)(x)) +#define HTONS(x) (x) = htons((u_int16_t)(x)) +#endif + + +#define __BYTE_ORDER _BYTE_ORDER +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN _LITTLE_ENDIAN +#endif +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN _BIG_ENDIAN +#endif + + +#ifdef __BSD_VISIBLE +/* + * glibc-compatible beXXtoh/leXXtoh synonyms for htobeXX/htoleXX. + * The BSDs export both sets of names, bionic historically only + * exported the ones above (or on the rhs here), and glibc only + * exports these names (on the lhs). + */ +#define be16toh(x) htobe16(x) +#define be32toh(x) htobe32(x) +#define be64toh(x) htobe64(x) +#define le16toh(x) htole16(x) +#define le32toh(x) htole32(x) +#define le64toh(x) htole64(x) +#endif + +#endif /* _SYS_ENDIAN_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/epoll.h b/9/platforms/android-19/arch-arm64/usr/include/sys/epoll.h new file mode 100644 index 0000000..c06a081 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/epoll.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_EPOLL_H_ +#define _SYS_EPOLL_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <fcntl.h> /* For O_CLOEXEC. */ +#include <signal.h> /* For sigset_t. */ + +__BEGIN_DECLS + +#define EPOLLIN 0x00000001 +#define EPOLLPRI 0x00000002 +#define EPOLLOUT 0x00000004 +#define EPOLLERR 0x00000008 +#define EPOLLHUP 0x00000010 +#define EPOLLRDNORM 0x00000040 +#define EPOLLRDBAND 0x00000080 +#define EPOLLWRNORM 0x00000100 +#define EPOLLWRBAND 0x00000200 +#define EPOLLMSG 0x00000400 +#define EPOLLRDHUP 0x00002000 +#define EPOLLWAKEUP 0x20000000 +#define EPOLLONESHOT 0x40000000 +#define EPOLLET 0x80000000 + +#define EPOLL_CTL_ADD 1 +#define EPOLL_CTL_DEL 2 +#define EPOLL_CTL_MOD 3 + +#define EPOLL_CLOEXEC O_CLOEXEC + +typedef union epoll_data { + void* ptr; + int fd; + uint32_t u32; + uint64_t u64; +} epoll_data_t; + +struct epoll_event { + uint32_t events; + epoll_data_t data; +}; + +int epoll_create(int); +int epoll_create1(int); +int epoll_ctl(int, int, int, struct epoll_event*); +int epoll_wait(int, struct epoll_event*, int, int); +int epoll_pwait(int, struct epoll_event*, int, int, const sigset_t*); + +__END_DECLS + +#endif /* _SYS_EPOLL_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/errno.h b/9/platforms/android-19/arch-arm64/usr/include/sys/errno.h new file mode 100644 index 0000000..339f4fc --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/errno.h @@ -0,0 +1 @@ +#include <errno.h> diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/eventfd.h b/9/platforms/android-19/arch-arm64/usr/include/sys/eventfd.h new file mode 100644 index 0000000..4c8da0c --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/eventfd.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_EVENTFD_H +#define _SYS_EVENTFD_H + +#include <sys/cdefs.h> +#include <fcntl.h> + +__BEGIN_DECLS + +#define EFD_CLOEXEC O_CLOEXEC +#define EFD_NONBLOCK O_NONBLOCK + +/* type of event counter */ +typedef uint64_t eventfd_t; + +extern int eventfd(unsigned int initial_value, int flags); + +extern int eventfd_read(int fd, eventfd_t* value); +extern int eventfd_write(int fd, eventfd_t value); + +__END_DECLS + +#endif /* _SYS_EVENTFD_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/exec_elf.h b/9/platforms/android-19/arch-arm64/usr/include/sys/exec_elf.h new file mode 100644 index 0000000..3c1467c --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/exec_elf.h @@ -0,0 +1,1267 @@ +/* $NetBSD: exec_elf.h,v 1.131 2013/10/29 00:22:59 christos Exp $ */ + +/*- + * Copyright (c) 1994 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_EXEC_ELF_H_ +#define _SYS_EXEC_ELF_H_ + +/* + * The current ELF ABI specification is available at: + * http://www.sco.com/developers/gabi/ + * + * Current header definitions are in: + * http://www.sco.com/developers/gabi/latest/ch4.eheader.html + */ + +#if defined(_KERNEL) || defined(_STANDALONE) +#include <sys/types.h> +#else +#include <inttypes.h> +#endif /* _KERNEL || _STANDALONE */ + +#if HAVE_NBTOOL_CONFIG_H +#include <nbinclude/machine/elf_machdep.h> +#else +#include <machine/elf_machdep.h> +#endif + +typedef uint8_t Elf_Byte; + +typedef uint32_t Elf32_Addr; +#define ELF32_FSZ_ADDR 4 +typedef uint32_t Elf32_Off; +typedef int32_t Elf32_SOff; +#define ELF32_FSZ_OFF 4 +typedef int32_t Elf32_Sword; +#define ELF32_FSZ_SWORD 4 +typedef uint32_t Elf32_Word; +#define ELF32_FSZ_WORD 4 +typedef uint16_t Elf32_Half; +#define ELF32_FSZ_HALF 2 +typedef uint64_t Elf32_Lword; +#define ELF32_FSZ_LWORD 8 + +typedef uint64_t Elf64_Addr; +#define ELF64_FSZ_ADDR 8 +typedef uint64_t Elf64_Off; +typedef int64_t Elf64_SOff; +#define ELF64_FSZ_OFF 8 +typedef int32_t Elf64_Shalf; +#define ELF64_FSZ_SHALF 4 + +typedef int32_t Elf64_Sword; +#define ELF64_FSZ_SWORD 4 +typedef uint32_t Elf64_Word; +#define ELF64_FSZ_WORD 4 + +typedef int64_t Elf64_Sxword; +#define ELF64_FSZ_SXWORD 8 +typedef uint64_t Elf64_Xword; +#define ELF64_FSZ_XWORD 8 +typedef uint64_t Elf64_Lword; +#define ELF64_FSZ_LWORD 8 +typedef uint16_t Elf64_Half; +#define ELF64_FSZ_HALF 2 + +/* + * ELF Header + */ +#define ELF_NIDENT 16 + +typedef struct { + unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ + Elf32_Half e_type; /* file type */ + Elf32_Half e_machine; /* machine type */ + Elf32_Word e_version; /* version number */ + Elf32_Addr e_entry; /* entry point */ + Elf32_Off e_phoff; /* Program hdr offset */ + Elf32_Off e_shoff; /* Section hdr offset */ + Elf32_Word e_flags; /* Processor flags */ + Elf32_Half e_ehsize; /* sizeof ehdr */ + Elf32_Half e_phentsize; /* Program header entry size */ + Elf32_Half e_phnum; /* Number of program headers */ + Elf32_Half e_shentsize; /* Section header entry size */ + Elf32_Half e_shnum; /* Number of section headers */ + Elf32_Half e_shstrndx; /* String table index */ +} Elf32_Ehdr; + +typedef struct { + unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ + Elf64_Half e_type; /* file type */ + Elf64_Half e_machine; /* machine type */ + Elf64_Word e_version; /* version number */ + Elf64_Addr e_entry; /* entry point */ + Elf64_Off e_phoff; /* Program hdr offset */ + Elf64_Off e_shoff; /* Section hdr offset */ + Elf64_Word e_flags; /* Processor flags */ + Elf64_Half e_ehsize; /* sizeof ehdr */ + Elf64_Half e_phentsize; /* Program header entry size */ + Elf64_Half e_phnum; /* Number of program headers */ + Elf64_Half e_shentsize; /* Section header entry size */ + Elf64_Half e_shnum; /* Number of section headers */ + Elf64_Half e_shstrndx; /* String table index */ +} Elf64_Ehdr; + +/* e_ident offsets */ +#define EI_MAG0 0 /* '\177' */ +#define EI_MAG1 1 /* 'E' */ +#define EI_MAG2 2 /* 'L' */ +#define EI_MAG3 3 /* 'F' */ +#define EI_CLASS 4 /* File class */ +#define EI_DATA 5 /* Data encoding */ +#define EI_VERSION 6 /* File version */ +#define EI_OSABI 7 /* Operating system/ABI identification */ +#define EI_ABIVERSION 8 /* ABI version */ +#define EI_PAD 9 /* Start of padding bytes up to EI_NIDENT*/ +#define EI_NIDENT 16 /* First non-ident header byte */ + +/* e_ident[EI_MAG0,EI_MAG3] */ +#define ELFMAG0 0x7f +#define ELFMAG1 'E' +#define ELFMAG2 'L' +#define ELFMAG3 'F' +#define ELFMAG "\177ELF" +#define SELFMAG 4 + +/* e_ident[EI_CLASS] */ +#define ELFCLASSNONE 0 /* Invalid class */ +#define ELFCLASS32 1 /* 32-bit objects */ +#define ELFCLASS64 2 /* 64-bit objects */ +#define ELFCLASSNUM 3 + +/* e_ident[EI_DATA] */ +#define ELFDATANONE 0 /* Invalid data encoding */ +#define ELFDATA2LSB 1 /* 2's complement values, LSB first */ +#define ELFDATA2MSB 2 /* 2's complement values, MSB first */ + +/* e_ident[EI_VERSION] */ +#define EV_NONE 0 /* Invalid version */ +#define EV_CURRENT 1 /* Current version */ +#define EV_NUM 2 + +/* e_ident[EI_OSABI] */ +#define ELFOSABI_SYSV 0 /* UNIX System V ABI */ +#define ELFOSABI_HPUX 1 /* HP-UX operating system */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_LINUX 3 /* GNU/Linux */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_86OPEN 5 /* 86Open */ +#define ELFOSABI_SOLARIS 6 /* Solaris */ +#define ELFOSABI_MONTEREY 7 /* Monterey */ +#define ELFOSABI_IRIX 8 /* IRIX */ +#define ELFOSABI_FREEBSD 9 /* FreeBSD */ +#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ +#define ELFOSABI_MODESTO 11 /* Novell Modesto */ +#define ELFOSABI_OPENBSD 12 /* OpenBSD */ +#define ELFOSABI_OPENVMS 13 /* OpenVMS */ +#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ +#define ELFOSABI_AROS 15 /* Amiga Research OS */ +/* Unofficial OSABIs follow */ +#define ELFOSABI_ARM 97 /* ARM */ +#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ + +#define ELFOSABI_NONE ELFOSABI_SYSV +#define ELFOSABI_AIX ELFOSABI_MONTEREY + +/* e_type */ +#define ET_NONE 0 /* No file type */ +#define ET_REL 1 /* Relocatable file */ +#define ET_EXEC 2 /* Executable file */ +#define ET_DYN 3 /* Shared object file */ +#define ET_CORE 4 /* Core file */ +#define ET_NUM 5 + +#define ET_LOOS 0xfe00 /* Operating system specific range */ +#define ET_HIOS 0xfeff +#define ET_LOPROC 0xff00 /* Processor-specific range */ +#define ET_HIPROC 0xffff + +/* e_machine */ +#define EM_NONE 0 /* No machine */ +#define EM_M32 1 /* AT&T WE 32100 */ +#define EM_SPARC 2 /* SPARC */ +#define EM_386 3 /* Intel 80386 */ +#define EM_68K 4 /* Motorola 68000 */ +#define EM_88K 5 /* Motorola 88000 */ +#define EM_486 6 /* Intel 80486 */ +#define EM_860 7 /* Intel 80860 */ +#define EM_MIPS 8 /* MIPS I Architecture */ +#define EM_S370 9 /* Amdahl UTS on System/370 */ +#define EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */ + /* 11-14 - Reserved */ +#define EM_RS6000 11 /* IBM RS/6000 XXX reserved */ +#define EM_PARISC 15 /* Hewlett-Packard PA-RISC */ +#define EM_NCUBE 16 /* NCube XXX reserved */ +#define EM_VPP500 17 /* Fujitsu VPP500 */ +#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */ +#define EM_960 19 /* Intel 80960 */ +#define EM_PPC 20 /* PowerPC */ +#define EM_PPC64 21 /* 64-bit PowerPC */ + /* 22-35 - Reserved */ +#define EM_S390 22 /* System/390 XXX reserved */ +#define EM_V800 36 /* NEC V800 */ +#define EM_FR20 37 /* Fujitsu FR20 */ +#define EM_RH32 38 /* TRW RH-32 */ +#define EM_RCE 39 /* Motorola RCE */ +#define EM_ARM 40 /* Advanced RISC Machines ARM */ +#define EM_ALPHA 41 /* DIGITAL Alpha */ +#define EM_SH 42 /* Hitachi Super-H */ +#define EM_SPARCV9 43 /* SPARC Version 9 */ +#define EM_TRICORE 44 /* Siemens Tricore */ +#define EM_ARC 45 /* Argonaut RISC Core */ +#define EM_H8_300 46 /* Hitachi H8/300 */ +#define EM_H8_300H 47 /* Hitachi H8/300H */ +#define EM_H8S 48 /* Hitachi H8S */ +#define EM_H8_500 49 /* Hitachi H8/500 */ +#define EM_IA_64 50 /* Intel Merced Processor */ +#define EM_MIPS_X 51 /* Stanford MIPS-X */ +#define EM_COLDFIRE 52 /* Motorola Coldfire */ +#define EM_68HC12 53 /* Motorola MC68HC12 */ +#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */ +#define EM_PCP 55 /* Siemens PCP */ +#define EM_NCPU 56 /* Sony nCPU embedded RISC processor */ +#define EM_NDR1 57 /* Denso NDR1 microprocessor */ +#define EM_STARCORE 58 /* Motorola Star*Core processor */ +#define EM_ME16 59 /* Toyota ME16 processor */ +#define EM_ST100 60 /* STMicroelectronics ST100 processor */ +#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded family processor */ +#define EM_X86_64 62 /* AMD x86-64 architecture */ +#define EM_PDSP 63 /* Sony DSP Processor */ +#define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */ +#define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */ +#define EM_FX66 66 /* Siemens FX66 microcontroller */ +#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */ +#define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */ +#define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */ +#define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */ +#define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */ +#define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */ +#define EM_SVX 73 /* Silicon Graphics SVx */ +#define EM_ST19 74 /* STMicroelectronics ST19 8-bit CPU */ +#define EM_VAX 75 /* Digital VAX */ +#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ +#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded CPU */ +#define EM_FIREPATH 78 /* Element 14 64-bit DSP processor */ +#define EM_ZSP 79 /* LSI Logic's 16-bit DSP processor */ +#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ +#define EM_HUANY 81 /* Harvard's machine-independent format */ +#define EM_PRISM 82 /* SiTera Prism */ +#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ +#define EM_FR30 84 /* Fujitsu FR30 */ +#define EM_D10V 85 /* Mitsubishi D10V */ +#define EM_D30V 86 /* Mitsubishi D30V */ +#define EM_V850 87 /* NEC v850 */ +#define EM_M32R 88 /* Mitsubishi M32R */ +#define EM_MN10300 89 /* Matsushita MN10300 */ +#define EM_MN10200 90 /* Matsushita MN10200 */ +#define EM_PJ 91 /* picoJava */ +#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ +#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ +#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ +#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */ +#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */ +#define EM_NS32K 97 /* National Semiconductor 32000 series */ +#define EM_TPC 98 /* Tenor Network TPC processor */ +#define EM_SNP1K 99 /* Trebia SNP 1000 processor */ +#define EM_ST200 100 /* STMicroelectronics ST200 microcontroller */ +#define EM_IP2K 101 /* Ubicom IP2xxx microcontroller family */ +#define EM_MAX 102 /* MAX processor */ +#define EM_CR 103 /* National Semiconductor CompactRISC micorprocessor */ +#define EM_F2MC16 104 /* Fujitsu F2MC16 */ +#define EM_MSP430 105 /* Texas Instruments MSP430 */ +#define EM_BLACKFIN 106 /* Analog Devices Blackfin DSP */ +#define EM_SE_C33 107 /* Seiko Epson S1C33 family */ +#define EM_SEP 108 /* Sharp embedded microprocessor */ +#define EM_ARCA 109 /* Arca RISC microprocessor */ +#define EM_UNICORE 110 /* UNICORE from PKU-Unity Ltd. and MPRC Peking University */ +#define EM_AARCH64 183 /* AArch64 64-bit ARM microprocessor */ + +/* Unofficial machine types follow */ +#define EM_AVR32 6317 /* used by NetBSD/avr32 */ +#define EM_ALPHA_EXP 36902 /* used by NetBSD/alpha; obsolete */ +#define EM_NUM 36903 + +/* + * Program Header + */ +typedef struct { + Elf32_Word p_type; /* entry type */ + Elf32_Off p_offset; /* offset */ + Elf32_Addr p_vaddr; /* virtual address */ + Elf32_Addr p_paddr; /* physical address */ + Elf32_Word p_filesz; /* file size */ + Elf32_Word p_memsz; /* memory size */ + Elf32_Word p_flags; /* flags */ + Elf32_Word p_align; /* memory & file alignment */ +} Elf32_Phdr; + +typedef struct { + Elf64_Word p_type; /* entry type */ + Elf64_Word p_flags; /* flags */ + Elf64_Off p_offset; /* offset */ + Elf64_Addr p_vaddr; /* virtual address */ + Elf64_Addr p_paddr; /* physical address */ + Elf64_Xword p_filesz; /* file size */ + Elf64_Xword p_memsz; /* memory size */ + Elf64_Xword p_align; /* memory & file alignment */ +} Elf64_Phdr; + +/* p_type */ +#define PT_NULL 0 /* Program header table entry unused */ +#define PT_LOAD 1 /* Loadable program segment */ +#define PT_DYNAMIC 2 /* Dynamic linking information */ +#define PT_INTERP 3 /* Program interpreter */ +#define PT_NOTE 4 /* Auxiliary information */ +#define PT_SHLIB 5 /* Reserved, unspecified semantics */ +#define PT_PHDR 6 /* Entry for header table itself */ +#define PT_TLS 7 /* TLS initialisation image */ +#define PT_NUM 8 + +#define PT_LOOS 0x60000000 /* OS-specific range */ + +/* GNU-specific */ +#define PT_GNU_EH_FRAME 0x6474e550 /* EH frame segment */ +#define PT_GNU_STACK 0x6474e551 /* Indicate executable stack */ +#define PT_GNU_RELRO 0x6474e552 /* Make read-only after relocation */ + +#define PT_HIOS 0x6fffffff +#define PT_LOPROC 0x70000000 /* Processor-specific range */ +#define PT_HIPROC 0x7fffffff + +#define PT_MIPS_REGINFO 0x70000000 + +/* p_flags */ +#define PF_R 0x4 /* Segment is readable */ +#define PF_W 0x2 /* Segment is writable */ +#define PF_X 0x1 /* Segment is executable */ + +#define PF_MASKOS 0x0ff00000 /* Operating system specific values */ +#define PF_MASKPROC 0xf0000000 /* Processor-specific values */ + +/* Extended program header index. */ +#define PN_XNUM 0xffff + +/* + * Section Headers + */ +typedef struct { + Elf32_Word sh_name; /* section name (.shstrtab index) */ + Elf32_Word sh_type; /* section type */ + Elf32_Word sh_flags; /* section flags */ + Elf32_Addr sh_addr; /* virtual address */ + Elf32_Off sh_offset; /* file offset */ + Elf32_Word sh_size; /* section size */ + Elf32_Word sh_link; /* link to another */ + Elf32_Word sh_info; /* misc info */ + Elf32_Word sh_addralign; /* memory alignment */ + Elf32_Word sh_entsize; /* table entry size */ +} Elf32_Shdr; + +typedef struct { + Elf64_Word sh_name; /* section name (.shstrtab index) */ + Elf64_Word sh_type; /* section type */ + Elf64_Xword sh_flags; /* section flags */ + Elf64_Addr sh_addr; /* virtual address */ + Elf64_Off sh_offset; /* file offset */ + Elf64_Xword sh_size; /* section size */ + Elf64_Word sh_link; /* link to another */ + Elf64_Word sh_info; /* misc info */ + Elf64_Xword sh_addralign; /* memory alignment */ + Elf64_Xword sh_entsize; /* table entry size */ +} Elf64_Shdr; + +/* sh_type */ +#define SHT_NULL 0 /* Section header table entry unused */ +#define SHT_PROGBITS 1 /* Program information */ +#define SHT_SYMTAB 2 /* Symbol table */ +#define SHT_STRTAB 3 /* String table */ +#define SHT_RELA 4 /* Relocation information w/ addend */ +#define SHT_HASH 5 /* Symbol hash table */ +#define SHT_DYNAMIC 6 /* Dynamic linking information */ +#define SHT_NOTE 7 /* Auxiliary information */ +#define SHT_NOBITS 8 /* No space allocated in file image */ +#define SHT_REL 9 /* Relocation information w/o addend */ +#define SHT_SHLIB 10 /* Reserved, unspecified semantics */ +#define SHT_DYNSYM 11 /* Symbol table for dynamic linker */ +#define SHT_INIT_ARRAY 14 /* Initialization function pointers */ +#define SHT_FINI_ARRAY 15 /* Termination function pointers */ +#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs */ +#define SHT_GROUP 17 /* Section group */ +#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX) */ +#define SHT_NUM 19 + +#define SHT_LOOS 0x60000000 /* Operating system specific range */ +#define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table */ +#define SHT_SUNW_move 0x6ffffffa +#define SHT_SUNW_syminfo 0x6ffffffc +#define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */ +#define SHT_GNU_verdef SHT_SUNW_verdef +#define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */ +#define SHT_GNU_verneed SHT_SUNW_verneed +#define SHT_SUNW_versym 0x6fffffff /* Symbol versions */ +#define SHT_GNU_versym SHT_SUNW_versym +#define SHT_HIOS 0x6fffffff +#define SHT_LOPROC 0x70000000 /* Processor-specific range */ +#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ +#define SHT_ARM_EXIDX 0x70000001 /* exception index table */ +#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking + * pre-emption map */ +#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility + * attributes */ +#define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details */ +#define SHT_ARM_OVERLAYSECTION 0x70000005 +#define SHT_HIPROC 0x7fffffff +#define SHT_LOUSER 0x80000000 /* Application-specific range */ +#define SHT_HIUSER 0xffffffff + +/* sh_flags */ +#define SHF_WRITE 0x00000001 /* Contains writable data */ +#define SHF_ALLOC 0x00000002 /* Occupies memory */ +#define SHF_EXECINSTR 0x00000004 /* Contains executable insns */ +#define SHF_MERGE 0x00000010 /* Might be merged */ +#define SHF_STRINGS 0x00000020 /* Contains nul terminated strings */ +#define SHF_INFO_LINK 0x00000040 /* "sh_info" contains SHT index */ +#define SHF_LINK_ORDER 0x00000080 /* Preserve order after combining */ +#define SHF_OS_NONCONFORMING 0x00000100 /* OS specific handling required */ +#define SHF_GROUP 0x00000200 /* Is member of a group */ +#define SHF_TLS 0x00000400 /* Holds thread-local data */ +#define SHF_MASKOS 0x0ff00000 /* Operating system specific values */ +#define SHF_MASKPROC 0xf0000000 /* Processor-specific values */ +#define SHF_ORDERED 0x40000000 /* Ordering requirement (Solaris) */ +#define SHF_EXCLUDE 0x80000000 /* Excluded unless unles ref/alloc + (Solaris).*/ +/* + * Symbol Table + */ +typedef struct { + Elf32_Word st_name; /* Symbol name (.strtab index) */ + Elf32_Word st_value; /* value of symbol */ + Elf32_Word st_size; /* size of symbol */ + Elf_Byte st_info; /* type / binding attrs */ + Elf_Byte st_other; /* unused */ + Elf32_Half st_shndx; /* section index of symbol */ +} Elf32_Sym; + +typedef struct { + Elf64_Word st_name; /* Symbol name (.strtab index) */ + Elf_Byte st_info; /* type / binding attrs */ + Elf_Byte st_other; /* unused */ + Elf64_Half st_shndx; /* section index of symbol */ + Elf64_Addr st_value; /* value of symbol */ + Elf64_Xword st_size; /* size of symbol */ +} Elf64_Sym; + +/* Symbol Table index of the undefined symbol */ +#define ELF_SYM_UNDEFINED 0 + +#define STN_UNDEF 0 /* undefined index */ + +/* st_info: Symbol Bindings */ +#define STB_LOCAL 0 /* local symbol */ +#define STB_GLOBAL 1 /* global symbol */ +#define STB_WEAK 2 /* weakly defined global symbol */ +#define STB_NUM 3 + +#define STB_LOOS 10 /* Operating system specific range */ +#define STB_HIOS 12 +#define STB_LOPROC 13 /* Processor-specific range */ +#define STB_HIPROC 15 + +/* st_info: Symbol Types */ +#define STT_NOTYPE 0 /* Type not specified */ +#define STT_OBJECT 1 /* Associated with a data object */ +#define STT_FUNC 2 /* Associated with a function */ +#define STT_SECTION 3 /* Associated with a section */ +#define STT_FILE 4 /* Associated with a file name */ +#define STT_COMMON 5 /* Uninitialised common block */ +#define STT_TLS 6 /* Thread local data object */ +#define STT_NUM 7 + +#define STT_LOOS 10 /* Operating system specific range */ +#define STT_HIOS 12 +#define STT_LOPROC 13 /* Processor-specific range */ +#define STT_HIPROC 15 + +/* st_other: Visibility Types */ +#define STV_DEFAULT 0 /* use binding type */ +#define STV_INTERNAL 1 /* not referenced from outside */ +#define STV_HIDDEN 2 /* not visible, may be used via ptr */ +#define STV_PROTECTED 3 /* visible, not preemptible */ +#define STV_EXPORTED 4 +#define STV_SINGLETON 5 +#define STV_ELIMINATE 6 + +/* st_info/st_other utility macros */ +#define ELF_ST_BIND(info) ((uint32_t)(info) >> 4) +#define ELF_ST_TYPE(info) ((uint32_t)(info) & 0xf) +#define ELF_ST_INFO(bind,type) ((Elf_Byte)(((bind) << 4) | \ + ((type) & 0xf))) +#define ELF_ST_VISIBILITY(other) ((uint32_t)(other) & 3) + +/* + * Special section indexes + */ +#define SHN_UNDEF 0 /* Undefined section */ + +#define SHN_LORESERVE 0xff00 /* Reserved range */ +#define SHN_ABS 0xfff1 /* Absolute symbols */ +#define SHN_COMMON 0xfff2 /* Common symbols */ +#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere */ +#define SHN_HIRESERVE 0xffff + +#define SHN_LOPROC 0xff00 /* Processor-specific range */ +#define SHN_HIPROC 0xff1f +#define SHN_LOOS 0xff20 /* Operating system specific range */ +#define SHN_HIOS 0xff3f + +#define SHN_MIPS_ACOMMON 0xff00 +#define SHN_MIPS_TEXT 0xff01 +#define SHN_MIPS_DATA 0xff02 +#define SHN_MIPS_SCOMMON 0xff03 + +/* + * Relocation Entries + */ +typedef struct { + Elf32_Word r_offset; /* where to do it */ + Elf32_Word r_info; /* index & type of relocation */ +} Elf32_Rel; + +typedef struct { + Elf32_Word r_offset; /* where to do it */ + Elf32_Word r_info; /* index & type of relocation */ + Elf32_Sword r_addend; /* adjustment value */ +} Elf32_Rela; + +/* r_info utility macros */ +#define ELF32_R_SYM(info) ((info) >> 8) +#define ELF32_R_TYPE(info) ((info) & 0xff) +#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) + +typedef struct { + Elf64_Addr r_offset; /* where to do it */ + Elf64_Xword r_info; /* index & type of relocation */ +} Elf64_Rel; + +typedef struct { + Elf64_Addr r_offset; /* where to do it */ + Elf64_Xword r_info; /* index & type of relocation */ + Elf64_Sxword r_addend; /* adjustment value */ +} Elf64_Rela; + +/* r_info utility macros */ +#define ELF64_R_SYM(info) ((info) >> 32) +#define ELF64_R_TYPE(info) ((info) & 0xffffffff) +#define ELF64_R_INFO(sym,type) (((sym) << 32) + (type)) + +/* + * Move entries + */ +typedef struct { + Elf32_Lword m_value; /* symbol value */ + Elf32_Word m_info; /* size + index */ + Elf32_Word m_poffset; /* symbol offset */ + Elf32_Half m_repeat; /* repeat count */ + Elf32_Half m_stride; /* stride info */ +} Elf32_Move; + +#define ELF32_M_SYM(info) ((info) >> 8) +#define ELF32_M_SIZE(info) ((info) & 0xff) +#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size)) + +typedef struct { + Elf64_Lword m_value; /* symbol value */ + Elf64_Xword m_info; /* size + index */ + Elf64_Xword m_poffset; /* symbol offset */ + Elf64_Word m_repeat; /* repeat count */ + Elf64_Word m_stride; /* stride info */ +} Elf64_Move; + +#define ELF64_M_SYM(info) ((info) >> 8) +#define ELF64_M_SIZE(info) ((info) & 0xff) +#define ELF64_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size)) + +/* + * Hardware/software capabilities entry + */ +typedef struct { + Elf32_Word c_tag; /* entry tag value */ + union { + Elf32_Addr c_ptr; + Elf32_Word c_val; + } c_un; +} Elf32_Cap; + +typedef struct { + Elf64_Xword c_tag; /* entry tag value */ + union { + Elf64_Addr c_ptr; + Elf64_Xword c_val; + } c_un; +} Elf64_Cap; + +/* + * Dynamic Section structure array + */ +typedef struct { + Elf32_Word d_tag; /* entry tag value */ + union { + Elf32_Addr d_ptr; + Elf32_Word d_val; + } d_un; +} Elf32_Dyn; + +typedef struct { + Elf64_Xword d_tag; /* entry tag value */ + union { + Elf64_Addr d_ptr; + Elf64_Xword d_val; + } d_un; +} Elf64_Dyn; + +/* d_tag */ +#define DT_NULL 0 /* Marks end of dynamic array */ +#define DT_NEEDED 1 /* Name of needed library (DT_STRTAB offset) */ +#define DT_PLTRELSZ 2 /* Size, in bytes, of relocations in PLT */ +#define DT_PLTGOT 3 /* Address of PLT and/or GOT */ +#define DT_HASH 4 /* Address of symbol hash table */ +#define DT_STRTAB 5 /* Address of string table */ +#define DT_SYMTAB 6 /* Address of symbol table */ +#define DT_RELA 7 /* Address of Rela relocation table */ +#define DT_RELASZ 8 /* Size, in bytes, of DT_RELA table */ +#define DT_RELAENT 9 /* Size, in bytes, of one DT_RELA entry */ +#define DT_STRSZ 10 /* Size, in bytes, of DT_STRTAB table */ +#define DT_SYMENT 11 /* Size, in bytes, of one DT_SYMTAB entry */ +#define DT_INIT 12 /* Address of initialization function */ +#define DT_FINI 13 /* Address of termination function */ +#define DT_SONAME 14 /* Shared object name (DT_STRTAB offset) */ +#define DT_RPATH 15 /* Library search path (DT_STRTAB offset) */ +#define DT_SYMBOLIC 16 /* Start symbol search within local object */ +#define DT_REL 17 /* Address of Rel relocation table */ +#define DT_RELSZ 18 /* Size, in bytes, of DT_REL table */ +#define DT_RELENT 19 /* Size, in bytes, of one DT_REL entry */ +#define DT_PLTREL 20 /* Type of PLT relocation entries */ +#define DT_DEBUG 21 /* Used for debugging; unspecified */ +#define DT_TEXTREL 22 /* Relocations might modify non-writable seg */ +#define DT_JMPREL 23 /* Address of relocations associated with PLT */ +#define DT_BIND_NOW 24 /* Process all relocations at load-time */ +#define DT_INIT_ARRAY 25 /* Address of initialization function array */ +#define DT_FINI_ARRAY 26 /* Size, in bytes, of DT_INIT_ARRAY array */ +#define DT_INIT_ARRAYSZ 27 /* Address of termination function array */ +#define DT_FINI_ARRAYSZ 28 /* Size, in bytes, of DT_FINI_ARRAY array*/ +#define DT_RUNPATH 29 /* overrides DT_RPATH */ +#define DT_FLAGS 30 /* Encodes ORIGIN, SYMBOLIC, TEXTREL, BIND_NOW, STATIC_TLS */ +#define DT_ENCODING 31 /* ??? */ +#define DT_PREINIT_ARRAY 32 /* Address of pre-init function array */ +#define DT_PREINIT_ARRAYSZ 33 /* Size, in bytes, of DT_PREINIT_ARRAY array */ +#define DT_NUM 34 + +#define DT_LOOS 0x60000000 /* Operating system specific range */ +#define DT_VERSYM 0x6ffffff0 /* Symbol versions */ +#define DT_FLAGS_1 0x6ffffffb /* ELF dynamic flags */ +#define DT_VERDEF 0x6ffffffc /* Versions defined by file */ +#define DT_VERDEFNUM 0x6ffffffd /* Number of versions defined by file */ +#define DT_VERNEED 0x6ffffffe /* Versions needed by file */ +#define DT_VERNEEDNUM 0x6fffffff /* Number of versions needed by file */ +#define DT_HIOS 0x6fffffff +#define DT_LOPROC 0x70000000 /* Processor-specific range */ +#define DT_HIPROC 0x7fffffff + +/* Flag values for DT_FLAGS */ +#define DF_ORIGIN 0x00000001 /* uses $ORIGIN */ +#define DF_SYMBOLIC 0x00000002 /* */ +#define DF_TEXTREL 0x00000004 /* */ +#define DF_BIND_NOW 0x00000008 /* */ +#define DF_STATICT_LS 0x00000010 /* */ + +/* Flag values for DT_FLAGS_1 (incomplete) */ +#define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ +#define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ +#define DF_1_INITFIRST 0x00000020 /* Object's init/fini take priority */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ + +/* + * Auxiliary Vectors + */ +typedef struct { + Elf32_Word a_type; /* 32-bit id */ + Elf32_Word a_v; /* 32-bit id */ +} Aux32Info; + +typedef struct { + Elf64_Word a_type; /* 32-bit id */ + Elf64_Xword a_v; /* 64-bit id */ +} Aux64Info; + +/* BEGIN android-changed: these constants should come from <linux/auxvec.h>. */ +#if 0 +/* a_type */ +#define AT_NULL 0 /* Marks end of array */ +#define AT_IGNORE 1 /* No meaning, a_un is undefined */ +#define AT_EXECFD 2 /* Open file descriptor of object file */ +#define AT_PHDR 3 /* &phdr[0] */ +#define AT_PHENT 4 /* sizeof(phdr[0]) */ +#define AT_PHNUM 5 /* # phdr entries */ +#define AT_PAGESZ 6 /* PAGESIZE */ +#define AT_BASE 7 /* Interpreter base addr */ +#define AT_FLAGS 8 /* Processor flags */ +#define AT_ENTRY 9 /* Entry address of executable */ +#define AT_DCACHEBSIZE 10 /* Data cache block size */ +#define AT_ICACHEBSIZE 11 /* Instruction cache block size */ +#define AT_UCACHEBSIZE 12 /* Unified cache block size */ +#define AT_STACKBASE 13 /* Base address of the main thread */ + + /* Vendor specific */ +#define AT_MIPS_NOTELF 10 /* XXX a_val != 0 -> MIPS XCOFF executable */ + +#define AT_EUID 2000 /* euid (solaris compatible numbers) */ +#define AT_RUID 2001 /* ruid (solaris compatible numbers) */ +#define AT_EGID 2002 /* egid (solaris compatible numbers) */ +#define AT_RGID 2003 /* rgid (solaris compatible numbers) */ + + /* Solaris kernel specific */ +#define AT_SUN_LDELF 2004 /* dynamic linker's ELF header */ +#define AT_SUN_LDSHDR 2005 /* dynamic linker's section header */ +#define AT_SUN_LDNAME 2006 /* dynamic linker's name */ +#define AT_SUN_LPGSIZE 2007 /* large pagesize */ + + /* Other information */ +#define AT_SUN_PLATFORM 2008 /* sysinfo(SI_PLATFORM) */ +#define AT_SUN_HWCAP 2009 /* process hardware capabilities */ +#define AT_SUN_IFLUSH 2010 /* do we need to flush the instruction cache? */ +#define AT_SUN_CPU 2011 /* CPU name */ + /* ibcs2 emulation band aid */ +#define AT_SUN_EMUL_ENTRY 2012 /* coff entry point */ +#define AT_SUN_EMUL_EXECFD 2013 /* coff file descriptor */ + /* Executable's fully resolved name */ +#define AT_SUN_EXECNAME 2014 +#endif +/* END android-changed */ + +/* + * Note Headers + */ +typedef struct { + Elf32_Word n_namesz; + Elf32_Word n_descsz; + Elf32_Word n_type; +} Elf32_Nhdr; + +typedef struct { + Elf64_Word n_namesz; + Elf64_Word n_descsz; + Elf64_Word n_type; +} Elf64_Nhdr; + +#define ELF_NOTE_GNU_NAMESZ 4 +#define ELF_NOTE_GNU_NAME "GNU\0" + +/* + * GNU-specific note type: ABI tag + * name: GNU\0 + * namesz: 4 + * desc: + * word[0]: OS tag + * word[1]: major version + * word[2]: minor version + * word[3]: teeny version + * descsz: 16 + */ +/* GNU-specific note name and description sizes */ +#define ELF_NOTE_TYPE_ABI_TAG 1 +#define ELF_NOTE_ABI_NAME ELF_NOTE_GNU_NAME +#define ELF_NOTE_ABI_NAMESZ ELF_NOTE_GNU_NAMESZ +#define ELF_NOTE_ABI_DESCSZ 16 +/* GNU-specific OS/version value stuff */ +#define ELF_NOTE_ABI_OS_LINUX 0 +#define ELF_NOTE_ABI_OS_HURD 1 +#define ELF_NOTE_ABI_OS_SOLARIS 2 +#define ELF_NOTE_ABI_OS_KFREEBSD 3 +#define ELF_NOTE_ABI_OS_KNETBSD 4 + +/* + * GNU-specific note type: Hardware capabilities + * name: GNU\0 + * namesz: 4 + * desc: + * word[0]: Number of entries + * word[1]: Bitmask of enabled entries + * Followed by a byte id, and a NUL terminated string per entry + * descsz: variable + */ +#define ELF_NOTE_TYPE_GNU_HWCAP 2 + +/* + * GNU-specific note type: Build ID generated by ld + * name: GNU\0 + * desc: + * word[0..4] SHA1 [default] + * or + * word[0..3] md5 or uuid + * descsz: 16 or 20 + */ +#define ELF_NOTE_TYPE_GNU_BUILD_ID 3 + +/* SuSE-specific note type: ABI + * name: SuSE\0 + * namesz: 5 + * desc: + * half[0] = MMmm + * + * M = product major version + * m = product minor version + * descsz: 2 + */ +#define ELF_NOTE_TYPE_SUSE_TAG 1 +/* SuSE-specific note name and description sizes */ +#define ELF_NOTE_SUSE_NAMESZ 5 +#define ELF_NOTE_SUSE_DESCSZ 2 +/* SuSE-specific note name */ +#define ELF_NOTE_SUSE_NAME "SuSE\0" + +/* SuSE-specific note type: version + * name: SuSE\0\0\0\0 + * namesz: 8 + * desc: + * word[0] = VVTTMMmm + * + * V = version of following data + * T = product type: [box, sles, nld, whatever] + * M = product major version + * m = product minor version + * descsz: 8 + */ +#define ELF_NOTE_TYPE_SUSE_VERSION_TAG 0x45537553 /* SuSE in LE */ +/* SuSE-specific note name and description sizes */ +#define ELF_NOTE_SUSE_VERSION_NAMESZ 8 +#define ELF_NOTE_SUSE_VERSION_DESCSZ 8 +/* SuSE-specific note name */ +#define ELF_NOTE_SUSE_VERSION_NAME "SuSE\0\0\0\0" + +/* NetBSD-specific note type: Emulation name. + * name: NetBSD\0\0 + * namesz: 8 + * desc: + * word[0]: MMmmrrpp00 + * + * M = major version + * m = minor version + * r = release ["",A-Z,Z[A-Z] but numeric] + * p = patchlevel + * descsz: 4 + */ +#define ELF_NOTE_TYPE_NETBSD_TAG 1 +/* NetBSD-specific note name and description sizes */ +#define ELF_NOTE_NETBSD_NAMESZ 7 +#define ELF_NOTE_NETBSD_DESCSZ 4 +/* NetBSD-specific note name */ +#define ELF_NOTE_NETBSD_NAME "NetBSD\0\0" + +/* NetBSD-specific note type: Checksum. + * There should be 1 NOTE per PT_LOAD section. + * name: ??? + * namesz: ??? + * desc: + * a tuple of <phnum>(16),<chk-type>(16),<chk-value>. + * descsz: ??? + */ +#define ELF_NOTE_TYPE_CHECKSUM_TAG 2 +#define ELF_NOTE_CHECKSUM_CRC32 1 +#define ELF_NOTE_CHECKSUM_MD5 2 +#define ELF_NOTE_CHECKSUM_SHA1 3 +#define ELF_NOTE_CHECKSUM_SHA256 4 + +/* + * NetBSD-specific note type: PaX. + * There should be 1 NOTE per executable. + * name: PaX\0 + * namesz: 4 + * desc: + * word[0]: capability bitmask + * descsz: 4 + */ +#define ELF_NOTE_TYPE_PAX_TAG 3 +#define ELF_NOTE_PAX_MPROTECT 0x01 /* Force enable Mprotect */ +#define ELF_NOTE_PAX_NOMPROTECT 0x02 /* Force disable Mprotect */ +#define ELF_NOTE_PAX_GUARD 0x04 /* Force enable Segvguard */ +#define ELF_NOTE_PAX_NOGUARD 0x08 /* Force disable Servguard */ +#define ELF_NOTE_PAX_ASLR 0x10 /* Force enable ASLR */ +#define ELF_NOTE_PAX_NOASLR 0x20 /* Force disable ASLR */ +#define ELF_NOTE_PAX_NAMESZ 4 +#define ELF_NOTE_PAX_NAME "PaX\0" +#define ELF_NOTE_PAX_DESCSZ 4 + +/* + * NetBSD-specific core file information. + * + * NetBSD ELF core files use notes to provide information about + * the process's state. The note name is "NetBSD-CORE" for + * information that is global to the process, and "NetBSD-CORE@nn", + * where "nn" is the lwpid of the LWP that the information belongs + * to (such as register state). + * + * We use the following note identifiers: + * + * ELF_NOTE_NETBSD_CORE_PROCINFO + * Note is a "netbsd_elfcore_procinfo" structure. + * + * We also use ptrace(2) request numbers (the ones that exist in + * machine-dependent space) to identify register info notes. The + * info in such notes is in the same format that ptrace(2) would + * export that information. + * + * Please try to keep the members of this structure nicely aligned, + * and if you add elements, add them to the end and bump the version. + */ + +#define ELF_NOTE_NETBSD_CORE_NAME "NetBSD-CORE" + +#define ELF_NOTE_NETBSD_CORE_PROCINFO 1 + +#define NETBSD_ELFCORE_PROCINFO_VERSION 1 + +struct netbsd_elfcore_procinfo { + /* Version 1 fields start here. */ + uint32_t cpi_version; /* our version */ + uint32_t cpi_cpisize; /* sizeof(this struct) */ + uint32_t cpi_signo; /* killing signal */ + uint32_t cpi_sigcode; /* signal code */ + uint32_t cpi_sigpend[4]; /* pending signals */ + uint32_t cpi_sigmask[4]; /* blocked signals */ + uint32_t cpi_sigignore[4]; /* ignored signals */ + uint32_t cpi_sigcatch[4]; /* caught signals */ + int32_t cpi_pid; /* process ID */ + int32_t cpi_ppid; /* parent process ID */ + int32_t cpi_pgrp; /* process group ID */ + int32_t cpi_sid; /* session ID */ + uint32_t cpi_ruid; /* real user ID */ + uint32_t cpi_euid; /* effective user ID */ + uint32_t cpi_svuid; /* saved user ID */ + uint32_t cpi_rgid; /* real group ID */ + uint32_t cpi_egid; /* effective group ID */ + uint32_t cpi_svgid; /* saved group ID */ + uint32_t cpi_nlwps; /* number of LWPs */ + int8_t cpi_name[32]; /* copy of p->p_comm */ + /* Add version 2 fields below here. */ + int32_t cpi_siglwp; /* LWP target of killing signal */ +}; + +/* + * NetBSD-specific note type: MACHINE_ARCH. + * There should be 1 NOTE per executable. + * name: NetBSD\0 + * namesz: 7 + * desc: string + * descsz: variable + */ +#define ELF_NOTE_TYPE_MARCH_TAG 5 +/* NetBSD-specific note name and description sizes */ +#define ELF_NOTE_MARCH_NAMESZ ELF_NOTE_NETBSD_NAMESZ +/* NetBSD-specific note name */ +#define ELF_NOTE_MARCH_NAME ELF_NOTE_NETBSD_NAME + +#if !defined(ELFSIZE) && defined(ARCH_ELFSIZE) +#define ELFSIZE ARCH_ELFSIZE +#endif + +#if defined(ELFSIZE) +#define CONCAT(x,y) __CONCAT(x,y) +#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x))) +#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) +#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) +#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) +#endif + +#if defined(ELFSIZE) && (ELFSIZE == 32) +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Phdr Elf32_Phdr +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define Elf_Rel Elf32_Rel +#define Elf_Rela Elf32_Rela +#define Elf_Dyn Elf32_Dyn +#define Elf_Word Elf32_Word +#define Elf_Sword Elf32_Sword +#define Elf_Half Elf32_Half +#define Elf_Addr Elf32_Addr +#define Elf_Off Elf32_Off +#define Elf_SOff Elf32_SOff +#define Elf_Nhdr Elf32_Nhdr +#define Elf_Verdef Elf32_Verdef +#define Elf_Verdaux Elf32_Verdaux +#define Elf_Verneed Elf32_Verneed +#define Elf_Vernaux Elf32_Vernaux +#define Elf_Versym Elf32_Versym + +#define ELF_R_SYM ELF32_R_SYM +#define ELF_R_TYPE ELF32_R_TYPE +#define ELFCLASS ELFCLASS32 + +#define AuxInfo Aux32Info +#elif defined(ELFSIZE) && (ELFSIZE == 64) +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Phdr Elf64_Phdr +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define Elf_Rel Elf64_Rel +#define Elf_Rela Elf64_Rela +#define Elf_Dyn Elf64_Dyn +#define Elf_Word Elf64_Word +#define Elf_Sword Elf64_Sword +#define Elf_Half Elf64_Half +#define Elf_Addr Elf64_Addr +#define Elf_Off Elf64_Off +#define Elf_SOff Elf64_SOff +#define Elf_Nhdr Elf64_Nhdr +#define Elf_Verdef Elf64_Verdef +#define Elf_Verdaux Elf64_Verdaux +#define Elf_Verneed Elf64_Verneed +#define Elf_Vernaux Elf64_Vernaux +#define Elf_Versym Elf64_Versym + +#define ELF_R_SYM ELF64_R_SYM +#define ELF_R_TYPE ELF64_R_TYPE +#define ELFCLASS ELFCLASS64 + +#define AuxInfo Aux64Info +#endif + +#ifndef Elf_Symindx +#define Elf_Symindx uint32_t +#endif + +#define ELF32_ST_BIND(info) ELF_ST_BIND(info) +#define ELF32_ST_TYPE(info) ELF_ST_TYPE(info) +#define ELF32_ST_INFO(bind,type) ELF_ST_INFO(bind,type) +#define ELF32_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other) + +#define ELF64_ST_BIND(info) ELF_ST_BIND(info) +#define ELF64_ST_TYPE(info) ELF_ST_TYPE(info) +#define ELF64_ST_INFO(bind,type) ELF_ST_INFO(bind,type) +#define ELF64_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other) + +typedef struct { + Elf32_Half si_boundto; /* direct bindings - symbol bound to */ + Elf32_Half si_flags; /* per symbol flags */ +} Elf32_Syminfo; + +typedef struct { + Elf64_Word si_boundto; /* direct bindings - symbol bound to */ + Elf64_Word si_flags; /* per symbol flags */ +} Elf64_Syminfo; + +#define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association + to object containing definition */ +#define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */ +#define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */ +#define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be + lazily-loaded */ +#define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to + object containing definition */ +#define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference + directly bind to this symbol */ +#define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */ +#define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */ + +#define SYMINFO_BT_SELF 0xffff /* symbol bound to self */ +#define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */ +#define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */ +#define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */ +#define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */ + +#define SYMINFO_NONE 0 /* Syminfo version */ +#define SYMINFO_CURRENT 1 +#define SYMINFO_NUM 2 + +/* + * These constants are used for Elf32_Verdef struct's version number. + */ +#define VER_DEF_NONE 0 +#define VER_DEF_CURRENT 1 + +/* + * These constants are used for Elf32_Verdef struct's vd_ndx. + */ +#define VER_DEF_IDX(x) VER_NDX(x) + +/* + * These constants are used for Elf32_Verdef struct's vd_flags. + */ +#define VER_FLG_BASE 0x1 +#define VER_FLG_WEAK 0x2 + +/* + * These are used in an Elf32_Versym field. + */ +#define VER_NDX_LOCAL 0 +#define VER_NDX_GLOBAL 1 +#define VER_NDX_GIVEN 2 + +/* + * These constants are used for Elf32_Verneed struct's version number. + */ +#define VER_NEED_NONE 0 +#define VER_NEED_CURRENT 1 + +/* + * These constants are used for Elf32_Vernaux struct's vna_other. + */ +#define VER_NEED_HIDDEN VER_NDX_HIDDEN +#define VER_NEED_IDX(x) VER_NDX(x) + +/* index */ +#define VER_NDX_HIDDEN 0x8000 +#define VER_NDX(x) ((x) & ~VER_NDX_HIDDEN) + +/* + * GNU Extension hidding symbol + */ +#define VERSYM_HIDDEN 0x8000 +#define VERSYM_VERSION 0x7fff + +#define ELF_VER_CHR '@' + +/* + * These are current size independent. + */ + +typedef struct { + Elf32_Half vd_version; /* version number of structure */ + Elf32_Half vd_flags; /* flags (VER_FLG_*) */ + Elf32_Half vd_ndx; /* version index */ + Elf32_Half vd_cnt; /* number of verdaux entries */ + Elf32_Word vd_hash; /* hash of name */ + Elf32_Word vd_aux; /* offset to verdaux entries */ + Elf32_Word vd_next; /* offset to next verdef */ +} Elf32_Verdef; +typedef Elf32_Verdef Elf64_Verdef; + +typedef struct { + Elf32_Word vda_name; /* string table offset of name */ + Elf32_Word vda_next; /* offset to verdaux */ +} Elf32_Verdaux; +typedef Elf32_Verdaux Elf64_Verdaux; + +typedef struct { + Elf32_Half vn_version; /* version number of structure */ + Elf32_Half vn_cnt; /* number of vernaux entries */ + Elf32_Word vn_file; /* string table offset of library name*/ + Elf32_Word vn_aux; /* offset to vernaux entries */ + Elf32_Word vn_next; /* offset to next verneed */ +} Elf32_Verneed; +typedef Elf32_Verneed Elf64_Verneed; + +typedef struct { + Elf32_Word vna_hash; /* Hash of dependency name */ + Elf32_Half vna_flags; /* flags (VER_FLG_*) */ + Elf32_Half vna_other; /* unused */ + Elf32_Word vna_name; /* string table offset to version name*/ + Elf32_Word vna_next; /* offset to next vernaux */ +} Elf32_Vernaux; +typedef Elf32_Vernaux Elf64_Vernaux; + +typedef struct { + Elf32_Half vs_vers; +} Elf32_Versym; +typedef Elf32_Versym Elf64_Versym; + +#ifdef _KERNEL + +#define ELF_AUX_ENTRIES 15 /* Max size of aux array passed to loader */ +#define ELF32_NO_ADDR (~(Elf32_Addr)0) /* Indicates addr. not yet filled in */ +#define ELF32_LINK_ADDR ((Elf32_Addr)-2) /* advises to use link address */ +#define ELF64_NO_ADDR (~(Elf64_Addr)0) /* Indicates addr. not yet filled in */ +#define ELF64_LINK_ADDR ((Elf64_Addr)-2) /* advises to use link address */ + +#if defined(ELFSIZE) && (ELFSIZE == 64) +#define ELF_NO_ADDR ELF64_NO_ADDR +#define ELF_LINK_ADDR ELF64_LINK_ADDR +#elif defined(ELFSIZE) && (ELFSIZE == 32) +#define ELF_NO_ADDR ELF32_NO_ADDR +#define ELF_LINK_ADDR ELF32_LINK_ADDR +#endif + +#ifndef ELF32_EHDR_FLAGS_OK +#define ELF32_EHDR_FLAGS_OK(eh) 1 +#endif + +#ifndef ELF64_EHDR_FLAGS_OK +#define ELF64_EHDR_FLAGS_OK(eh) 1 +#endif + +#if defined(ELFSIZE) && (ELFSIZE == 64) +#define ELF_EHDR_FLAGS_OK(eh) ELF64_EHDR_FLAGS_OK(eh) +#else +#define ELF_EHDR_FLAGS_OK(eh) ELF32_EHDR_FLAGS_OK(eh) +#endif + +#if defined(ELFSIZE) +struct elf_args { + Elf_Addr arg_entry; /* program entry point */ + Elf_Addr arg_interp; /* Interpreter load address */ + Elf_Addr arg_phaddr; /* program header address */ + Elf_Addr arg_phentsize; /* Size of program header */ + Elf_Addr arg_phnum; /* Number of program headers */ +}; +#endif + +#ifdef _KERNEL_OPT +#include "opt_execfmt.h" +#endif + +struct ps_strings; + +#ifdef EXEC_ELF32 +int exec_elf32_makecmds(struct lwp *, struct exec_package *); +int elf32_copyargs(struct lwp *, struct exec_package *, + struct ps_strings *, char **, void *); + +int coredump_elf32(struct lwp *, void *); +int coredump_writenote_elf32(struct proc *, void *, Elf32_Nhdr *, + const char *, void *); + +int elf32_check_header(Elf32_Ehdr *, int); +#endif + +#ifdef EXEC_ELF64 +int exec_elf64_makecmds(struct lwp *, struct exec_package *); +int elf64_copyargs(struct lwp *, struct exec_package *, + struct ps_strings *, char **, void *); + +int coredump_elf64(struct lwp *, void *); +int coredump_writenote_elf64(struct proc *, void *, Elf64_Nhdr *, + const char *, void *); + +int elf64_check_header(Elf64_Ehdr *, int); +#endif + +#endif /* _KERNEL */ + +#endif /* !_SYS_EXEC_ELF_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/file.h b/9/platforms/android-19/arch-arm64/usr/include/sys/file.h new file mode 100644 index 0000000..cf2f4b1 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/file.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_FILE_H_ +#define _SYS_FILE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +/* ANDROID: needed for flock() */ +#include <unistd.h> +#include <fcntl.h> + +#endif /* _SYS_FILE_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/fsuid.h b/9/platforms/android-19/arch-arm64/usr/include/sys/fsuid.h new file mode 100644 index 0000000..bc47e3d --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/fsuid.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_FSUID_H_ +#define _SYS_FSUID_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +#if 0 /* MISSING FROM BIONIC */ +extern int setfsuid(uid_t); +extern int setfsgid(gid_t); +#endif /* MISSING */ + +__END_DECLS + +#endif /* _SYS_FSUID_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/glibc-syscalls.h b/9/platforms/android-19/arch-arm64/usr/include/sys/glibc-syscalls.h new file mode 100644 index 0000000..3131b6b --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/glibc-syscalls.h @@ -0,0 +1,1688 @@ +/* Generated by gensyscalls.py. Do not edit. */ +#ifndef _BIONIC_GLIBC_SYSCALLS_H_ +#define _BIONIC_GLIBC_SYSCALLS_H_ +#if defined(__aarch64__) +#define SYS_accept __NR_accept +#define SYS_accept4 __NR_accept4 +#define SYS_access __NR_access +#define SYS_acct __NR_acct +#define SYS_add_key __NR_add_key +#define SYS_adjtimex __NR_adjtimex +#define SYS_alarm __NR_alarm +#define SYS_arch_specific_syscall __NR_arch_specific_syscall +#define SYS_bdflush __NR_bdflush +#define SYS_bind __NR_bind +#define SYS_brk __NR_brk +#define SYS_capget __NR_capget +#define SYS_capset __NR_capset +#define SYS_chdir __NR_chdir +#define SYS_chmod __NR_chmod +#define SYS_chown __NR_chown +#define SYS_chroot __NR_chroot +#define SYS_clock_adjtime __NR_clock_adjtime +#define SYS_clock_getres __NR_clock_getres +#define SYS_clock_gettime __NR_clock_gettime +#define SYS_clock_nanosleep __NR_clock_nanosleep +#define SYS_clock_settime __NR_clock_settime +#define SYS_clone __NR_clone +#define SYS_close __NR_close +#define SYS_connect __NR_connect +#define SYS_creat __NR_creat +#define SYS_delete_module __NR_delete_module +#define SYS_dup __NR_dup +#define SYS_dup2 __NR_dup2 +#define SYS_dup3 __NR_dup3 +#define SYS_epoll_create __NR_epoll_create +#define SYS_epoll_create1 __NR_epoll_create1 +#define SYS_epoll_ctl __NR_epoll_ctl +#define SYS_epoll_pwait __NR_epoll_pwait +#define SYS_epoll_wait __NR_epoll_wait +#define SYS_eventfd __NR_eventfd +#define SYS_eventfd2 __NR_eventfd2 +#define SYS_execve __NR_execve +#define SYS_exit __NR_exit +#define SYS_exit_group __NR_exit_group +#define SYS_faccessat __NR_faccessat +#define SYS_fadvise64 __NR_fadvise64 +#define SYS_fadvise64_64 __NR_fadvise64_64 +#define SYS_fallocate __NR_fallocate +#define SYS_fanotify_init __NR_fanotify_init +#define SYS_fanotify_mark __NR_fanotify_mark +#define SYS_fchdir __NR_fchdir +#define SYS_fchmod __NR_fchmod +#define SYS_fchmodat __NR_fchmodat +#define SYS_fchown __NR_fchown +#define SYS_fchownat __NR_fchownat +#define SYS_fcntl __NR_fcntl +#define SYS_fcntl64 __NR_fcntl64 +#define SYS_fdatasync __NR_fdatasync +#define SYS_fgetxattr __NR_fgetxattr +#define SYS_finit_module __NR_finit_module +#define SYS_flistxattr __NR_flistxattr +#define SYS_flock __NR_flock +#define SYS_fork __NR_fork +#define SYS_fremovexattr __NR_fremovexattr +#define SYS_fsetxattr __NR_fsetxattr +#define SYS_fstat __NR_fstat +#define SYS_fstat64 __NR_fstat64 +#define SYS_fstatat64 __NR_fstatat64 +#define SYS_fstatfs __NR_fstatfs +#define SYS_fstatfs64 __NR_fstatfs64 +#define SYS_fsync __NR_fsync +#define SYS_ftruncate __NR_ftruncate +#define SYS_ftruncate64 __NR_ftruncate64 +#define SYS_futex __NR_futex +#define SYS_futimesat __NR_futimesat +#define SYS_get_mempolicy __NR_get_mempolicy +#define SYS_get_robust_list __NR_get_robust_list +#define SYS_getcpu __NR_getcpu +#define SYS_getcwd __NR_getcwd +#define SYS_getdents __NR_getdents +#define SYS_getdents64 __NR_getdents64 +#define SYS_getegid __NR_getegid +#define SYS_geteuid __NR_geteuid +#define SYS_getgid __NR_getgid +#define SYS_getgroups __NR_getgroups +#define SYS_getitimer __NR_getitimer +#define SYS_getpeername __NR_getpeername +#define SYS_getpgid __NR_getpgid +#define SYS_getpgrp __NR_getpgrp +#define SYS_getpid __NR_getpid +#define SYS_getppid __NR_getppid +#define SYS_getpriority __NR_getpriority +#define SYS_getresgid __NR_getresgid +#define SYS_getresuid __NR_getresuid +#define SYS_getrlimit __NR_getrlimit +#define SYS_getrusage __NR_getrusage +#define SYS_getsid __NR_getsid +#define SYS_getsockname __NR_getsockname +#define SYS_getsockopt __NR_getsockopt +#define SYS_gettid __NR_gettid +#define SYS_gettimeofday __NR_gettimeofday +#define SYS_getuid __NR_getuid +#define SYS_getxattr __NR_getxattr +#define SYS_init_module __NR_init_module +#define SYS_inotify_add_watch __NR_inotify_add_watch +#define SYS_inotify_init __NR_inotify_init +#define SYS_inotify_init1 __NR_inotify_init1 +#define SYS_inotify_rm_watch __NR_inotify_rm_watch +#define SYS_io_cancel __NR_io_cancel +#define SYS_io_destroy __NR_io_destroy +#define SYS_io_getevents __NR_io_getevents +#define SYS_io_setup __NR_io_setup +#define SYS_io_submit __NR_io_submit +#define SYS_ioctl __NR_ioctl +#define SYS_ioprio_get __NR_ioprio_get +#define SYS_ioprio_set __NR_ioprio_set +#define SYS_kcmp __NR_kcmp +#define SYS_kexec_load __NR_kexec_load +#define SYS_keyctl __NR_keyctl +#define SYS_kill __NR_kill +#define SYS_lchown __NR_lchown +#define SYS_lgetxattr __NR_lgetxattr +#define SYS_link __NR_link +#define SYS_linkat __NR_linkat +#define SYS_listen __NR_listen +#define SYS_listxattr __NR_listxattr +#define SYS_llistxattr __NR_llistxattr +#define SYS_llseek __NR_llseek +#define SYS_lookup_dcookie __NR_lookup_dcookie +#define SYS_lremovexattr __NR_lremovexattr +#define SYS_lseek __NR_lseek +#define SYS_lsetxattr __NR_lsetxattr +#define SYS_lstat __NR_lstat +#define SYS_lstat64 __NR_lstat64 +#define SYS_madvise __NR_madvise +#define SYS_mbind __NR_mbind +#define SYS_migrate_pages __NR_migrate_pages +#define SYS_mincore __NR_mincore +#define SYS_mkdir __NR_mkdir +#define SYS_mkdirat __NR_mkdirat +#define SYS_mknod __NR_mknod +#define SYS_mknodat __NR_mknodat +#define SYS_mlock __NR_mlock +#define SYS_mlockall __NR_mlockall +#define SYS_mmap __NR_mmap +#define SYS_mmap2 __NR_mmap2 +#define SYS_mount __NR_mount +#define SYS_move_pages __NR_move_pages +#define SYS_mprotect __NR_mprotect +#define SYS_mq_getsetattr __NR_mq_getsetattr +#define SYS_mq_notify __NR_mq_notify +#define SYS_mq_open __NR_mq_open +#define SYS_mq_timedreceive __NR_mq_timedreceive +#define SYS_mq_timedsend __NR_mq_timedsend +#define SYS_mq_unlink __NR_mq_unlink +#define SYS_mremap __NR_mremap +#define SYS_msgctl __NR_msgctl +#define SYS_msgget __NR_msgget +#define SYS_msgrcv __NR_msgrcv +#define SYS_msgsnd __NR_msgsnd +#define SYS_msync __NR_msync +#define SYS_munlock __NR_munlock +#define SYS_munlockall __NR_munlockall +#define SYS_munmap __NR_munmap +#define SYS_name_to_handle_at __NR_name_to_handle_at +#define SYS_nanosleep __NR_nanosleep +#define SYS_newfstatat __NR_newfstatat +#define SYS_nfsservctl __NR_nfsservctl +#define SYS_oldwait4 __NR_oldwait4 +#define SYS_open __NR_open +#define SYS_open_by_handle_at __NR_open_by_handle_at +#define SYS_openat __NR_openat +#define SYS_pause __NR_pause +#define SYS_perf_event_open __NR_perf_event_open +#define SYS_personality __NR_personality +#define SYS_pipe __NR_pipe +#define SYS_pipe2 __NR_pipe2 +#define SYS_pivot_root __NR_pivot_root +#define SYS_poll __NR_poll +#define SYS_ppoll __NR_ppoll +#define SYS_prctl __NR_prctl +#define SYS_pread64 __NR_pread64 +#define SYS_preadv __NR_preadv +#define SYS_prlimit64 __NR_prlimit64 +#define SYS_process_vm_readv __NR_process_vm_readv +#define SYS_process_vm_writev __NR_process_vm_writev +#define SYS_pselect6 __NR_pselect6 +#define SYS_ptrace __NR_ptrace +#define SYS_pwrite64 __NR_pwrite64 +#define SYS_pwritev __NR_pwritev +#define SYS_quotactl __NR_quotactl +#define SYS_read __NR_read +#define SYS_readahead __NR_readahead +#define SYS_readlink __NR_readlink +#define SYS_readlinkat __NR_readlinkat +#define SYS_readv __NR_readv +#define SYS_reboot __NR_reboot +#define SYS_recv __NR_recv +#define SYS_recvfrom __NR_recvfrom +#define SYS_recvmmsg __NR_recvmmsg +#define SYS_recvmsg __NR_recvmsg +#define SYS_remap_file_pages __NR_remap_file_pages +#define SYS_removexattr __NR_removexattr +#define SYS_rename __NR_rename +#define SYS_renameat __NR_renameat +#define SYS_request_key __NR_request_key +#define SYS_restart_syscall __NR_restart_syscall +#define SYS_rmdir __NR_rmdir +#define SYS_rt_sigaction __NR_rt_sigaction +#define SYS_rt_sigpending __NR_rt_sigpending +#define SYS_rt_sigprocmask __NR_rt_sigprocmask +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define SYS_rt_sigreturn __NR_rt_sigreturn +#define SYS_rt_sigsuspend __NR_rt_sigsuspend +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo +#define SYS_sched_get_priority_max __NR_sched_get_priority_max +#define SYS_sched_get_priority_min __NR_sched_get_priority_min +#define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getparam __NR_sched_getparam +#define SYS_sched_getscheduler __NR_sched_getscheduler +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval +#define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setparam __NR_sched_setparam +#define SYS_sched_setscheduler __NR_sched_setscheduler +#define SYS_sched_yield __NR_sched_yield +#define SYS_select __NR_select +#define SYS_semctl __NR_semctl +#define SYS_semget __NR_semget +#define SYS_semop __NR_semop +#define SYS_semtimedop __NR_semtimedop +#define SYS_send __NR_send +#define SYS_sendfile __NR_sendfile +#define SYS_sendfile64 __NR_sendfile64 +#define SYS_sendmmsg __NR_sendmmsg +#define SYS_sendmsg __NR_sendmsg +#define SYS_sendto __NR_sendto +#define SYS_set_mempolicy __NR_set_mempolicy +#define SYS_set_robust_list __NR_set_robust_list +#define SYS_set_tid_address __NR_set_tid_address +#define SYS_setdomainname __NR_setdomainname +#define SYS_setfsgid __NR_setfsgid +#define SYS_setfsuid __NR_setfsuid +#define SYS_setgid __NR_setgid +#define SYS_setgroups __NR_setgroups +#define SYS_sethostname __NR_sethostname +#define SYS_setitimer __NR_setitimer +#define SYS_setns __NR_setns +#define SYS_setpgid __NR_setpgid +#define SYS_setpriority __NR_setpriority +#define SYS_setregid __NR_setregid +#define SYS_setresgid __NR_setresgid +#define SYS_setresuid __NR_setresuid +#define SYS_setreuid __NR_setreuid +#define SYS_setrlimit __NR_setrlimit +#define SYS_setsid __NR_setsid +#define SYS_setsockopt __NR_setsockopt +#define SYS_settimeofday __NR_settimeofday +#define SYS_setuid __NR_setuid +#define SYS_setxattr __NR_setxattr +#define SYS_shmat __NR_shmat +#define SYS_shmctl __NR_shmctl +#define SYS_shmdt __NR_shmdt +#define SYS_shmget __NR_shmget +#define SYS_shutdown __NR_shutdown +#define SYS_sigaltstack __NR_sigaltstack +#define SYS_signalfd __NR_signalfd +#define SYS_signalfd4 __NR_signalfd4 +#define SYS_socket __NR_socket +#define SYS_socketpair __NR_socketpair +#define SYS_splice __NR_splice +#define SYS_stat __NR_stat +#define SYS_stat64 __NR_stat64 +#define SYS_statfs __NR_statfs +#define SYS_statfs64 __NR_statfs64 +#define SYS_swapoff __NR_swapoff +#define SYS_swapon __NR_swapon +#define SYS_symlink __NR_symlink +#define SYS_symlinkat __NR_symlinkat +#define SYS_sync __NR_sync +#define SYS_sync_file_range __NR_sync_file_range +#define SYS_sync_file_range2 __NR_sync_file_range2 +#define SYS_syncfs __NR_syncfs +#define SYS_syscalls __NR_syscalls +#define SYS_sysinfo __NR_sysinfo +#define SYS_syslog __NR_syslog +#define SYS_tee __NR_tee +#define SYS_tgkill __NR_tgkill +#define SYS_time __NR_time +#define SYS_timer_create __NR_timer_create +#define SYS_timer_delete __NR_timer_delete +#define SYS_timer_getoverrun __NR_timer_getoverrun +#define SYS_timer_gettime __NR_timer_gettime +#define SYS_timer_settime __NR_timer_settime +#define SYS_timerfd_create __NR_timerfd_create +#define SYS_timerfd_gettime __NR_timerfd_gettime +#define SYS_timerfd_settime __NR_timerfd_settime +#define SYS_times __NR_times +#define SYS_tkill __NR_tkill +#define SYS_truncate __NR_truncate +#define SYS_truncate64 __NR_truncate64 +#define SYS_umask __NR_umask +#define SYS_umount __NR_umount +#define SYS_umount2 __NR_umount2 +#define SYS_uname __NR_uname +#define SYS_unlink __NR_unlink +#define SYS_unlinkat __NR_unlinkat +#define SYS_unshare __NR_unshare +#define SYS_uselib __NR_uselib +#define SYS_ustat __NR_ustat +#define SYS_utime __NR_utime +#define SYS_utimensat __NR_utimensat +#define SYS_utimes __NR_utimes +#define SYS_vfork __NR_vfork +#define SYS_vhangup __NR_vhangup +#define SYS_vmsplice __NR_vmsplice +#define SYS_wait4 __NR_wait4 +#define SYS_waitid __NR_waitid +#define SYS_write __NR_write +#define SYS_writev __NR_writev +#elif defined(__arm__) +#define SYS_accept __NR_accept +#define SYS_accept4 __NR_accept4 +#define SYS_access __NR_access +#define SYS_acct __NR_acct +#define SYS_add_key __NR_add_key +#define SYS_adjtimex __NR_adjtimex +#define SYS_alarm __NR_alarm +#define SYS_arm_fadvise64_64 __NR_arm_fadvise64_64 +#define SYS_arm_sync_file_range __NR_arm_sync_file_range +#define SYS_bdflush __NR_bdflush +#define SYS_bind __NR_bind +#define SYS_brk __NR_brk +#define SYS_capget __NR_capget +#define SYS_capset __NR_capset +#define SYS_chdir __NR_chdir +#define SYS_chmod __NR_chmod +#define SYS_chown __NR_chown +#define SYS_chown32 __NR_chown32 +#define SYS_chroot __NR_chroot +#define SYS_clock_adjtime __NR_clock_adjtime +#define SYS_clock_getres __NR_clock_getres +#define SYS_clock_gettime __NR_clock_gettime +#define SYS_clock_nanosleep __NR_clock_nanosleep +#define SYS_clock_settime __NR_clock_settime +#define SYS_clone __NR_clone +#define SYS_close __NR_close +#define SYS_connect __NR_connect +#define SYS_creat __NR_creat +#define SYS_delete_module __NR_delete_module +#define SYS_dup __NR_dup +#define SYS_dup2 __NR_dup2 +#define SYS_dup3 __NR_dup3 +#define SYS_epoll_create __NR_epoll_create +#define SYS_epoll_create1 __NR_epoll_create1 +#define SYS_epoll_ctl __NR_epoll_ctl +#define SYS_epoll_pwait __NR_epoll_pwait +#define SYS_epoll_wait __NR_epoll_wait +#define SYS_eventfd __NR_eventfd +#define SYS_eventfd2 __NR_eventfd2 +#define SYS_execve __NR_execve +#define SYS_exit __NR_exit +#define SYS_exit_group __NR_exit_group +#define SYS_faccessat __NR_faccessat +#define SYS_fallocate __NR_fallocate +#define SYS_fanotify_init __NR_fanotify_init +#define SYS_fanotify_mark __NR_fanotify_mark +#define SYS_fchdir __NR_fchdir +#define SYS_fchmod __NR_fchmod +#define SYS_fchmodat __NR_fchmodat +#define SYS_fchown __NR_fchown +#define SYS_fchown32 __NR_fchown32 +#define SYS_fchownat __NR_fchownat +#define SYS_fcntl __NR_fcntl +#define SYS_fcntl64 __NR_fcntl64 +#define SYS_fdatasync __NR_fdatasync +#define SYS_fgetxattr __NR_fgetxattr +#define SYS_finit_module __NR_finit_module +#define SYS_flistxattr __NR_flistxattr +#define SYS_flock __NR_flock +#define SYS_fork __NR_fork +#define SYS_fremovexattr __NR_fremovexattr +#define SYS_fsetxattr __NR_fsetxattr +#define SYS_fstat __NR_fstat +#define SYS_fstat64 __NR_fstat64 +#define SYS_fstatat64 __NR_fstatat64 +#define SYS_fstatfs __NR_fstatfs +#define SYS_fstatfs64 __NR_fstatfs64 +#define SYS_fsync __NR_fsync +#define SYS_ftruncate __NR_ftruncate +#define SYS_ftruncate64 __NR_ftruncate64 +#define SYS_futex __NR_futex +#define SYS_futimesat __NR_futimesat +#define SYS_get_mempolicy __NR_get_mempolicy +#define SYS_get_robust_list __NR_get_robust_list +#define SYS_getcpu __NR_getcpu +#define SYS_getcwd __NR_getcwd +#define SYS_getdents __NR_getdents +#define SYS_getdents64 __NR_getdents64 +#define SYS_getegid __NR_getegid +#define SYS_getegid32 __NR_getegid32 +#define SYS_geteuid __NR_geteuid +#define SYS_geteuid32 __NR_geteuid32 +#define SYS_getgid __NR_getgid +#define SYS_getgid32 __NR_getgid32 +#define SYS_getgroups __NR_getgroups +#define SYS_getgroups32 __NR_getgroups32 +#define SYS_getitimer __NR_getitimer +#define SYS_getpeername __NR_getpeername +#define SYS_getpgid __NR_getpgid +#define SYS_getpgrp __NR_getpgrp +#define SYS_getpid __NR_getpid +#define SYS_getppid __NR_getppid +#define SYS_getpriority __NR_getpriority +#define SYS_getresgid __NR_getresgid +#define SYS_getresgid32 __NR_getresgid32 +#define SYS_getresuid __NR_getresuid +#define SYS_getresuid32 __NR_getresuid32 +#define SYS_getrlimit __NR_getrlimit +#define SYS_getrusage __NR_getrusage +#define SYS_getsid __NR_getsid +#define SYS_getsockname __NR_getsockname +#define SYS_getsockopt __NR_getsockopt +#define SYS_gettid __NR_gettid +#define SYS_gettimeofday __NR_gettimeofday +#define SYS_getuid __NR_getuid +#define SYS_getuid32 __NR_getuid32 +#define SYS_getxattr __NR_getxattr +#define SYS_init_module __NR_init_module +#define SYS_inotify_add_watch __NR_inotify_add_watch +#define SYS_inotify_init __NR_inotify_init +#define SYS_inotify_init1 __NR_inotify_init1 +#define SYS_inotify_rm_watch __NR_inotify_rm_watch +#define SYS_io_cancel __NR_io_cancel +#define SYS_io_destroy __NR_io_destroy +#define SYS_io_getevents __NR_io_getevents +#define SYS_io_setup __NR_io_setup +#define SYS_io_submit __NR_io_submit +#define SYS_ioctl __NR_ioctl +#define SYS_ioprio_get __NR_ioprio_get +#define SYS_ioprio_set __NR_ioprio_set +#define SYS_ipc __NR_ipc +#define SYS_kcmp __NR_kcmp +#define SYS_kexec_load __NR_kexec_load +#define SYS_keyctl __NR_keyctl +#define SYS_kill __NR_kill +#define SYS_lchown __NR_lchown +#define SYS_lchown32 __NR_lchown32 +#define SYS_lgetxattr __NR_lgetxattr +#define SYS_link __NR_link +#define SYS_linkat __NR_linkat +#define SYS_listen __NR_listen +#define SYS_listxattr __NR_listxattr +#define SYS_llistxattr __NR_llistxattr +#define SYS_lookup_dcookie __NR_lookup_dcookie +#define SYS_lremovexattr __NR_lremovexattr +#define SYS_lseek __NR_lseek +#define SYS_lsetxattr __NR_lsetxattr +#define SYS_lstat __NR_lstat +#define SYS_lstat64 __NR_lstat64 +#define SYS_madvise __NR_madvise +#define SYS_mbind __NR_mbind +#define SYS_mincore __NR_mincore +#define SYS_mkdir __NR_mkdir +#define SYS_mkdirat __NR_mkdirat +#define SYS_mknod __NR_mknod +#define SYS_mknodat __NR_mknodat +#define SYS_mlock __NR_mlock +#define SYS_mlockall __NR_mlockall +#define SYS_mmap __NR_mmap +#define SYS_mmap2 __NR_mmap2 +#define SYS_mount __NR_mount +#define SYS_move_pages __NR_move_pages +#define SYS_mprotect __NR_mprotect +#define SYS_mq_getsetattr __NR_mq_getsetattr +#define SYS_mq_notify __NR_mq_notify +#define SYS_mq_open __NR_mq_open +#define SYS_mq_timedreceive __NR_mq_timedreceive +#define SYS_mq_timedsend __NR_mq_timedsend +#define SYS_mq_unlink __NR_mq_unlink +#define SYS_mremap __NR_mremap +#define SYS_msgctl __NR_msgctl +#define SYS_msgget __NR_msgget +#define SYS_msgrcv __NR_msgrcv +#define SYS_msgsnd __NR_msgsnd +#define SYS_msync __NR_msync +#define SYS_munlock __NR_munlock +#define SYS_munlockall __NR_munlockall +#define SYS_munmap __NR_munmap +#define SYS_name_to_handle_at __NR_name_to_handle_at +#define SYS_nanosleep __NR_nanosleep +#define SYS_nfsservctl __NR_nfsservctl +#define SYS_nice __NR_nice +#define SYS_open __NR_open +#define SYS_open_by_handle_at __NR_open_by_handle_at +#define SYS_openat __NR_openat +#define SYS_pause __NR_pause +#define SYS_pciconfig_iobase __NR_pciconfig_iobase +#define SYS_pciconfig_read __NR_pciconfig_read +#define SYS_pciconfig_write __NR_pciconfig_write +#define SYS_perf_event_open __NR_perf_event_open +#define SYS_personality __NR_personality +#define SYS_pipe __NR_pipe +#define SYS_pipe2 __NR_pipe2 +#define SYS_pivot_root __NR_pivot_root +#define SYS_poll __NR_poll +#define SYS_ppoll __NR_ppoll +#define SYS_prctl __NR_prctl +#define SYS_pread64 __NR_pread64 +#define SYS_preadv __NR_preadv +#define SYS_prlimit64 __NR_prlimit64 +#define SYS_process_vm_readv __NR_process_vm_readv +#define SYS_process_vm_writev __NR_process_vm_writev +#define SYS_pselect6 __NR_pselect6 +#define SYS_ptrace __NR_ptrace +#define SYS_pwrite64 __NR_pwrite64 +#define SYS_pwritev __NR_pwritev +#define SYS_quotactl __NR_quotactl +#define SYS_read __NR_read +#define SYS_readahead __NR_readahead +#define SYS_readdir __NR_readdir +#define SYS_readlink __NR_readlink +#define SYS_readlinkat __NR_readlinkat +#define SYS_readv __NR_readv +#define SYS_reboot __NR_reboot +#define SYS_recv __NR_recv +#define SYS_recvfrom __NR_recvfrom +#define SYS_recvmmsg __NR_recvmmsg +#define SYS_recvmsg __NR_recvmsg +#define SYS_remap_file_pages __NR_remap_file_pages +#define SYS_removexattr __NR_removexattr +#define SYS_rename __NR_rename +#define SYS_renameat __NR_renameat +#define SYS_request_key __NR_request_key +#define SYS_restart_syscall __NR_restart_syscall +#define SYS_rmdir __NR_rmdir +#define SYS_rt_sigaction __NR_rt_sigaction +#define SYS_rt_sigpending __NR_rt_sigpending +#define SYS_rt_sigprocmask __NR_rt_sigprocmask +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define SYS_rt_sigreturn __NR_rt_sigreturn +#define SYS_rt_sigsuspend __NR_rt_sigsuspend +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo +#define SYS_sched_get_priority_max __NR_sched_get_priority_max +#define SYS_sched_get_priority_min __NR_sched_get_priority_min +#define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getparam __NR_sched_getparam +#define SYS_sched_getscheduler __NR_sched_getscheduler +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval +#define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setparam __NR_sched_setparam +#define SYS_sched_setscheduler __NR_sched_setscheduler +#define SYS_sched_yield __NR_sched_yield +#define SYS_select __NR_select +#define SYS_semctl __NR_semctl +#define SYS_semget __NR_semget +#define SYS_semop __NR_semop +#define SYS_semtimedop __NR_semtimedop +#define SYS_send __NR_send +#define SYS_sendfile __NR_sendfile +#define SYS_sendfile64 __NR_sendfile64 +#define SYS_sendmmsg __NR_sendmmsg +#define SYS_sendmsg __NR_sendmsg +#define SYS_sendto __NR_sendto +#define SYS_set_mempolicy __NR_set_mempolicy +#define SYS_set_robust_list __NR_set_robust_list +#define SYS_set_tid_address __NR_set_tid_address +#define SYS_setdomainname __NR_setdomainname +#define SYS_setfsgid __NR_setfsgid +#define SYS_setfsgid32 __NR_setfsgid32 +#define SYS_setfsuid __NR_setfsuid +#define SYS_setfsuid32 __NR_setfsuid32 +#define SYS_setgid __NR_setgid +#define SYS_setgid32 __NR_setgid32 +#define SYS_setgroups __NR_setgroups +#define SYS_setgroups32 __NR_setgroups32 +#define SYS_sethostname __NR_sethostname +#define SYS_setitimer __NR_setitimer +#define SYS_setns __NR_setns +#define SYS_setpgid __NR_setpgid +#define SYS_setpriority __NR_setpriority +#define SYS_setregid __NR_setregid +#define SYS_setregid32 __NR_setregid32 +#define SYS_setresgid __NR_setresgid +#define SYS_setresgid32 __NR_setresgid32 +#define SYS_setresuid __NR_setresuid +#define SYS_setresuid32 __NR_setresuid32 +#define SYS_setreuid __NR_setreuid +#define SYS_setreuid32 __NR_setreuid32 +#define SYS_setrlimit __NR_setrlimit +#define SYS_setsid __NR_setsid +#define SYS_setsockopt __NR_setsockopt +#define SYS_settimeofday __NR_settimeofday +#define SYS_setuid __NR_setuid +#define SYS_setuid32 __NR_setuid32 +#define SYS_setxattr __NR_setxattr +#define SYS_shmat __NR_shmat +#define SYS_shmctl __NR_shmctl +#define SYS_shmdt __NR_shmdt +#define SYS_shmget __NR_shmget +#define SYS_shutdown __NR_shutdown +#define SYS_sigaction __NR_sigaction +#define SYS_sigaltstack __NR_sigaltstack +#define SYS_signalfd __NR_signalfd +#define SYS_signalfd4 __NR_signalfd4 +#define SYS_sigpending __NR_sigpending +#define SYS_sigprocmask __NR_sigprocmask +#define SYS_sigreturn __NR_sigreturn +#define SYS_sigsuspend __NR_sigsuspend +#define SYS_socket __NR_socket +#define SYS_socketcall __NR_socketcall +#define SYS_socketpair __NR_socketpair +#define SYS_splice __NR_splice +#define SYS_stat __NR_stat +#define SYS_stat64 __NR_stat64 +#define SYS_statfs __NR_statfs +#define SYS_statfs64 __NR_statfs64 +#define SYS_stime __NR_stime +#define SYS_swapoff __NR_swapoff +#define SYS_swapon __NR_swapon +#define SYS_symlink __NR_symlink +#define SYS_symlinkat __NR_symlinkat +#define SYS_sync __NR_sync +#define SYS_sync_file_range2 __NR_sync_file_range2 +#define SYS_syncfs __NR_syncfs +#define SYS_syscall __NR_syscall +#define SYS_sysfs __NR_sysfs +#define SYS_sysinfo __NR_sysinfo +#define SYS_syslog __NR_syslog +#define SYS_tee __NR_tee +#define SYS_tgkill __NR_tgkill +#define SYS_time __NR_time +#define SYS_timer_create __NR_timer_create +#define SYS_timer_delete __NR_timer_delete +#define SYS_timer_getoverrun __NR_timer_getoverrun +#define SYS_timer_gettime __NR_timer_gettime +#define SYS_timer_settime __NR_timer_settime +#define SYS_timerfd_create __NR_timerfd_create +#define SYS_timerfd_gettime __NR_timerfd_gettime +#define SYS_timerfd_settime __NR_timerfd_settime +#define SYS_times __NR_times +#define SYS_tkill __NR_tkill +#define SYS_truncate __NR_truncate +#define SYS_truncate64 __NR_truncate64 +#define SYS_ugetrlimit __NR_ugetrlimit +#define SYS_umask __NR_umask +#define SYS_umount __NR_umount +#define SYS_umount2 __NR_umount2 +#define SYS_uname __NR_uname +#define SYS_unlink __NR_unlink +#define SYS_unlinkat __NR_unlinkat +#define SYS_unshare __NR_unshare +#define SYS_uselib __NR_uselib +#define SYS_ustat __NR_ustat +#define SYS_utime __NR_utime +#define SYS_utimensat __NR_utimensat +#define SYS_utimes __NR_utimes +#define SYS_vfork __NR_vfork +#define SYS_vhangup __NR_vhangup +#define SYS_vmsplice __NR_vmsplice +#define SYS_vserver __NR_vserver +#define SYS_wait4 __NR_wait4 +#define SYS_waitid __NR_waitid +#define SYS_write __NR_write +#define SYS_writev __NR_writev +#elif defined(__mips__) +#define SYS_accept __NR_accept +#define SYS_accept4 __NR_accept4 +#define SYS_access __NR_access +#define SYS_acct __NR_acct +#define SYS_add_key __NR_add_key +#define SYS_adjtimex __NR_adjtimex +#define SYS_afs_syscall __NR_afs_syscall +#define SYS_alarm __NR_alarm +#define SYS_bdflush __NR_bdflush +#define SYS_bind __NR_bind +#define SYS_break __NR_break +#define SYS_brk __NR_brk +#define SYS_cachectl __NR_cachectl +#define SYS_cacheflush __NR_cacheflush +#define SYS_capget __NR_capget +#define SYS_capset __NR_capset +#define SYS_chdir __NR_chdir +#define SYS_chmod __NR_chmod +#define SYS_chown __NR_chown +#define SYS_chroot __NR_chroot +#define SYS_clock_adjtime __NR_clock_adjtime +#define SYS_clock_getres __NR_clock_getres +#define SYS_clock_gettime __NR_clock_gettime +#define SYS_clock_nanosleep __NR_clock_nanosleep +#define SYS_clock_settime __NR_clock_settime +#define SYS_clone __NR_clone +#define SYS_close __NR_close +#define SYS_connect __NR_connect +#define SYS_creat __NR_creat +#define SYS_create_module __NR_create_module +#define SYS_delete_module __NR_delete_module +#define SYS_dup __NR_dup +#define SYS_dup2 __NR_dup2 +#define SYS_dup3 __NR_dup3 +#define SYS_epoll_create __NR_epoll_create +#define SYS_epoll_create1 __NR_epoll_create1 +#define SYS_epoll_ctl __NR_epoll_ctl +#define SYS_epoll_pwait __NR_epoll_pwait +#define SYS_epoll_wait __NR_epoll_wait +#define SYS_eventfd __NR_eventfd +#define SYS_eventfd2 __NR_eventfd2 +#define SYS_execve __NR_execve +#define SYS_exit __NR_exit +#define SYS_exit_group __NR_exit_group +#define SYS_faccessat __NR_faccessat +#define SYS_fadvise64 __NR_fadvise64 +#define SYS_fallocate __NR_fallocate +#define SYS_fanotify_init __NR_fanotify_init +#define SYS_fanotify_mark __NR_fanotify_mark +#define SYS_fchdir __NR_fchdir +#define SYS_fchmod __NR_fchmod +#define SYS_fchmodat __NR_fchmodat +#define SYS_fchown __NR_fchown +#define SYS_fchownat __NR_fchownat +#define SYS_fcntl __NR_fcntl +#define SYS_fcntl64 __NR_fcntl64 +#define SYS_fdatasync __NR_fdatasync +#define SYS_fgetxattr __NR_fgetxattr +#define SYS_finit_module __NR_finit_module +#define SYS_flistxattr __NR_flistxattr +#define SYS_flock __NR_flock +#define SYS_fork __NR_fork +#define SYS_fremovexattr __NR_fremovexattr +#define SYS_fsetxattr __NR_fsetxattr +#define SYS_fstat __NR_fstat +#define SYS_fstat64 __NR_fstat64 +#define SYS_fstatat64 __NR_fstatat64 +#define SYS_fstatfs __NR_fstatfs +#define SYS_fstatfs64 __NR_fstatfs64 +#define SYS_fsync __NR_fsync +#define SYS_ftime __NR_ftime +#define SYS_ftruncate __NR_ftruncate +#define SYS_ftruncate64 __NR_ftruncate64 +#define SYS_futex __NR_futex +#define SYS_futimesat __NR_futimesat +#define SYS_get_kernel_syms __NR_get_kernel_syms +#define SYS_get_mempolicy __NR_get_mempolicy +#define SYS_get_robust_list __NR_get_robust_list +#define SYS_getcpu __NR_getcpu +#define SYS_getcwd __NR_getcwd +#define SYS_getdents __NR_getdents +#define SYS_getdents64 __NR_getdents64 +#define SYS_getegid __NR_getegid +#define SYS_geteuid __NR_geteuid +#define SYS_getgid __NR_getgid +#define SYS_getgroups __NR_getgroups +#define SYS_getitimer __NR_getitimer +#define SYS_getpeername __NR_getpeername +#define SYS_getpgid __NR_getpgid +#define SYS_getpgrp __NR_getpgrp +#define SYS_getpid __NR_getpid +#define SYS_getpmsg __NR_getpmsg +#define SYS_getppid __NR_getppid +#define SYS_getpriority __NR_getpriority +#define SYS_getresgid __NR_getresgid +#define SYS_getresuid __NR_getresuid +#define SYS_getrlimit __NR_getrlimit +#define SYS_getrusage __NR_getrusage +#define SYS_getsid __NR_getsid +#define SYS_getsockname __NR_getsockname +#define SYS_getsockopt __NR_getsockopt +#define SYS_gettid __NR_gettid +#define SYS_gettimeofday __NR_gettimeofday +#define SYS_getuid __NR_getuid +#define SYS_getxattr __NR_getxattr +#define SYS_gtty __NR_gtty +#define SYS_idle __NR_idle +#define SYS_init_module __NR_init_module +#define SYS_inotify_add_watch __NR_inotify_add_watch +#define SYS_inotify_init __NR_inotify_init +#define SYS_inotify_init1 __NR_inotify_init1 +#define SYS_inotify_rm_watch __NR_inotify_rm_watch +#define SYS_io_cancel __NR_io_cancel +#define SYS_io_destroy __NR_io_destroy +#define SYS_io_getevents __NR_io_getevents +#define SYS_io_setup __NR_io_setup +#define SYS_io_submit __NR_io_submit +#define SYS_ioctl __NR_ioctl +#define SYS_ioperm __NR_ioperm +#define SYS_iopl __NR_iopl +#define SYS_ioprio_get __NR_ioprio_get +#define SYS_ioprio_set __NR_ioprio_set +#define SYS_ipc __NR_ipc +#define SYS_kcmp __NR_kcmp +#define SYS_kexec_load __NR_kexec_load +#define SYS_keyctl __NR_keyctl +#define SYS_kill __NR_kill +#define SYS_lchown __NR_lchown +#define SYS_lgetxattr __NR_lgetxattr +#define SYS_link __NR_link +#define SYS_linkat __NR_linkat +#define SYS_listen __NR_listen +#define SYS_listxattr __NR_listxattr +#define SYS_llistxattr __NR_llistxattr +#define SYS_lock __NR_lock +#define SYS_lookup_dcookie __NR_lookup_dcookie +#define SYS_lremovexattr __NR_lremovexattr +#define SYS_lseek __NR_lseek +#define SYS_lsetxattr __NR_lsetxattr +#define SYS_lstat __NR_lstat +#define SYS_lstat64 __NR_lstat64 +#define SYS_madvise __NR_madvise +#define SYS_mbind __NR_mbind +#define SYS_migrate_pages __NR_migrate_pages +#define SYS_mincore __NR_mincore +#define SYS_mkdir __NR_mkdir +#define SYS_mkdirat __NR_mkdirat +#define SYS_mknod __NR_mknod +#define SYS_mknodat __NR_mknodat +#define SYS_mlock __NR_mlock +#define SYS_mlockall __NR_mlockall +#define SYS_mmap __NR_mmap +#define SYS_mmap2 __NR_mmap2 +#define SYS_modify_ldt __NR_modify_ldt +#define SYS_mount __NR_mount +#define SYS_move_pages __NR_move_pages +#define SYS_mprotect __NR_mprotect +#define SYS_mpx __NR_mpx +#define SYS_mq_getsetattr __NR_mq_getsetattr +#define SYS_mq_notify __NR_mq_notify +#define SYS_mq_open __NR_mq_open +#define SYS_mq_timedreceive __NR_mq_timedreceive +#define SYS_mq_timedsend __NR_mq_timedsend +#define SYS_mq_unlink __NR_mq_unlink +#define SYS_mremap __NR_mremap +#define SYS_msgctl __NR_msgctl +#define SYS_msgget __NR_msgget +#define SYS_msgrcv __NR_msgrcv +#define SYS_msgsnd __NR_msgsnd +#define SYS_msync __NR_msync +#define SYS_munlock __NR_munlock +#define SYS_munlockall __NR_munlockall +#define SYS_munmap __NR_munmap +#define SYS_name_to_handle_at __NR_name_to_handle_at +#define SYS_nanosleep __NR_nanosleep +#define SYS_newfstatat __NR_newfstatat +#define SYS_nfsservctl __NR_nfsservctl +#define SYS_nice __NR_nice +#define SYS_open __NR_open +#define SYS_open_by_handle_at __NR_open_by_handle_at +#define SYS_openat __NR_openat +#define SYS_pause __NR_pause +#define SYS_perf_event_open __NR_perf_event_open +#define SYS_personality __NR_personality +#define SYS_pipe __NR_pipe +#define SYS_pipe2 __NR_pipe2 +#define SYS_pivot_root __NR_pivot_root +#define SYS_poll __NR_poll +#define SYS_ppoll __NR_ppoll +#define SYS_prctl __NR_prctl +#define SYS_pread64 __NR_pread64 +#define SYS_preadv __NR_preadv +#define SYS_prlimit64 __NR_prlimit64 +#define SYS_process_vm_readv __NR_process_vm_readv +#define SYS_process_vm_writev __NR_process_vm_writev +#define SYS_prof __NR_prof +#define SYS_profil __NR_profil +#define SYS_pselect6 __NR_pselect6 +#define SYS_ptrace __NR_ptrace +#define SYS_putpmsg __NR_putpmsg +#define SYS_pwrite64 __NR_pwrite64 +#define SYS_pwritev __NR_pwritev +#define SYS_query_module __NR_query_module +#define SYS_quotactl __NR_quotactl +#define SYS_read __NR_read +#define SYS_readahead __NR_readahead +#define SYS_readdir __NR_readdir +#define SYS_readlink __NR_readlink +#define SYS_readlinkat __NR_readlinkat +#define SYS_readv __NR_readv +#define SYS_reboot __NR_reboot +#define SYS_recv __NR_recv +#define SYS_recvfrom __NR_recvfrom +#define SYS_recvmmsg __NR_recvmmsg +#define SYS_recvmsg __NR_recvmsg +#define SYS_remap_file_pages __NR_remap_file_pages +#define SYS_removexattr __NR_removexattr +#define SYS_rename __NR_rename +#define SYS_renameat __NR_renameat +#define SYS_request_key __NR_request_key +#define SYS_reserved177 __NR_reserved177 +#define SYS_reserved193 __NR_reserved193 +#define SYS_reserved221 __NR_reserved221 +#define SYS_reserved82 __NR_reserved82 +#define SYS_restart_syscall __NR_restart_syscall +#define SYS_rmdir __NR_rmdir +#define SYS_rt_sigaction __NR_rt_sigaction +#define SYS_rt_sigpending __NR_rt_sigpending +#define SYS_rt_sigprocmask __NR_rt_sigprocmask +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define SYS_rt_sigreturn __NR_rt_sigreturn +#define SYS_rt_sigsuspend __NR_rt_sigsuspend +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo +#define SYS_sched_get_priority_max __NR_sched_get_priority_max +#define SYS_sched_get_priority_min __NR_sched_get_priority_min +#define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getparam __NR_sched_getparam +#define SYS_sched_getscheduler __NR_sched_getscheduler +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval +#define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setparam __NR_sched_setparam +#define SYS_sched_setscheduler __NR_sched_setscheduler +#define SYS_sched_yield __NR_sched_yield +#define SYS_semctl __NR_semctl +#define SYS_semget __NR_semget +#define SYS_semop __NR_semop +#define SYS_semtimedop __NR_semtimedop +#define SYS_send __NR_send +#define SYS_sendfile __NR_sendfile +#define SYS_sendfile64 __NR_sendfile64 +#define SYS_sendmmsg __NR_sendmmsg +#define SYS_sendmsg __NR_sendmsg +#define SYS_sendto __NR_sendto +#define SYS_set_mempolicy __NR_set_mempolicy +#define SYS_set_robust_list __NR_set_robust_list +#define SYS_set_thread_area __NR_set_thread_area +#define SYS_set_tid_address __NR_set_tid_address +#define SYS_setdomainname __NR_setdomainname +#define SYS_setfsgid __NR_setfsgid +#define SYS_setfsuid __NR_setfsuid +#define SYS_setgid __NR_setgid +#define SYS_setgroups __NR_setgroups +#define SYS_sethostname __NR_sethostname +#define SYS_setitimer __NR_setitimer +#define SYS_setns __NR_setns +#define SYS_setpgid __NR_setpgid +#define SYS_setpriority __NR_setpriority +#define SYS_setregid __NR_setregid +#define SYS_setresgid __NR_setresgid +#define SYS_setresuid __NR_setresuid +#define SYS_setreuid __NR_setreuid +#define SYS_setrlimit __NR_setrlimit +#define SYS_setsid __NR_setsid +#define SYS_setsockopt __NR_setsockopt +#define SYS_settimeofday __NR_settimeofday +#define SYS_setuid __NR_setuid +#define SYS_setxattr __NR_setxattr +#define SYS_sgetmask __NR_sgetmask +#define SYS_shmat __NR_shmat +#define SYS_shmctl __NR_shmctl +#define SYS_shmdt __NR_shmdt +#define SYS_shmget __NR_shmget +#define SYS_shutdown __NR_shutdown +#define SYS_sigaction __NR_sigaction +#define SYS_sigaltstack __NR_sigaltstack +#define SYS_signal __NR_signal +#define SYS_signalfd __NR_signalfd +#define SYS_signalfd4 __NR_signalfd4 +#define SYS_sigpending __NR_sigpending +#define SYS_sigprocmask __NR_sigprocmask +#define SYS_sigreturn __NR_sigreturn +#define SYS_sigsuspend __NR_sigsuspend +#define SYS_socket __NR_socket +#define SYS_socketcall __NR_socketcall +#define SYS_socketpair __NR_socketpair +#define SYS_splice __NR_splice +#define SYS_ssetmask __NR_ssetmask +#define SYS_stat __NR_stat +#define SYS_stat64 __NR_stat64 +#define SYS_statfs __NR_statfs +#define SYS_statfs64 __NR_statfs64 +#define SYS_stime __NR_stime +#define SYS_stty __NR_stty +#define SYS_swapoff __NR_swapoff +#define SYS_swapon __NR_swapon +#define SYS_symlink __NR_symlink +#define SYS_symlinkat __NR_symlinkat +#define SYS_sync __NR_sync +#define SYS_sync_file_range __NR_sync_file_range +#define SYS_syncfs __NR_syncfs +#define SYS_syscall __NR_syscall +#define SYS_sysfs __NR_sysfs +#define SYS_sysinfo __NR_sysinfo +#define SYS_syslog __NR_syslog +#define SYS_sysmips __NR_sysmips +#define SYS_tee __NR_tee +#define SYS_tgkill __NR_tgkill +#define SYS_time __NR_time +#define SYS_timer_create __NR_timer_create +#define SYS_timer_delete __NR_timer_delete +#define SYS_timer_getoverrun __NR_timer_getoverrun +#define SYS_timer_gettime __NR_timer_gettime +#define SYS_timer_settime __NR_timer_settime +#define SYS_timerfd __NR_timerfd +#define SYS_timerfd_create __NR_timerfd_create +#define SYS_timerfd_gettime __NR_timerfd_gettime +#define SYS_timerfd_settime __NR_timerfd_settime +#define SYS_times __NR_times +#define SYS_tkill __NR_tkill +#define SYS_truncate __NR_truncate +#define SYS_truncate64 __NR_truncate64 +#define SYS_ulimit __NR_ulimit +#define SYS_umask __NR_umask +#define SYS_umount __NR_umount +#define SYS_umount2 __NR_umount2 +#define SYS_uname __NR_uname +#define SYS_unlink __NR_unlink +#define SYS_unlinkat __NR_unlinkat +#define SYS_unshare __NR_unshare +#define SYS_unused109 __NR_unused109 +#define SYS_unused150 __NR_unused150 +#define SYS_unused18 __NR_unused18 +#define SYS_unused28 __NR_unused28 +#define SYS_unused59 __NR_unused59 +#define SYS_unused84 __NR_unused84 +#define SYS_uselib __NR_uselib +#define SYS_ustat __NR_ustat +#define SYS_utime __NR_utime +#define SYS_utimensat __NR_utimensat +#define SYS_utimes __NR_utimes +#define SYS_vhangup __NR_vhangup +#define SYS_vm86 __NR_vm86 +#define SYS_vmsplice __NR_vmsplice +#define SYS_vserver __NR_vserver +#define SYS_wait4 __NR_wait4 +#define SYS_waitid __NR_waitid +#define SYS_waitpid __NR_waitpid +#define SYS_write __NR_write +#define SYS_writev __NR_writev +#elif defined(__i386__) +#define SYS_access __NR_access +#define SYS_acct __NR_acct +#define SYS_add_key __NR_add_key +#define SYS_adjtimex __NR_adjtimex +#define SYS_afs_syscall __NR_afs_syscall +#define SYS_alarm __NR_alarm +#define SYS_bdflush __NR_bdflush +#define SYS_break __NR_break +#define SYS_brk __NR_brk +#define SYS_capget __NR_capget +#define SYS_capset __NR_capset +#define SYS_chdir __NR_chdir +#define SYS_chmod __NR_chmod +#define SYS_chown __NR_chown +#define SYS_chown32 __NR_chown32 +#define SYS_chroot __NR_chroot +#define SYS_clock_adjtime __NR_clock_adjtime +#define SYS_clock_getres __NR_clock_getres +#define SYS_clock_gettime __NR_clock_gettime +#define SYS_clock_nanosleep __NR_clock_nanosleep +#define SYS_clock_settime __NR_clock_settime +#define SYS_clone __NR_clone +#define SYS_close __NR_close +#define SYS_creat __NR_creat +#define SYS_create_module __NR_create_module +#define SYS_delete_module __NR_delete_module +#define SYS_dup __NR_dup +#define SYS_dup2 __NR_dup2 +#define SYS_dup3 __NR_dup3 +#define SYS_epoll_create __NR_epoll_create +#define SYS_epoll_create1 __NR_epoll_create1 +#define SYS_epoll_ctl __NR_epoll_ctl +#define SYS_epoll_pwait __NR_epoll_pwait +#define SYS_epoll_wait __NR_epoll_wait +#define SYS_eventfd __NR_eventfd +#define SYS_eventfd2 __NR_eventfd2 +#define SYS_execve __NR_execve +#define SYS_exit __NR_exit +#define SYS_exit_group __NR_exit_group +#define SYS_faccessat __NR_faccessat +#define SYS_fadvise64 __NR_fadvise64 +#define SYS_fadvise64_64 __NR_fadvise64_64 +#define SYS_fallocate __NR_fallocate +#define SYS_fanotify_init __NR_fanotify_init +#define SYS_fanotify_mark __NR_fanotify_mark +#define SYS_fchdir __NR_fchdir +#define SYS_fchmod __NR_fchmod +#define SYS_fchmodat __NR_fchmodat +#define SYS_fchown __NR_fchown +#define SYS_fchown32 __NR_fchown32 +#define SYS_fchownat __NR_fchownat +#define SYS_fcntl __NR_fcntl +#define SYS_fcntl64 __NR_fcntl64 +#define SYS_fdatasync __NR_fdatasync +#define SYS_fgetxattr __NR_fgetxattr +#define SYS_finit_module __NR_finit_module +#define SYS_flistxattr __NR_flistxattr +#define SYS_flock __NR_flock +#define SYS_fork __NR_fork +#define SYS_fremovexattr __NR_fremovexattr +#define SYS_fsetxattr __NR_fsetxattr +#define SYS_fstat __NR_fstat +#define SYS_fstat64 __NR_fstat64 +#define SYS_fstatat64 __NR_fstatat64 +#define SYS_fstatfs __NR_fstatfs +#define SYS_fstatfs64 __NR_fstatfs64 +#define SYS_fsync __NR_fsync +#define SYS_ftime __NR_ftime +#define SYS_ftruncate __NR_ftruncate +#define SYS_ftruncate64 __NR_ftruncate64 +#define SYS_futex __NR_futex +#define SYS_futimesat __NR_futimesat +#define SYS_get_kernel_syms __NR_get_kernel_syms +#define SYS_get_mempolicy __NR_get_mempolicy +#define SYS_get_robust_list __NR_get_robust_list +#define SYS_get_thread_area __NR_get_thread_area +#define SYS_getcpu __NR_getcpu +#define SYS_getcwd __NR_getcwd +#define SYS_getdents __NR_getdents +#define SYS_getdents64 __NR_getdents64 +#define SYS_getegid __NR_getegid +#define SYS_getegid32 __NR_getegid32 +#define SYS_geteuid __NR_geteuid +#define SYS_geteuid32 __NR_geteuid32 +#define SYS_getgid __NR_getgid +#define SYS_getgid32 __NR_getgid32 +#define SYS_getgroups __NR_getgroups +#define SYS_getgroups32 __NR_getgroups32 +#define SYS_getitimer __NR_getitimer +#define SYS_getpgid __NR_getpgid +#define SYS_getpgrp __NR_getpgrp +#define SYS_getpid __NR_getpid +#define SYS_getpmsg __NR_getpmsg +#define SYS_getppid __NR_getppid +#define SYS_getpriority __NR_getpriority +#define SYS_getresgid __NR_getresgid +#define SYS_getresgid32 __NR_getresgid32 +#define SYS_getresuid __NR_getresuid +#define SYS_getresuid32 __NR_getresuid32 +#define SYS_getrlimit __NR_getrlimit +#define SYS_getrusage __NR_getrusage +#define SYS_getsid __NR_getsid +#define SYS_gettid __NR_gettid +#define SYS_gettimeofday __NR_gettimeofday +#define SYS_getuid __NR_getuid +#define SYS_getuid32 __NR_getuid32 +#define SYS_getxattr __NR_getxattr +#define SYS_gtty __NR_gtty +#define SYS_idle __NR_idle +#define SYS_init_module __NR_init_module +#define SYS_inotify_add_watch __NR_inotify_add_watch +#define SYS_inotify_init __NR_inotify_init +#define SYS_inotify_init1 __NR_inotify_init1 +#define SYS_inotify_rm_watch __NR_inotify_rm_watch +#define SYS_io_cancel __NR_io_cancel +#define SYS_io_destroy __NR_io_destroy +#define SYS_io_getevents __NR_io_getevents +#define SYS_io_setup __NR_io_setup +#define SYS_io_submit __NR_io_submit +#define SYS_ioctl __NR_ioctl +#define SYS_ioperm __NR_ioperm +#define SYS_iopl __NR_iopl +#define SYS_ioprio_get __NR_ioprio_get +#define SYS_ioprio_set __NR_ioprio_set +#define SYS_ipc __NR_ipc +#define SYS_kcmp __NR_kcmp +#define SYS_kexec_load __NR_kexec_load +#define SYS_keyctl __NR_keyctl +#define SYS_kill __NR_kill +#define SYS_lchown __NR_lchown +#define SYS_lchown32 __NR_lchown32 +#define SYS_lgetxattr __NR_lgetxattr +#define SYS_link __NR_link +#define SYS_linkat __NR_linkat +#define SYS_listxattr __NR_listxattr +#define SYS_llistxattr __NR_llistxattr +#define SYS_lock __NR_lock +#define SYS_lookup_dcookie __NR_lookup_dcookie +#define SYS_lremovexattr __NR_lremovexattr +#define SYS_lseek __NR_lseek +#define SYS_lsetxattr __NR_lsetxattr +#define SYS_lstat __NR_lstat +#define SYS_lstat64 __NR_lstat64 +#define SYS_madvise __NR_madvise +#define SYS_mbind __NR_mbind +#define SYS_migrate_pages __NR_migrate_pages +#define SYS_mincore __NR_mincore +#define SYS_mkdir __NR_mkdir +#define SYS_mkdirat __NR_mkdirat +#define SYS_mknod __NR_mknod +#define SYS_mknodat __NR_mknodat +#define SYS_mlock __NR_mlock +#define SYS_mlockall __NR_mlockall +#define SYS_mmap __NR_mmap +#define SYS_mmap2 __NR_mmap2 +#define SYS_modify_ldt __NR_modify_ldt +#define SYS_mount __NR_mount +#define SYS_move_pages __NR_move_pages +#define SYS_mprotect __NR_mprotect +#define SYS_mpx __NR_mpx +#define SYS_mq_getsetattr __NR_mq_getsetattr +#define SYS_mq_notify __NR_mq_notify +#define SYS_mq_open __NR_mq_open +#define SYS_mq_timedreceive __NR_mq_timedreceive +#define SYS_mq_timedsend __NR_mq_timedsend +#define SYS_mq_unlink __NR_mq_unlink +#define SYS_mremap __NR_mremap +#define SYS_msync __NR_msync +#define SYS_munlock __NR_munlock +#define SYS_munlockall __NR_munlockall +#define SYS_munmap __NR_munmap +#define SYS_name_to_handle_at __NR_name_to_handle_at +#define SYS_nanosleep __NR_nanosleep +#define SYS_nfsservctl __NR_nfsservctl +#define SYS_nice __NR_nice +#define SYS_oldfstat __NR_oldfstat +#define SYS_oldlstat __NR_oldlstat +#define SYS_oldolduname __NR_oldolduname +#define SYS_oldstat __NR_oldstat +#define SYS_olduname __NR_olduname +#define SYS_open __NR_open +#define SYS_open_by_handle_at __NR_open_by_handle_at +#define SYS_openat __NR_openat +#define SYS_pause __NR_pause +#define SYS_perf_event_open __NR_perf_event_open +#define SYS_personality __NR_personality +#define SYS_pipe __NR_pipe +#define SYS_pipe2 __NR_pipe2 +#define SYS_pivot_root __NR_pivot_root +#define SYS_poll __NR_poll +#define SYS_ppoll __NR_ppoll +#define SYS_prctl __NR_prctl +#define SYS_pread64 __NR_pread64 +#define SYS_preadv __NR_preadv +#define SYS_prlimit64 __NR_prlimit64 +#define SYS_process_vm_readv __NR_process_vm_readv +#define SYS_process_vm_writev __NR_process_vm_writev +#define SYS_prof __NR_prof +#define SYS_profil __NR_profil +#define SYS_pselect6 __NR_pselect6 +#define SYS_ptrace __NR_ptrace +#define SYS_putpmsg __NR_putpmsg +#define SYS_pwrite64 __NR_pwrite64 +#define SYS_pwritev __NR_pwritev +#define SYS_query_module __NR_query_module +#define SYS_quotactl __NR_quotactl +#define SYS_read __NR_read +#define SYS_readahead __NR_readahead +#define SYS_readdir __NR_readdir +#define SYS_readlink __NR_readlink +#define SYS_readlinkat __NR_readlinkat +#define SYS_readv __NR_readv +#define SYS_reboot __NR_reboot +#define SYS_recvmmsg __NR_recvmmsg +#define SYS_remap_file_pages __NR_remap_file_pages +#define SYS_removexattr __NR_removexattr +#define SYS_rename __NR_rename +#define SYS_renameat __NR_renameat +#define SYS_request_key __NR_request_key +#define SYS_restart_syscall __NR_restart_syscall +#define SYS_rmdir __NR_rmdir +#define SYS_rt_sigaction __NR_rt_sigaction +#define SYS_rt_sigpending __NR_rt_sigpending +#define SYS_rt_sigprocmask __NR_rt_sigprocmask +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define SYS_rt_sigreturn __NR_rt_sigreturn +#define SYS_rt_sigsuspend __NR_rt_sigsuspend +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo +#define SYS_sched_get_priority_max __NR_sched_get_priority_max +#define SYS_sched_get_priority_min __NR_sched_get_priority_min +#define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getparam __NR_sched_getparam +#define SYS_sched_getscheduler __NR_sched_getscheduler +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval +#define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setparam __NR_sched_setparam +#define SYS_sched_setscheduler __NR_sched_setscheduler +#define SYS_sched_yield __NR_sched_yield +#define SYS_select __NR_select +#define SYS_sendfile __NR_sendfile +#define SYS_sendfile64 __NR_sendfile64 +#define SYS_sendmmsg __NR_sendmmsg +#define SYS_set_mempolicy __NR_set_mempolicy +#define SYS_set_robust_list __NR_set_robust_list +#define SYS_set_thread_area __NR_set_thread_area +#define SYS_set_tid_address __NR_set_tid_address +#define SYS_setdomainname __NR_setdomainname +#define SYS_setfsgid __NR_setfsgid +#define SYS_setfsgid32 __NR_setfsgid32 +#define SYS_setfsuid __NR_setfsuid +#define SYS_setfsuid32 __NR_setfsuid32 +#define SYS_setgid __NR_setgid +#define SYS_setgid32 __NR_setgid32 +#define SYS_setgroups __NR_setgroups +#define SYS_setgroups32 __NR_setgroups32 +#define SYS_sethostname __NR_sethostname +#define SYS_setitimer __NR_setitimer +#define SYS_setns __NR_setns +#define SYS_setpgid __NR_setpgid +#define SYS_setpriority __NR_setpriority +#define SYS_setregid __NR_setregid +#define SYS_setregid32 __NR_setregid32 +#define SYS_setresgid __NR_setresgid +#define SYS_setresgid32 __NR_setresgid32 +#define SYS_setresuid __NR_setresuid +#define SYS_setresuid32 __NR_setresuid32 +#define SYS_setreuid __NR_setreuid +#define SYS_setreuid32 __NR_setreuid32 +#define SYS_setrlimit __NR_setrlimit +#define SYS_setsid __NR_setsid +#define SYS_settimeofday __NR_settimeofday +#define SYS_setuid __NR_setuid +#define SYS_setuid32 __NR_setuid32 +#define SYS_setxattr __NR_setxattr +#define SYS_sgetmask __NR_sgetmask +#define SYS_sigaction __NR_sigaction +#define SYS_sigaltstack __NR_sigaltstack +#define SYS_signal __NR_signal +#define SYS_signalfd __NR_signalfd +#define SYS_signalfd4 __NR_signalfd4 +#define SYS_sigpending __NR_sigpending +#define SYS_sigprocmask __NR_sigprocmask +#define SYS_sigreturn __NR_sigreturn +#define SYS_sigsuspend __NR_sigsuspend +#define SYS_socketcall __NR_socketcall +#define SYS_splice __NR_splice +#define SYS_ssetmask __NR_ssetmask +#define SYS_stat __NR_stat +#define SYS_stat64 __NR_stat64 +#define SYS_statfs __NR_statfs +#define SYS_statfs64 __NR_statfs64 +#define SYS_stime __NR_stime +#define SYS_stty __NR_stty +#define SYS_swapoff __NR_swapoff +#define SYS_swapon __NR_swapon +#define SYS_symlink __NR_symlink +#define SYS_symlinkat __NR_symlinkat +#define SYS_sync __NR_sync +#define SYS_sync_file_range __NR_sync_file_range +#define SYS_syncfs __NR_syncfs +#define SYS_sysfs __NR_sysfs +#define SYS_sysinfo __NR_sysinfo +#define SYS_syslog __NR_syslog +#define SYS_tee __NR_tee +#define SYS_tgkill __NR_tgkill +#define SYS_time __NR_time +#define SYS_timer_create __NR_timer_create +#define SYS_timer_delete __NR_timer_delete +#define SYS_timer_getoverrun __NR_timer_getoverrun +#define SYS_timer_gettime __NR_timer_gettime +#define SYS_timer_settime __NR_timer_settime +#define SYS_timerfd_create __NR_timerfd_create +#define SYS_timerfd_gettime __NR_timerfd_gettime +#define SYS_timerfd_settime __NR_timerfd_settime +#define SYS_times __NR_times +#define SYS_tkill __NR_tkill +#define SYS_truncate __NR_truncate +#define SYS_truncate64 __NR_truncate64 +#define SYS_ugetrlimit __NR_ugetrlimit +#define SYS_ulimit __NR_ulimit +#define SYS_umask __NR_umask +#define SYS_umount __NR_umount +#define SYS_umount2 __NR_umount2 +#define SYS_uname __NR_uname +#define SYS_unlink __NR_unlink +#define SYS_unlinkat __NR_unlinkat +#define SYS_unshare __NR_unshare +#define SYS_uselib __NR_uselib +#define SYS_ustat __NR_ustat +#define SYS_utime __NR_utime +#define SYS_utimensat __NR_utimensat +#define SYS_utimes __NR_utimes +#define SYS_vfork __NR_vfork +#define SYS_vhangup __NR_vhangup +#define SYS_vm86 __NR_vm86 +#define SYS_vm86old __NR_vm86old +#define SYS_vmsplice __NR_vmsplice +#define SYS_vserver __NR_vserver +#define SYS_wait4 __NR_wait4 +#define SYS_waitid __NR_waitid +#define SYS_waitpid __NR_waitpid +#define SYS_write __NR_write +#define SYS_writev __NR_writev +#elif defined(__x86_64__) +#define SYS_accept __NR_accept +#define SYS_accept4 __NR_accept4 +#define SYS_access __NR_access +#define SYS_acct __NR_acct +#define SYS_add_key __NR_add_key +#define SYS_adjtimex __NR_adjtimex +#define SYS_afs_syscall __NR_afs_syscall +#define SYS_alarm __NR_alarm +#define SYS_arch_prctl __NR_arch_prctl +#define SYS_bind __NR_bind +#define SYS_brk __NR_brk +#define SYS_capget __NR_capget +#define SYS_capset __NR_capset +#define SYS_chdir __NR_chdir +#define SYS_chmod __NR_chmod +#define SYS_chown __NR_chown +#define SYS_chroot __NR_chroot +#define SYS_clock_adjtime __NR_clock_adjtime +#define SYS_clock_getres __NR_clock_getres +#define SYS_clock_gettime __NR_clock_gettime +#define SYS_clock_nanosleep __NR_clock_nanosleep +#define SYS_clock_settime __NR_clock_settime +#define SYS_clone __NR_clone +#define SYS_close __NR_close +#define SYS_connect __NR_connect +#define SYS_creat __NR_creat +#define SYS_create_module __NR_create_module +#define SYS_delete_module __NR_delete_module +#define SYS_dup __NR_dup +#define SYS_dup2 __NR_dup2 +#define SYS_dup3 __NR_dup3 +#define SYS_epoll_create __NR_epoll_create +#define SYS_epoll_create1 __NR_epoll_create1 +#define SYS_epoll_ctl __NR_epoll_ctl +#define SYS_epoll_ctl_old __NR_epoll_ctl_old +#define SYS_epoll_pwait __NR_epoll_pwait +#define SYS_epoll_wait __NR_epoll_wait +#define SYS_epoll_wait_old __NR_epoll_wait_old +#define SYS_eventfd __NR_eventfd +#define SYS_eventfd2 __NR_eventfd2 +#define SYS_execve __NR_execve +#define SYS_exit __NR_exit +#define SYS_exit_group __NR_exit_group +#define SYS_faccessat __NR_faccessat +#define SYS_fadvise64 __NR_fadvise64 +#define SYS_fallocate __NR_fallocate +#define SYS_fanotify_init __NR_fanotify_init +#define SYS_fanotify_mark __NR_fanotify_mark +#define SYS_fchdir __NR_fchdir +#define SYS_fchmod __NR_fchmod +#define SYS_fchmodat __NR_fchmodat +#define SYS_fchown __NR_fchown +#define SYS_fchownat __NR_fchownat +#define SYS_fcntl __NR_fcntl +#define SYS_fdatasync __NR_fdatasync +#define SYS_fgetxattr __NR_fgetxattr +#define SYS_finit_module __NR_finit_module +#define SYS_flistxattr __NR_flistxattr +#define SYS_flock __NR_flock +#define SYS_fork __NR_fork +#define SYS_fremovexattr __NR_fremovexattr +#define SYS_fsetxattr __NR_fsetxattr +#define SYS_fstat __NR_fstat +#define SYS_fstatfs __NR_fstatfs +#define SYS_fsync __NR_fsync +#define SYS_ftruncate __NR_ftruncate +#define SYS_futex __NR_futex +#define SYS_futimesat __NR_futimesat +#define SYS_get_kernel_syms __NR_get_kernel_syms +#define SYS_get_mempolicy __NR_get_mempolicy +#define SYS_get_robust_list __NR_get_robust_list +#define SYS_get_thread_area __NR_get_thread_area +#define SYS_getcpu __NR_getcpu +#define SYS_getcwd __NR_getcwd +#define SYS_getdents __NR_getdents +#define SYS_getdents64 __NR_getdents64 +#define SYS_getegid __NR_getegid +#define SYS_geteuid __NR_geteuid +#define SYS_getgid __NR_getgid +#define SYS_getgroups __NR_getgroups +#define SYS_getitimer __NR_getitimer +#define SYS_getpeername __NR_getpeername +#define SYS_getpgid __NR_getpgid +#define SYS_getpgrp __NR_getpgrp +#define SYS_getpid __NR_getpid +#define SYS_getpmsg __NR_getpmsg +#define SYS_getppid __NR_getppid +#define SYS_getpriority __NR_getpriority +#define SYS_getresgid __NR_getresgid +#define SYS_getresuid __NR_getresuid +#define SYS_getrlimit __NR_getrlimit +#define SYS_getrusage __NR_getrusage +#define SYS_getsid __NR_getsid +#define SYS_getsockname __NR_getsockname +#define SYS_getsockopt __NR_getsockopt +#define SYS_gettid __NR_gettid +#define SYS_gettimeofday __NR_gettimeofday +#define SYS_getuid __NR_getuid +#define SYS_getxattr __NR_getxattr +#define SYS_init_module __NR_init_module +#define SYS_inotify_add_watch __NR_inotify_add_watch +#define SYS_inotify_init __NR_inotify_init +#define SYS_inotify_init1 __NR_inotify_init1 +#define SYS_inotify_rm_watch __NR_inotify_rm_watch +#define SYS_io_cancel __NR_io_cancel +#define SYS_io_destroy __NR_io_destroy +#define SYS_io_getevents __NR_io_getevents +#define SYS_io_setup __NR_io_setup +#define SYS_io_submit __NR_io_submit +#define SYS_ioctl __NR_ioctl +#define SYS_ioperm __NR_ioperm +#define SYS_iopl __NR_iopl +#define SYS_ioprio_get __NR_ioprio_get +#define SYS_ioprio_set __NR_ioprio_set +#define SYS_kcmp __NR_kcmp +#define SYS_kexec_load __NR_kexec_load +#define SYS_keyctl __NR_keyctl +#define SYS_kill __NR_kill +#define SYS_lchown __NR_lchown +#define SYS_lgetxattr __NR_lgetxattr +#define SYS_link __NR_link +#define SYS_linkat __NR_linkat +#define SYS_listen __NR_listen +#define SYS_listxattr __NR_listxattr +#define SYS_llistxattr __NR_llistxattr +#define SYS_lookup_dcookie __NR_lookup_dcookie +#define SYS_lremovexattr __NR_lremovexattr +#define SYS_lseek __NR_lseek +#define SYS_lsetxattr __NR_lsetxattr +#define SYS_lstat __NR_lstat +#define SYS_madvise __NR_madvise +#define SYS_mbind __NR_mbind +#define SYS_migrate_pages __NR_migrate_pages +#define SYS_mincore __NR_mincore +#define SYS_mkdir __NR_mkdir +#define SYS_mkdirat __NR_mkdirat +#define SYS_mknod __NR_mknod +#define SYS_mknodat __NR_mknodat +#define SYS_mlock __NR_mlock +#define SYS_mlockall __NR_mlockall +#define SYS_mmap __NR_mmap +#define SYS_modify_ldt __NR_modify_ldt +#define SYS_mount __NR_mount +#define SYS_move_pages __NR_move_pages +#define SYS_mprotect __NR_mprotect +#define SYS_mq_getsetattr __NR_mq_getsetattr +#define SYS_mq_notify __NR_mq_notify +#define SYS_mq_open __NR_mq_open +#define SYS_mq_timedreceive __NR_mq_timedreceive +#define SYS_mq_timedsend __NR_mq_timedsend +#define SYS_mq_unlink __NR_mq_unlink +#define SYS_mremap __NR_mremap +#define SYS_msgctl __NR_msgctl +#define SYS_msgget __NR_msgget +#define SYS_msgrcv __NR_msgrcv +#define SYS_msgsnd __NR_msgsnd +#define SYS_msync __NR_msync +#define SYS_munlock __NR_munlock +#define SYS_munlockall __NR_munlockall +#define SYS_munmap __NR_munmap +#define SYS_name_to_handle_at __NR_name_to_handle_at +#define SYS_nanosleep __NR_nanosleep +#define SYS_newfstatat __NR_newfstatat +#define SYS_nfsservctl __NR_nfsservctl +#define SYS_open __NR_open +#define SYS_open_by_handle_at __NR_open_by_handle_at +#define SYS_openat __NR_openat +#define SYS_pause __NR_pause +#define SYS_perf_event_open __NR_perf_event_open +#define SYS_personality __NR_personality +#define SYS_pipe __NR_pipe +#define SYS_pipe2 __NR_pipe2 +#define SYS_pivot_root __NR_pivot_root +#define SYS_poll __NR_poll +#define SYS_ppoll __NR_ppoll +#define SYS_prctl __NR_prctl +#define SYS_pread64 __NR_pread64 +#define SYS_preadv __NR_preadv +#define SYS_prlimit64 __NR_prlimit64 +#define SYS_process_vm_readv __NR_process_vm_readv +#define SYS_process_vm_writev __NR_process_vm_writev +#define SYS_pselect6 __NR_pselect6 +#define SYS_ptrace __NR_ptrace +#define SYS_putpmsg __NR_putpmsg +#define SYS_pwrite64 __NR_pwrite64 +#define SYS_pwritev __NR_pwritev +#define SYS_query_module __NR_query_module +#define SYS_quotactl __NR_quotactl +#define SYS_read __NR_read +#define SYS_readahead __NR_readahead +#define SYS_readlink __NR_readlink +#define SYS_readlinkat __NR_readlinkat +#define SYS_readv __NR_readv +#define SYS_reboot __NR_reboot +#define SYS_recvfrom __NR_recvfrom +#define SYS_recvmmsg __NR_recvmmsg +#define SYS_recvmsg __NR_recvmsg +#define SYS_remap_file_pages __NR_remap_file_pages +#define SYS_removexattr __NR_removexattr +#define SYS_rename __NR_rename +#define SYS_renameat __NR_renameat +#define SYS_request_key __NR_request_key +#define SYS_restart_syscall __NR_restart_syscall +#define SYS_rmdir __NR_rmdir +#define SYS_rt_sigaction __NR_rt_sigaction +#define SYS_rt_sigpending __NR_rt_sigpending +#define SYS_rt_sigprocmask __NR_rt_sigprocmask +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define SYS_rt_sigreturn __NR_rt_sigreturn +#define SYS_rt_sigsuspend __NR_rt_sigsuspend +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo +#define SYS_sched_get_priority_max __NR_sched_get_priority_max +#define SYS_sched_get_priority_min __NR_sched_get_priority_min +#define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getparam __NR_sched_getparam +#define SYS_sched_getscheduler __NR_sched_getscheduler +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval +#define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setparam __NR_sched_setparam +#define SYS_sched_setscheduler __NR_sched_setscheduler +#define SYS_sched_yield __NR_sched_yield +#define SYS_security __NR_security +#define SYS_select __NR_select +#define SYS_semctl __NR_semctl +#define SYS_semget __NR_semget +#define SYS_semop __NR_semop +#define SYS_semtimedop __NR_semtimedop +#define SYS_sendfile __NR_sendfile +#define SYS_sendmmsg __NR_sendmmsg +#define SYS_sendmsg __NR_sendmsg +#define SYS_sendto __NR_sendto +#define SYS_set_mempolicy __NR_set_mempolicy +#define SYS_set_robust_list __NR_set_robust_list +#define SYS_set_thread_area __NR_set_thread_area +#define SYS_set_tid_address __NR_set_tid_address +#define SYS_setdomainname __NR_setdomainname +#define SYS_setfsgid __NR_setfsgid +#define SYS_setfsuid __NR_setfsuid +#define SYS_setgid __NR_setgid +#define SYS_setgroups __NR_setgroups +#define SYS_sethostname __NR_sethostname +#define SYS_setitimer __NR_setitimer +#define SYS_setns __NR_setns +#define SYS_setpgid __NR_setpgid +#define SYS_setpriority __NR_setpriority +#define SYS_setregid __NR_setregid +#define SYS_setresgid __NR_setresgid +#define SYS_setresuid __NR_setresuid +#define SYS_setreuid __NR_setreuid +#define SYS_setrlimit __NR_setrlimit +#define SYS_setsid __NR_setsid +#define SYS_setsockopt __NR_setsockopt +#define SYS_settimeofday __NR_settimeofday +#define SYS_setuid __NR_setuid +#define SYS_setxattr __NR_setxattr +#define SYS_shmat __NR_shmat +#define SYS_shmctl __NR_shmctl +#define SYS_shmdt __NR_shmdt +#define SYS_shmget __NR_shmget +#define SYS_shutdown __NR_shutdown +#define SYS_sigaltstack __NR_sigaltstack +#define SYS_signalfd __NR_signalfd +#define SYS_signalfd4 __NR_signalfd4 +#define SYS_socket __NR_socket +#define SYS_socketpair __NR_socketpair +#define SYS_splice __NR_splice +#define SYS_stat __NR_stat +#define SYS_statfs __NR_statfs +#define SYS_swapoff __NR_swapoff +#define SYS_swapon __NR_swapon +#define SYS_symlink __NR_symlink +#define SYS_symlinkat __NR_symlinkat +#define SYS_sync __NR_sync +#define SYS_sync_file_range __NR_sync_file_range +#define SYS_syncfs __NR_syncfs +#define SYS_sysfs __NR_sysfs +#define SYS_sysinfo __NR_sysinfo +#define SYS_syslog __NR_syslog +#define SYS_tee __NR_tee +#define SYS_tgkill __NR_tgkill +#define SYS_time __NR_time +#define SYS_timer_create __NR_timer_create +#define SYS_timer_delete __NR_timer_delete +#define SYS_timer_getoverrun __NR_timer_getoverrun +#define SYS_timer_gettime __NR_timer_gettime +#define SYS_timer_settime __NR_timer_settime +#define SYS_timerfd_create __NR_timerfd_create +#define SYS_timerfd_gettime __NR_timerfd_gettime +#define SYS_timerfd_settime __NR_timerfd_settime +#define SYS_times __NR_times +#define SYS_tkill __NR_tkill +#define SYS_truncate __NR_truncate +#define SYS_tuxcall __NR_tuxcall +#define SYS_umask __NR_umask +#define SYS_umount2 __NR_umount2 +#define SYS_uname __NR_uname +#define SYS_unlink __NR_unlink +#define SYS_unlinkat __NR_unlinkat +#define SYS_unshare __NR_unshare +#define SYS_uselib __NR_uselib +#define SYS_ustat __NR_ustat +#define SYS_utime __NR_utime +#define SYS_utimensat __NR_utimensat +#define SYS_utimes __NR_utimes +#define SYS_vfork __NR_vfork +#define SYS_vhangup __NR_vhangup +#define SYS_vmsplice __NR_vmsplice +#define SYS_vserver __NR_vserver +#define SYS_wait4 __NR_wait4 +#define SYS_waitid __NR_waitid +#define SYS_write __NR_write +#define SYS_writev __NR_writev +#endif +#endif /* _BIONIC_GLIBC_SYSCALLS_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/inotify.h b/9/platforms/android-19/arch-arm64/usr/include/sys/inotify.h new file mode 100644 index 0000000..dcdd29a --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/inotify.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_INOTIFY_H_ +#define _SYS_INOTIFY_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <stdint.h> +#include <linux/inotify.h> +#include <asm/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK. */ + +__BEGIN_DECLS + +#define IN_CLOEXEC O_CLOEXEC +#define IN_NONBLOCK O_NONBLOCK + +extern int inotify_init(void); +extern int inotify_init1(int); +extern int inotify_add_watch(int, const char*, uint32_t); +extern int inotify_rm_watch(int, uint32_t); + +__END_DECLS + +#endif /* _SYS_INOTIFY_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/ioctl.h b/9/platforms/android-19/arch-arm64/usr/include/sys/ioctl.h new file mode 100644 index 0000000..49d452c --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/ioctl.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_IOCTL_H_ +#define _SYS_IOCTL_H_ + +#include <sys/cdefs.h> +#include <linux/ioctl.h> +/* + * NetBSD and glibc's <sys/ioctl.h> provide some of the + * terminal-related ioctl data structures such as struct winsize. + */ +#include <linux/termios.h> +#include <asm/ioctls.h> +#include <asm/termbits.h> +#include <sys/ioctl_compat.h> + +__BEGIN_DECLS + +extern int ioctl(int, int, ...); + +__END_DECLS + +#endif /* _SYS_IOCTL_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/ioctl_compat.h b/9/platforms/android-19/arch-arm64/usr/include/sys/ioctl_compat.h new file mode 100644 index 0000000..d9ba4c7 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/ioctl_compat.h @@ -0,0 +1,174 @@ +/* $NetBSD: ioctl_compat.h,v 1.15 2005/12/03 17:10:46 christos Exp $ */ + +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * 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. + * + * @(#)ioctl_compat.h 8.4 (Berkeley) 1/21/94 + */ + +#ifndef _SYS_IOCTL_COMPAT_H_ +#define _SYS_IOCTL_COMPAT_H_ + +/*#include <sys/ttychars.h>*/ +/*#include <sys/ttydev.h>*/ + +#if !defined(__mips__) +struct tchars { + char t_intrc; /* interrupt */ + char t_quitc; /* quit */ + char t_startc; /* start output */ + char t_stopc; /* stop output */ + char t_eofc; /* end-of-file */ + char t_brkc; /* input delimiter (like nl) */ +}; + +struct ltchars { + char t_suspc; /* stop process signal */ + char t_dsuspc; /* delayed stop process signal */ + char t_rprntc; /* reprint line */ + char t_flushc; /* flush output (toggles) */ + char t_werasc; /* word erase */ + char t_lnextc; /* literal next character */ +}; + +/* + * Structure for TIOCGETP and TIOCSETP ioctls. + */ +#ifndef _SGTTYB_ +#define _SGTTYB_ +struct sgttyb { + char sg_ispeed; /* input speed */ + char sg_ospeed; /* output speed */ + char sg_erase; /* erase character */ + char sg_kill; /* kill character */ + short sg_flags; /* mode flags */ +}; +#endif +#endif + +#ifdef USE_OLD_TTY +# undef TIOCGETD +# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ +# undef TIOCSETD +# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ +#else +# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ +# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ +#endif +#define TIOCHPCL _IO('t', 2) /* hang up on last close */ +#if !defined(__mips__) +#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ +#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ +#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ +#endif +#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ +#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ +#if 0 +/* BUG: a bunch of these conflict with #defines in asm/termbits.h */ +#define TANDEM 0x00000001 /* send stopc on out q full */ +#define CBREAK 0x00000002 /* half-cooked mode */ +#define LCASE 0x00000004 /* simulate lower case */ +#define ECHO 0x00000008 /* enable echoing */ +#define CRMOD 0x00000010 /* map \r to \r\n on output */ +#define RAW 0x00000020 /* no i/o processing */ +#define ODDP 0x00000040 /* get/send odd parity */ +#define EVENP 0x00000080 /* get/send even parity */ +#define ANYP 0x000000c0 /* get any parity/send none */ +#define NLDELAY 0x00000300 /* \n delay */ +#define NL0 0x00000000 +#define NL1 0x00000100 /* tty 37 */ +#define NL2 0x00000200 /* vt05 */ +#define NL3 0x00000300 +#define TBDELAY 0x00000c00 /* horizontal tab delay */ +#define TAB0 0x00000000 +#define TAB1 0x00000400 /* tty 37 */ +#define TAB2 0x00000800 +#define XTABS 0x00000c00 /* expand tabs on output */ +#define CRDELAY 0x00003000 /* \r delay */ +#define CR0 0x00000000 +#define CR1 0x00001000 /* tn 300 */ +#define CR2 0x00002000 /* tty 37 */ +#define CR3 0x00003000 /* concept 100 */ +#define VTDELAY 0x00004000 /* vertical tab delay */ +#define FF0 0x00000000 +#define FF1 0x00004000 /* tty 37 */ +#define BSDELAY 0x00008000 /* \b delay */ +#define BS0 0x00000000 +#define BS1 0x00008000 +#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) +#define CRTBS 0x00010000 /* do backspacing for crt */ +#define PRTERA 0x00020000 /* \ ... / erase */ +#define CRTERA 0x00040000 /* " \b " to wipe out char */ +#define TILDE 0x00080000 /* hazeltine tilde kludge */ +#define MDMBUF 0x00100000 /* DTR/DCD hardware flow control */ +#define LITOUT 0x00200000 /* literal output */ +#define TOSTOP 0x00400000 /* stop background jobs on output */ +#define FLUSHO 0x00800000 /* output being flushed (state) */ +#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ +#define L001000 0x02000000 +#define CRTKIL 0x04000000 /* kill line with " \b " */ +#define PASS8 0x08000000 +#define CTLECH 0x10000000 /* echo control chars as ^X */ +#define PENDIN 0x20000000 /* re-echo input buffer at next read */ +#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ +#define NOFLSH 0x80000000 /* don't flush output on signal */ +#endif +#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ +#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ +#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ +#define TIOCLGET _IOR('t', 124, int) /* get local modes */ +#define LCRTBS (CRTBS>>16) +#define LPRTERA (PRTERA>>16) +#define LCRTERA (CRTERA>>16) +#define LTILDE (TILDE>>16) +#define LMDMBUF (MDMBUF>>16) +#define LLITOUT (LITOUT>>16) +#define LTOSTOP (TOSTOP>>16) +#define LFLUSHO (FLUSHO>>16) +#define LNOHANG (NOHANG>>16) +#define LCRTKIL (CRTKIL>>16) +#define LPASS8 (PASS8>>16) +#define LCTLECH (CTLECH>>16) +#define LPENDIN (PENDIN>>16) +#define LDECCTQ (DECCTQ>>16) +#define LNOFLSH (NOFLSH>>16) +#if !defined(__mips__) +#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ +#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ +#endif +#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ +#define OTTYDISC 0 +#define NETLDISC 1 +#define NTTYDISC 2 + +#endif /* !_SYS_IOCTL_COMPAT_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/ipc.h b/9/platforms/android-19/arch-arm64/usr/include/sys/ipc.h new file mode 100644 index 0000000..c0ae0ba --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/ipc.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_IPC_H +#define _SYS_IPC_H + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/ipc.h> + +__BEGIN_DECLS + +extern key_t ftok(const char* path, int id); + +__END_DECLS + +#endif /* _SYS_IPC_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/klog.h b/9/platforms/android-19/arch-arm64/usr/include/sys/klog.h new file mode 100644 index 0000000..02851d2 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/klog.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_KLOG_H_ +#define _SYS_KLOG_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/* These correspond to the kernel's SYSLOG_ACTION_whatever constants. */ +#define KLOG_CLOSE 0 +#define KLOG_OPEN 1 +#define KLOG_READ 2 +#define KLOG_READ_ALL 3 +#define KLOG_READ_CLEAR 4 +#define KLOG_CLEAR 5 +#define KLOG_CONSOLE_OFF 6 +#define KLOG_CONSOLE_ON 7 +#define KLOG_CONSOLE_LEVEL 8 +#define KLOG_SIZE_UNREAD 9 +#define KLOG_SIZE_BUFFER 10 + +/* These are deprecated names that were used in earlier bionic releases. Do not use. */ +#define KLOG_DISABLE 6 +#define KLOG_ENABLE 7 +#define KLOG_SETLEVEL 8 +#define KLOG_UNREADSIZE 9 +#define KLOG_WRITE 10 + +extern int klogctl(int, char *, int); + +__END_DECLS + +#endif /* _SYS_KLOG_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/limits.h b/9/platforms/android-19/arch-arm64/usr/include/sys/limits.h new file mode 100644 index 0000000..36f73b2 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/limits.h @@ -0,0 +1,174 @@ +/* $OpenBSD: limits.h,v 1.6 2005/12/13 00:35:23 millert Exp $ */ +/* + * Copyright (c) 2002 Marc Espie. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT 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 OPENBSD + * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SYS_LIMITS_H_ +#define _SYS_LIMITS_H_ + +#include <sys/cdefs.h> +#include <linux/limits.h> + +/* Common definitions for limits.h. */ + +/* Legacy */ +#include <machine/limits.h> + +#define CHAR_BIT 8 /* number of bits in a char */ + +#define SCHAR_MAX 0x7f /* max value for a signed char */ +#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ + +#define UCHAR_MAX 0xffU /* max value for an unsigned char */ +#ifdef __CHAR_UNSIGNED__ +# define CHAR_MIN 0 /* min value for a char */ +# define CHAR_MAX 0xff /* max value for a char */ +#else +# define CHAR_MAX 0x7f +# define CHAR_MIN (-0x7f-1) +#endif + +#define USHRT_MAX 0xffffU /* max value for an unsigned short */ +#define SHRT_MAX 0x7fff /* max value for a short */ +#define SHRT_MIN (-0x7fff-1) /* min value for a short */ + +#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ +#define INT_MAX 0x7fffffff /* max value for an int */ +#define INT_MIN (-0x7fffffff-1) /* min value for an int */ + +#ifdef __LP64__ +# define ULONG_MAX 0xffffffffffffffffUL + /* max value for unsigned long */ +# define LONG_MAX 0x7fffffffffffffffL + /* max value for a signed long */ +# define LONG_MIN (-0x7fffffffffffffffL-1) + /* min value for a signed long */ +#else +# define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ +# define LONG_MAX 0x7fffffffL /* max value for a long */ +# define LONG_MIN (-0x7fffffffL-1)/* min value for a long */ +#endif + +#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 +# define ULLONG_MAX 0xffffffffffffffffULL + /* max value for unsigned long long */ +# define LLONG_MAX 0x7fffffffffffffffLL + /* max value for a signed long long */ +# define LLONG_MIN (-0x7fffffffffffffffLL-1) + /* min value for a signed long long */ +#endif + +#if __BSD_VISIBLE +# define UID_MAX UINT_MAX /* max value for a uid_t */ +# define GID_MAX UINT_MAX /* max value for a gid_t */ +#endif + + +#ifdef __LP64__ +# define LONG_BIT 64 +#else +# define LONG_BIT 32 +#endif + +/* float.h defines these as well */ +# if !defined(DBL_DIG) +# if defined(__DBL_DIG) +# define DBL_DIG __DBL_DIG +# define DBL_MAX __DBL_MAX +# define DBL_MIN __DBL_MIN + +# define FLT_DIG __FLT_DIG +# define FLT_MAX __FLT_MAX +# define FLT_MIN __FLT_MIN +# else +# define DBL_DIG 15 +# define DBL_MAX 1.7976931348623157E+308 +# define DBL_MIN 2.2250738585072014E-308 + +# define FLT_DIG 6 +# define FLT_MAX 3.40282347E+38F +# define FLT_MIN 1.17549435E-38F +# endif +# endif + +/* Bionic: the following has been optimized out from our processed kernel headers */ + +#define CHILD_MAX 999 +#define OPEN_MAX 256 + +/* Bionic-specific definitions */ + +#define _POSIX_VERSION 200112L /* Posix C language bindings version */ +#define _POSIX2_VERSION -1 /* we don't support Posix command-line tools */ +#define _POSIX2_C_VERSION _POSIX_VERSION +#define _XOPEN_VERSION 500 /* by Posix definition */ +#define _XOPEN_XCU_VERSION -1 /* we don't support command-line utilities */ + +/* tell what we implement legacy stuff when appropriate */ +#if _POSIX_VERSION > 0 +#define _XOPEN_XPG2 1 +#define _XOPEN_XPG3 1 +#define _XOPEN_XPG4 1 +#define _XOPEN_UNIX 1 +#endif + +#define _XOPEN_ENH_I18N -1 /* we don't support internationalization in the C library */ +#define _XOPEN_CRYPT -1 /* don't support X/Open Encryption */ +#define _XOPEN_LEGACY -1 /* don't claim we support these, we have some of them but not all */ +#define _XOPEN_REALTIME -1 /* we don't support all these functions */ +#define _XOPEN_REALTIME_THREADS -1 /* same here */ + +#define _POSIX_REALTIME_SIGNALS -1 /* for now, this is not supported */ +#define _POSIX_PRIORITY_SCHEDULING 1 /* priority scheduling is a Linux feature */ +#define _POSIX_TIMERS 1 /* Posix timers are supported */ +#undef _POSIX_ASYNCHRONOUS_IO /* aio_ functions are not supported */ +#define _POSIX_SYNCHRONIZED_IO 1 /* synchronized i/o supported */ +#define _POSIX_FSYNC 1 /* fdatasync() supported */ +#define _POSIX_MAPPED_FILES 1 /* mmap-ed files supported */ + +/* XXX: TODO: complete and check list here */ + + +#define _POSIX_THREADS 1 /* we support threads */ +#define _POSIX_THREAD_STACKADDR 1 /* we support thread stack address */ +#define _POSIX_THREAD_STACKSIZE 1 /* we support thread stack size */ +#define _POSIX_THREAD_PRIO_INHERIT 200112L /* linux feature */ +#define _POSIX_THREAD_PRIO_PROTECT 200112L /* linux feature */ + +#undef _POSIX_PROCESS_SHARED /* we don't support process-shared synchronization */ +#undef _POSIX_THREAD_SAFE_FUNCTIONS /* most functions are, but not everything yet */ +#define _POSIX_CHOWN_RESTRICTED 1 /* yes, chown requires appropriate privileges */ +#define _POSIX_MONOTONIC_CLOCK 0 /* the monotonic clock may be available; ask sysconf */ +#define _POSIX_NO_TRUNC 1 /* very long pathnames generate an error */ +#define _POSIX_SAVED_IDS 1 /* saved user ids is a Linux feature */ +#define _POSIX_JOB_CONTROL 1 /* job control is a Linux feature */ + +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 /* the minimum mandated by POSIX */ +#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS +#define _POSIX_THREAD_KEYS_MAX 128 /* the minimum mandated by POSIX */ +#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX +#define _POSIX_THREAD_THREADS_MAX 64 /* the minimum mandated by POSIX */ +#define PTHREAD_THREADS_MAX /* bionic has no specific limit */ + + +#endif diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/linux-syscalls.h b/9/platforms/android-19/arch-arm64/usr/include/sys/linux-syscalls.h new file mode 100644 index 0000000..9702a7a --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/linux-syscalls.h @@ -0,0 +1,292 @@ +/* auto-generated by gensyscalls.py, do not touch */ +#ifndef _BIONIC_LINUX_SYSCALLS_H_ + +#if !defined __ASM_ARM_UNISTD_H && !defined __ASM_I386_UNISTD_H +#if defined __arm__ && !defined __ARM_EABI__ && !defined __thumb__ + # define __NR_SYSCALL_BASE 0x900000 + #else + # define __NR_SYSCALL_BASE 0 + #endif + +#define __NR_exit (__NR_SYSCALL_BASE + 1) +#define __NR_fork (__NR_SYSCALL_BASE + 2) +#define __NR_clone (__NR_SYSCALL_BASE + 120) +#define __NR_execve (__NR_SYSCALL_BASE + 11) +#define __NR_setuid32 (__NR_SYSCALL_BASE + 213) +#define __NR_getuid32 (__NR_SYSCALL_BASE + 199) +#define __NR_getgid32 (__NR_SYSCALL_BASE + 200) +#define __NR_geteuid32 (__NR_SYSCALL_BASE + 201) +#define __NR_getegid32 (__NR_SYSCALL_BASE + 202) +#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209) +#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211) +#define __NR_gettid (__NR_SYSCALL_BASE + 224) +#define __NR_getgroups32 (__NR_SYSCALL_BASE + 205) +#define __NR_getpgid (__NR_SYSCALL_BASE + 132) +#define __NR_getppid (__NR_SYSCALL_BASE + 64) +#define __NR_setsid (__NR_SYSCALL_BASE + 66) +#define __NR_setgid32 (__NR_SYSCALL_BASE + 214) +#define __NR_setreuid32 (__NR_SYSCALL_BASE + 203) +#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208) +#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210) +#define __NR_brk (__NR_SYSCALL_BASE + 45) +#define __NR_ptrace (__NR_SYSCALL_BASE + 26) +#define __NR_getpriority (__NR_SYSCALL_BASE + 96) +#define __NR_setpriority (__NR_SYSCALL_BASE + 97) +#define __NR_setrlimit (__NR_SYSCALL_BASE + 75) +#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191) +#define __NR_getrusage (__NR_SYSCALL_BASE + 77) +#define __NR_setgroups32 (__NR_SYSCALL_BASE + 206) +#define __NR_setpgid (__NR_SYSCALL_BASE + 57) +#define __NR_setregid32 (__NR_SYSCALL_BASE + 204) +#define __NR_chroot (__NR_SYSCALL_BASE + 61) +#define __NR_prctl (__NR_SYSCALL_BASE + 172) +#define __NR_capget (__NR_SYSCALL_BASE + 184) +#define __NR_capset (__NR_SYSCALL_BASE + 185) +#define __NR_sigaltstack (__NR_SYSCALL_BASE + 186) +#define __NR_acct (__NR_SYSCALL_BASE + 51) +#define __NR_read (__NR_SYSCALL_BASE + 3) +#define __NR_write (__NR_SYSCALL_BASE + 4) +#define __NR_pread64 (__NR_SYSCALL_BASE + 180) +#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181) +#define __NR_open (__NR_SYSCALL_BASE + 5) +#define __NR_close (__NR_SYSCALL_BASE + 6) +#define __NR_lseek (__NR_SYSCALL_BASE + 19) +#define __NR__llseek (__NR_SYSCALL_BASE + 140) +#define __NR_getpid (__NR_SYSCALL_BASE + 20) +#define __NR_mmap2 (__NR_SYSCALL_BASE + 192) +#define __NR_munmap (__NR_SYSCALL_BASE + 91) +#define __NR_mremap (__NR_SYSCALL_BASE + 163) +#define __NR_msync (__NR_SYSCALL_BASE + 144) +#define __NR_mprotect (__NR_SYSCALL_BASE + 125) +#define __NR_mlock (__NR_SYSCALL_BASE + 150) +#define __NR_munlock (__NR_SYSCALL_BASE + 151) +#define __NR_ioctl (__NR_SYSCALL_BASE + 54) +#define __NR_readv (__NR_SYSCALL_BASE + 145) +#define __NR_writev (__NR_SYSCALL_BASE + 146) +#define __NR_fcntl (__NR_SYSCALL_BASE + 55) +#define __NR_flock (__NR_SYSCALL_BASE + 143) +#define __NR_fchmod (__NR_SYSCALL_BASE + 94) +#define __NR_dup (__NR_SYSCALL_BASE + 41) +#define __NR_pipe (__NR_SYSCALL_BASE + 42) +#define __NR_dup2 (__NR_SYSCALL_BASE + 63) +#define __NR__newselect (__NR_SYSCALL_BASE + 142) +#define __NR_ftruncate (__NR_SYSCALL_BASE + 93) +#define __NR_fsync (__NR_SYSCALL_BASE + 118) +#define __NR_fdatasync (__NR_SYSCALL_BASE + 148) +#define __NR_fchown32 (__NR_SYSCALL_BASE + 207) +#define __NR_sync (__NR_SYSCALL_BASE + 36) +#define __NR_fcntl64 (__NR_SYSCALL_BASE + 221) +#define __NR_sendfile (__NR_SYSCALL_BASE + 187) +#define __NR_link (__NR_SYSCALL_BASE + 9) +#define __NR_unlink (__NR_SYSCALL_BASE + 10) +#define __NR_chdir (__NR_SYSCALL_BASE + 12) +#define __NR_mknod (__NR_SYSCALL_BASE + 14) +#define __NR_chmod (__NR_SYSCALL_BASE + 15) +#define __NR_chown32 (__NR_SYSCALL_BASE + 212) +#define __NR_lchown32 (__NR_SYSCALL_BASE + 198) +#define __NR_mount (__NR_SYSCALL_BASE + 21) +#define __NR_umount2 (__NR_SYSCALL_BASE + 52) +#define __NR_fstat64 (__NR_SYSCALL_BASE + 197) +#define __NR_stat64 (__NR_SYSCALL_BASE + 195) +#define __NR_lstat64 (__NR_SYSCALL_BASE + 196) +#define __NR_mkdir (__NR_SYSCALL_BASE + 39) +#define __NR_readlink (__NR_SYSCALL_BASE + 85) +#define __NR_rmdir (__NR_SYSCALL_BASE + 40) +#define __NR_rename (__NR_SYSCALL_BASE + 38) +#define __NR_getcwd (__NR_SYSCALL_BASE + 183) +#define __NR_access (__NR_SYSCALL_BASE + 33) +#define __NR_symlink (__NR_SYSCALL_BASE + 83) +#define __NR_fchdir (__NR_SYSCALL_BASE + 133) +#define __NR_truncate (__NR_SYSCALL_BASE + 92) +#define __NR_pause (__NR_SYSCALL_BASE + 29) +#define __NR_gettimeofday (__NR_SYSCALL_BASE + 78) +#define __NR_settimeofday (__NR_SYSCALL_BASE + 79) +#define __NR_times (__NR_SYSCALL_BASE + 43) +#define __NR_nanosleep (__NR_SYSCALL_BASE + 162) +#define __NR_getitimer (__NR_SYSCALL_BASE + 105) +#define __NR_setitimer (__NR_SYSCALL_BASE + 104) +#define __NR_sigaction (__NR_SYSCALL_BASE + 67) +#define __NR_sigprocmask (__NR_SYSCALL_BASE + 126) +#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72) +#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174) +#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175) +#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177) +#define __NR_sigpending (__NR_SYSCALL_BASE + 73) +#define __NR_sched_setscheduler (__NR_SYSCALL_BASE + 156) +#define __NR_sched_getscheduler (__NR_SYSCALL_BASE + 157) +#define __NR_sched_yield (__NR_SYSCALL_BASE + 158) +#define __NR_sched_setparam (__NR_SYSCALL_BASE + 154) +#define __NR_sched_getparam (__NR_SYSCALL_BASE + 155) +#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE + 159) +#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE + 160) +#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE + 161) +#define __NR_uname (__NR_SYSCALL_BASE + 122) +#define __NR_wait4 (__NR_SYSCALL_BASE + 114) +#define __NR_umask (__NR_SYSCALL_BASE + 60) +#define __NR_reboot (__NR_SYSCALL_BASE + 88) +#define __NR_syslog (__NR_SYSCALL_BASE + 103) +#define __NR_init_module (__NR_SYSCALL_BASE + 128) +#define __NR_delete_module (__NR_SYSCALL_BASE + 129) +#define __NR_syslog (__NR_SYSCALL_BASE + 103) +#define __NR_sysinfo (__NR_SYSCALL_BASE + 116) +#define __NR_futex (__NR_SYSCALL_BASE + 240) +#define __NR_poll (__NR_SYSCALL_BASE + 168) + +#ifdef __arm__ +#define __NR_exit_group (__NR_SYSCALL_BASE + 248) +#define __NR_waitid (__NR_SYSCALL_BASE + 280) +#define __NR_vfork (__NR_SYSCALL_BASE + 190) +#define __NR_openat (__NR_SYSCALL_BASE + 322) +#define __NR_madvise (__NR_SYSCALL_BASE + 220) +#define __NR_mincore (__NR_SYSCALL_BASE + 219) +#define __NR_pipe2 (__NR_SYSCALL_BASE + 359) +#define __NR_getdents64 (__NR_SYSCALL_BASE + 217) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 267) +#define __NR_fstatat64 (__NR_SYSCALL_BASE + 327) +#define __NR_mkdirat (__NR_SYSCALL_BASE + 323) +#define __NR_fchownat (__NR_SYSCALL_BASE + 325) +#define __NR_fchmodat (__NR_SYSCALL_BASE + 333) +#define __NR_renameat (__NR_SYSCALL_BASE + 329) +#define __NR_unlinkat (__NR_SYSCALL_BASE + 328) +#define __NR_statfs64 (__NR_SYSCALL_BASE + 266) +#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263) +#define __NR_clock_settime (__NR_SYSCALL_BASE + 262) +#define __NR_clock_getres (__NR_SYSCALL_BASE + 264) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 265) +#define __NR_timer_create (__NR_SYSCALL_BASE + 257) +#define __NR_timer_settime (__NR_SYSCALL_BASE + 258) +#define __NR_timer_gettime (__NR_SYSCALL_BASE + 259) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 260) +#define __NR_timer_delete (__NR_SYSCALL_BASE + 261) +#define __NR_utimes (__NR_SYSCALL_BASE + 269) +#define __NR_socket (__NR_SYSCALL_BASE + 281) +#define __NR_socketpair (__NR_SYSCALL_BASE + 288) +#define __NR_bind (__NR_SYSCALL_BASE + 282) +#define __NR_connect (__NR_SYSCALL_BASE + 283) +#define __NR_listen (__NR_SYSCALL_BASE + 284) +#define __NR_accept (__NR_SYSCALL_BASE + 285) +#define __NR_getsockname (__NR_SYSCALL_BASE + 286) +#define __NR_getpeername (__NR_SYSCALL_BASE + 287) +#define __NR_sendto (__NR_SYSCALL_BASE + 290) +#define __NR_recvfrom (__NR_SYSCALL_BASE + 292) +#define __NR_shutdown (__NR_SYSCALL_BASE + 293) +#define __NR_setsockopt (__NR_SYSCALL_BASE + 294) +#define __NR_getsockopt (__NR_SYSCALL_BASE + 295) +#define __NR_sendmsg (__NR_SYSCALL_BASE + 296) +#define __NR_recvmsg (__NR_SYSCALL_BASE + 297) +#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314) +#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315) +#define __NR_epoll_create (__NR_SYSCALL_BASE + 250) +#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 251) +#define __NR_epoll_wait (__NR_SYSCALL_BASE + 252) +#define __NR_inotify_init (__NR_SYSCALL_BASE + 316) +#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317) +#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318) +#define __NR_eventfd2 (__NR_SYSCALL_BASE + 356) +#define __NR_ARM_set_tls (__NR_SYSCALL_BASE + 983045) +#define __NR_ARM_cacheflush (__NR_SYSCALL_BASE + 983042) +#endif + +#ifdef __i386__ +#define __NR_exit_group (__NR_SYSCALL_BASE + 252) +#define __NR_waitpid (__NR_SYSCALL_BASE + 7) +#define __NR_waitid (__NR_SYSCALL_BASE + 284) +#define __NR_kill (__NR_SYSCALL_BASE + 37) +#define __NR_tkill (__NR_SYSCALL_BASE + 238) +#define __NR_set_thread_area (__NR_SYSCALL_BASE + 243) +#define __NR_openat (__NR_SYSCALL_BASE + 295) +#define __NR_madvise (__NR_SYSCALL_BASE + 219) +#define __NR_mincore (__NR_SYSCALL_BASE + 218) +#define __NR_pipe2 (__NR_SYSCALL_BASE + 331) +#define __NR_getdents64 (__NR_SYSCALL_BASE + 220) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 269) +#define __NR_fstatat64 (__NR_SYSCALL_BASE + 300) +#define __NR_mkdirat (__NR_SYSCALL_BASE + 296) +#define __NR_fchownat (__NR_SYSCALL_BASE + 298) +#define __NR_fchmodat (__NR_SYSCALL_BASE + 306) +#define __NR_renameat (__NR_SYSCALL_BASE + 302) +#define __NR_unlinkat (__NR_SYSCALL_BASE + 301) +#define __NR_statfs64 (__NR_SYSCALL_BASE + 268) +#define __NR_clock_gettime (__NR_SYSCALL_BASE + 265) +#define __NR_clock_settime (__NR_SYSCALL_BASE + 264) +#define __NR_clock_getres (__NR_SYSCALL_BASE + 266) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 267) +#define __NR_timer_create (__NR_SYSCALL_BASE + 259) +#define __NR_timer_settime (__NR_SYSCALL_BASE + 260) +#define __NR_timer_gettime (__NR_SYSCALL_BASE + 261) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 262) +#define __NR_timer_delete (__NR_SYSCALL_BASE + 263) +#define __NR_utimes (__NR_SYSCALL_BASE + 271) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_ioprio_set (__NR_SYSCALL_BASE + 289) +#define __NR_ioprio_get (__NR_SYSCALL_BASE + 290) +#define __NR_epoll_create (__NR_SYSCALL_BASE + 254) +#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 255) +#define __NR_epoll_wait (__NR_SYSCALL_BASE + 256) +#define __NR_inotify_init (__NR_SYSCALL_BASE + 291) +#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 292) +#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 293) +#define __NR_eventfd2 (__NR_SYSCALL_BASE + 328) +#endif + +#if defined(__SH3__) || defined(__SH4__) +#define __NR_exit_group (__NR_SYSCALL_BASE + 252) +#define __NR_waitpid (__NR_SYSCALL_BASE + 7) +#define __NR_waitid (__NR_SYSCALL_BASE + 284) +#define __NR_kill (__NR_SYSCALL_BASE + 37) +#define __NR_tkill (__NR_SYSCALL_BASE + 238) +#define __NR_set_thread_area (__NR_SYSCALL_BASE + 243) +#define __NR_vfork (__NR_SYSCALL_BASE + 190) +#define __NR_openat (__NR_SYSCALL_BASE + 295) +#define __NR_madvise (__NR_SYSCALL_BASE + 219) +#define __NR_mincore (__NR_SYSCALL_BASE + 218) +#define __NR_pipe2 (__NR_SYSCALL_BASE + 331) +#define __NR_getdents64 (__NR_SYSCALL_BASE + 220) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 269) +#define __NR_fstatat64 (__NR_SYSCALL_BASE + 300) +#define __NR_mkdirat (__NR_SYSCALL_BASE + 296) +#define __NR_fchownat (__NR_SYSCALL_BASE + 298) +#define __NR_fchmodat (__NR_SYSCALL_BASE + 306) +#define __NR_renameat (__NR_SYSCALL_BASE + 302) +#define __NR_unlinkat (__NR_SYSCALL_BASE + 301) +#define __NR_statfs64 (__NR_SYSCALL_BASE + 268) +#define __NR_clock_gettime (__NR_SYSCALL_BASE + 265) +#define __NR_clock_settime (__NR_SYSCALL_BASE + 264) +#define __NR_clock_getres (__NR_SYSCALL_BASE + 266) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE + 267) +#define __NR_timer_create (__NR_SYSCALL_BASE + 259) +#define __NR_timer_settime (__NR_SYSCALL_BASE + 260) +#define __NR_timer_gettime (__NR_SYSCALL_BASE + 261) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE + 262) +#define __NR_timer_delete (__NR_SYSCALL_BASE + 263) +#define __NR_utimes (__NR_SYSCALL_BASE + 271) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_socketcall (__NR_SYSCALL_BASE + 102) +#define __NR___socketcall (__NR_SYSCALL_BASE + 102) +#define __NR_ioprio_set (__NR_SYSCALL_BASE + 288) +#define __NR_ioprio_get (__NR_SYSCALL_BASE + 289) +#define __NR_epoll_create (__NR_SYSCALL_BASE + 254) +#define __NR_epoll_ctl (__NR_SYSCALL_BASE + 255) +#define __NR_epoll_wait (__NR_SYSCALL_BASE + 256) +#define __NR_inotify_init (__NR_SYSCALL_BASE + 290) +#define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 291) +#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 292) +#define __NR_eventfd2 (__NR_SYSCALL_BASE + 328) +#endif + +#endif + +#endif /* _BIONIC_LINUX_SYSCALLS_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/mman.h b/9/platforms/android-19/arch-arm64/usr/include/sys/mman.h new file mode 100644 index 0000000..7c5f8d7 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/mman.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_MMAN_H_ +#define _SYS_MMAN_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <asm/mman.h> +#include <asm/page.h> + +__BEGIN_DECLS + +#ifndef MAP_ANON +#define MAP_ANON MAP_ANONYMOUS +#endif + +#define MAP_FAILED ((void *)-1) + +#define MREMAP_MAYMOVE 1 +#define MREMAP_FIXED 2 + +extern void* mmap(void *, size_t, int, int, int, off_t); +extern void* mmap64(void *, size_t, int, int, int, off64_t); +extern int munmap(void *, size_t); +extern int msync(const void *, size_t, int); +extern int mprotect(const void *, size_t, int); +extern void* mremap(void *, size_t, size_t, unsigned long); + +extern int mlockall(int); +extern int munlockall(void); +extern int mlock(const void *, size_t); +extern int munlock(const void *, size_t); +extern int madvise(const void *, size_t, int); + +extern int mlock(const void *addr, size_t len); +extern int munlock(const void *addr, size_t len); + +extern int mincore(void* start, size_t length, unsigned char* vec); + +__END_DECLS + +#endif /* _SYS_MMAN_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/mount.h b/9/platforms/android-19/arch-arm64/usr/include/sys/mount.h new file mode 100644 index 0000000..3c35d31 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/mount.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_MOUNT_H +#define _SYS_MOUNT_H + +#include <sys/cdefs.h> +#include <sys/ioctl.h> +#include <linux/fs.h> + +__BEGIN_DECLS + +/* umount2 flags. */ +#define MNT_FORCE 1 /* Forcibly unmount */ +#define MNT_DETACH 2 /* Detach from tree only */ +#define MNT_EXPIRE 4 /* Mark for expiry */ + +extern int mount(const char*, const char*, const char*, unsigned long, const void*); +extern int umount(const char*); +extern int umount2(const char*, int); + +__END_DECLS + +#endif /* _SYS_MOUNT_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/msg.h b/9/platforms/android-19/arch-arm64/usr/include/sys/msg.h new file mode 100644 index 0000000..1a6d30d --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/msg.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_MSG_H_ +#define _SYS_MSG_H_ + +#include <linux/msg.h> + +#endif /* _SYS_MSG_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/param.h b/9/platforms/android-19/arch-arm64/usr/include/sys/param.h new file mode 100644 index 0000000..37c6427 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/param.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_PARAM_H_ +#define _SYS_PARAM_H_ + +#include <limits.h> +#include <linux/param.h> + +#define MAXPATHLEN PATH_MAX +#define MAXSYMLINKS 8 + +#if __LP64__ +#define ALIGNBYTES 7 +#else +#define ALIGNBYTES 3 +#endif + +#ifndef ALIGN +#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) &~ ALIGNBYTES) +#endif + +/* Macros for counting and rounding. */ +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#define powerof2(x) ((((x)-1)&(x))==0) + +/* Macros for min/max. */ +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) + +#endif /* _SYS_PARAM_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/personality.h b/9/platforms/android-19/arch-arm64/usr/include/sys/personality.h new file mode 100644 index 0000000..8a023f9 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/personality.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_PERSONALITY_H_ +#define _SYS_PERSONALITY_H_ + +#include <sys/cdefs.h> +#include <linux/personality.h> + +__BEGIN_DECLS + +extern int personality (unsigned long persona); + +__END_DECLS + +#endif /* _SYS_PERSONALITY_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/poll.h b/9/platforms/android-19/arch-arm64/usr/include/sys/poll.h new file mode 100644 index 0000000..779ec77 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/poll.h @@ -0,0 +1 @@ +#include <poll.h> diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/prctl.h b/9/platforms/android-19/arch-arm64/usr/include/sys/prctl.h new file mode 100644 index 0000000..00e5837 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/prctl.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_PRCTL_H +#define _SYS_PRCTL_H + +#include <linux/prctl.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/* IMPORTANT NOTE: This function is declared as taking a variable number + * of arguments to match the GLibc definition. However + * its declaration inside SYSCALLS.TXT *must* make it + * take 6 arguments to ensure consistency with the kernel + * implementation. + */ +extern int prctl(int option, ...); + +__END_DECLS + +#endif /* _SYS_PRCTL_H */ + diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/ptrace.h b/9/platforms/android-19/arch-arm64/usr/include/sys/ptrace.h new file mode 100644 index 0000000..848416b --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/ptrace.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_PTRACE_H_ +#define _SYS_PTRACE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +/* For all of the defines */ +#include <linux/ptrace.h> + +__BEGIN_DECLS + +#define PTRACE_POKEUSER PTRACE_POKEUSR +#define PTRACE_PEEKUSER PTRACE_PEEKUSR + +extern long ptrace(int request, pid_t pid, void *addr, void *data); + +__END_DECLS + +#endif /* _SYS_PTRACE_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/queue.h b/9/platforms/android-19/arch-arm64/usr/include/sys/queue.h new file mode 100644 index 0000000..b0e6b38 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/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/9/platforms/android-19/arch-arm64/usr/include/sys/reboot.h b/9/platforms/android-19/arch-arm64/usr/include/sys/reboot.h new file mode 100644 index 0000000..7d202f7 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/reboot.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_REBOOT_H_ +#define _SYS_REBOOT_H_ + +#include <sys/cdefs.h> +#include <linux/reboot.h> + +__BEGIN_DECLS + +/* use glibc names as well */ + +#define RB_AUTOBOOT LINUX_REBOOT_CMD_RESTART +#define RB_HALT_SYSTEM LINUX_REBOOT_CMD_HALT +#define RB_ENABLE_CAD LINUX_REBOOT_CMD_CAD_ON +#define RB_DISABLE_CAD LINUX_REBOOT_CMD_CAD_OFF +#define RB_POWER_OFF LINUX_REBOOT_CMD_POWER_OFF + +extern int reboot(int reboot_type); + +__END_DECLS + +#endif /* _SYS_REBOOT_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/reg.h b/9/platforms/android-19/arch-arm64/usr/include/sys/reg.h new file mode 100644 index 0000000..b3d2aac --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/reg.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_REG_H_ +#define _SYS_REG_H_ + +#if defined(__i386__) + +#define EBX 0 +#define ECX 1 +#define EDX 2 +#define ESI 3 +#define EDI 4 +#define EBP 5 +#define EAX 6 +#define DS 7 +#define ES 8 +#define FS 9 +#define GS 10 +#define ORIG_EAX 11 +#define EIP 12 +#define CS 13 +#define EFL 14 +#define UESP 15 +#define SS 16 + +#elif defined(__x86_64__) + +#define R15 0 +#define R14 1 +#define R13 2 +#define R12 3 +#define RBP 4 +#define RBX 5 +#define R11 6 +#define R10 7 +#define R9 8 +#define R8 9 +#define RAX 10 +#define RCX 11 +#define RDX 12 +#define RSI 13 +#define RDI 14 +#define ORIG_RAX 15 +#define RIP 16 +#define CS 17 +#define EFLAGS 18 +#define RSP 19 +#define SS 20 +#define FS_BASE 21 +#define GS_BASE 22 +#define DS 23 +#define ES 24 +#define FS 25 +#define GS 26 + +#endif + +#endif /* _SYS_REG_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/resource.h b/9/platforms/android-19/arch-arm64/usr/include/sys/resource.h new file mode 100644 index 0000000..a91fa53 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/resource.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_RESOURCE_H_ +#define _SYS_RESOURCE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +#include <linux/resource.h> + +__BEGIN_DECLS + +typedef unsigned long rlim_t; + +extern int getrlimit(int, struct rlimit*); +extern int setrlimit(int, const struct rlimit*); + +extern int getrlimit64(int, struct rlimit64*); +extern int setrlimit64(int, const struct rlimit64*); + +extern int getpriority(int, int); +extern int setpriority(int, int, int); + +extern int getrusage(int, struct rusage*); + +#if __LP64__ +/* Implementing prlimit for 32-bit isn't worth the effort. */ +extern int prlimit(pid_t, int, const struct rlimit*, struct rlimit*); +#endif +extern int prlimit64(pid_t, int, const struct rlimit64*, struct rlimit64*); + +__END_DECLS + +#endif /* _SYS_RESOURCE_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/select.h b/9/platforms/android-19/arch-arm64/usr/include/sys/select.h new file mode 100644 index 0000000..4ddcb6a --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/select.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_SELECT_H_ +#define _SYS_SELECT_H_ + +#include <sys/cdefs.h> +#include <sys/time.h> +#include <sys/types.h> +#include <signal.h> +#include <string.h> + +__BEGIN_DECLS + +#define FD_SETSIZE 1024 +#define NFDBITS (8 * sizeof(unsigned long)) +#define __FDSET_LONGS (FD_SETSIZE/NFDBITS) + +typedef struct { + unsigned long fds_bits[__FDSET_LONGS]; +} fd_set; + +#define __FDELT(fd) ((fd) / NFDBITS) +#define __FDMASK(fd) (1UL << ((fd) % NFDBITS)) +#define __FDS_BITS(set) (((fd_set*)(set))->fds_bits) + +#define FD_ZERO(set) (memset(set, 0, sizeof(*(fd_set*)(set)))) + +#if defined(__BIONIC_FORTIFY) +extern void __FD_CLR_chk(int, fd_set*, size_t); +extern void __FD_SET_chk(int, fd_set*, size_t); +extern int __FD_ISSET_chk(int, fd_set*, size_t); +#define FD_CLR(fd, set) __FD_CLR_chk(fd, set, __bos(set)) +#define FD_SET(fd, set) __FD_SET_chk(fd, set, __bos(set)) +#define FD_ISSET(fd, set) __FD_ISSET_chk(fd, set, __bos(set)) +#else +#define FD_CLR(fd, set) (__FDS_BITS(set)[__FDELT(fd)] &= ~__FDMASK(fd)) +#define FD_SET(fd, set) (__FDS_BITS(set)[__FDELT(fd)] |= __FDMASK(fd)) +#define FD_ISSET(fd, set) ((__FDS_BITS(set)[__FDELT(fd)] & __FDMASK(fd)) != 0) +#endif /* defined(__BIONIC_FORTIFY) */ + +extern int select(int, fd_set*, fd_set*, fd_set*, struct timeval*); +extern int pselect(int, fd_set*, fd_set*, fd_set*, const struct timespec*, const sigset_t*); + +__END_DECLS + +#endif /* _SYS_SELECT_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/sem.h b/9/platforms/android-19/arch-arm64/usr/include/sys/sem.h new file mode 100644 index 0000000..a1ecd1f --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/sem.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_SEM_H_ +#define _SYS_SEM_H_ + +#include <linux/sem.h> + +#endif /* _SYS_SEM_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/sendfile.h b/9/platforms/android-19/arch-arm64/usr/include/sys/sendfile.h new file mode 100644 index 0000000..81a3c44 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/sendfile.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_SENDFILE_H_ +#define _SYS_SENDFILE_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +extern ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count); +extern ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count); + +__END_DECLS + +#endif /* _SYS_SENDFILE_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/sha1.h b/9/platforms/android-19/arch-arm64/usr/include/sys/sha1.h new file mode 100644 index 0000000..f7ada46 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/sha1.h @@ -0,0 +1,31 @@ +/* $NetBSD: sha1.h,v 1.13 2005/12/26 18:41:36 perry Exp $ */ + +/* + * SHA-1 in C + * By Steve Reid <steve@edmweb.com> + * 100% Public Domain + */ + +#ifndef _SYS_SHA1_H_ +#define _SYS_SHA1_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +#define SHA1_DIGEST_LENGTH 20 +#define SHA1_DIGEST_STRING_LENGTH 41 + +typedef struct { + uint32_t state[5]; + uint32_t count[2]; + u_char buffer[64]; +} SHA1_CTX; + +__BEGIN_DECLS +void SHA1Transform(uint32_t[5], const u_char[64]); +void SHA1Init(SHA1_CTX *); +void SHA1Update(SHA1_CTX *, const u_char *, u_int); +void SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *); +__END_DECLS + +#endif /* _SYS_SHA1_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/shm.h b/9/platforms/android-19/arch-arm64/usr/include/sys/shm.h new file mode 100644 index 0000000..c691c29 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/shm.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_SHM_H_ +#define _SYS_SHM_H_ + +#include <linux/shm.h> + +#endif /* _SYS_SHM_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/signal.h b/9/platforms/android-19/arch-arm64/usr/include/sys/signal.h new file mode 100644 index 0000000..2e602da --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/signal.h @@ -0,0 +1 @@ +#include <signal.h> diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/signalfd.h b/9/platforms/android-19/arch-arm64/usr/include/sys/signalfd.h new file mode 100644 index 0000000..2537ab9 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/signalfd.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_SIGNALFD_H_ +#define _SYS_SIGNALFD_H_ + +#include <linux/signalfd.h> +#include <signal.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +extern int signalfd(int fd, const sigset_t* mask, int flags) __nonnull((2)); + +__END_DECLS + +#endif /* _SYS_SIGNALFD_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/socket.h b/9/platforms/android-19/arch-arm64/usr/include/sys/socket.h new file mode 100644 index 0000000..32d98ea --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/socket.h @@ -0,0 +1,338 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_SOCKET_H_ +#define _SYS_SOCKET_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/socket.h> + +#include <asm/fcntl.h> +#include <asm/socket.h> +#include <linux/sockios.h> +#include <linux/uio.h> +#include <linux/types.h> +#include <linux/compiler.h> + +__BEGIN_DECLS + +#define sockaddr_storage __kernel_sockaddr_storage +typedef __sa_family_t sa_family_t; +typedef int socklen_t; + +#ifdef __mips__ +#define SOCK_DGRAM 1 +#define SOCK_STREAM 2 +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 +#define SOCK_DCCP 6 +#define SOCK_PACKET 10 +#else +#define SOCK_STREAM 1 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 +#define SOCK_PACKET 10 +#endif + +#define SOCK_CLOEXEC O_CLOEXEC +#define SOCK_NONBLOCK O_NONBLOCK + +enum { + SHUT_RD = 0, +#define SHUT_RD SHUT_RD + SHUT_WR, +#define SHUT_WR SHUT_WR + SHUT_RDWR +#define SHUT_RDWR SHUT_RDWR +}; + +struct sockaddr { + sa_family_t sa_family; + char sa_data[14]; +}; + +struct linger { + int l_onoff; + int l_linger; +}; + +struct msghdr { + void * msg_name; + int msg_namelen; + struct iovec * msg_iov; + __kernel_size_t msg_iovlen; + void * msg_control; + __kernel_size_t msg_controllen; + unsigned msg_flags; +}; + +struct cmsghdr { + __kernel_size_t cmsg_len; + int cmsg_level; + int cmsg_type; +}; + +#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg)) +#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg)) +#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) +#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr)))) +#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len)) +#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) +#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? (struct cmsghdr *)(ctl) : (struct cmsghdr *)NULL) +#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen) +#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && (cmsg)->cmsg_len <= (unsigned long) ((mhdr)->msg_controllen - ((char *)(cmsg) - (char *)(mhdr)->msg_control))) + +#ifdef __GNUC__ +#define __KINLINE static __inline__ +#elif defined(__cplusplus) +#define __KINLINE static inline +#else +#define __KINLINE static +#endif + +__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size, struct cmsghdr *__cmsg) { + struct cmsghdr * __ptr; + __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len)); + if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size) + return (struct cmsghdr *)0; + return __ptr; +} + +__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg) { + return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); +} + +#define SCM_RIGHTS 0x01 +#define SCM_CREDENTIALS 0x02 +#define SCM_SECURITY 0x03 + +struct ucred { + __u32 pid; + __u32 uid; + __u32 gid; +}; + +#define AF_UNSPEC 0 +#define AF_UNIX 1 +#define AF_LOCAL 1 +#define AF_INET 2 +#define AF_AX25 3 +#define AF_IPX 4 +#define AF_APPLETALK 5 +#define AF_NETROM 6 +#define AF_BRIDGE 7 +#define AF_ATMPVC 8 +#define AF_X25 9 +#define AF_INET6 10 +#define AF_ROSE 11 +#define AF_DECnet 12 +#define AF_NETBEUI 13 +#define AF_SECURITY 14 +#define AF_KEY 15 +#define AF_NETLINK 16 +#define AF_ROUTE AF_NETLINK +#define AF_PACKET 17 +#define AF_ASH 18 +#define AF_ECONET 19 +#define AF_ATMSVC 20 +#define AF_RDS 21 +#define AF_SNA 22 +#define AF_IRDA 23 +#define AF_PPPOX 24 +#define AF_WANPIPE 25 +#define AF_LLC 26 +#define AF_CAN 29 +#define AF_TIPC 30 +#define AF_BLUETOOTH 31 +#define AF_IUCV 32 +#define AF_RXRPC 33 +#define AF_ISDN 34 +#define AF_PHONET 35 +#define AF_IEEE802154 36 +#define AF_CAIF 37 +#define AF_ALG 38 +#define AF_MAX 39 + +#define PF_UNSPEC AF_UNSPEC +#define PF_UNIX AF_UNIX +#define PF_LOCAL AF_LOCAL +#define PF_INET AF_INET +#define PF_AX25 AF_AX25 +#define PF_IPX AF_IPX +#define PF_APPLETALK AF_APPLETALK +#define PF_NETROM AF_NETROM +#define PF_BRIDGE AF_BRIDGE +#define PF_ATMPVC AF_ATMPVC +#define PF_X25 AF_X25 +#define PF_INET6 AF_INET6 +#define PF_ROSE AF_ROSE +#define PF_DECnet AF_DECnet +#define PF_NETBEUI AF_NETBEUI +#define PF_SECURITY AF_SECURITY +#define PF_KEY AF_KEY +#define PF_NETLINK AF_NETLINK +#define PF_ROUTE AF_ROUTE +#define PF_PACKET AF_PACKET +#define PF_ASH AF_ASH +#define PF_ECONET AF_ECONET +#define PF_ATMSVC AF_ATMSVC +#define PF_RDS AF_RDS +#define PF_SNA AF_SNA +#define PF_IRDA AF_IRDA +#define PF_PPPOX AF_PPPOX +#define PF_WANPIPE AF_WANPIPE +#define PF_LLC AF_LLC +#define PF_CAN AF_CAN +#define PF_TIPC AF_TIPC +#define PF_BLUETOOTH AF_BLUETOOTH +#define PF_IUCV AF_IUCV +#define PF_RXRPC AF_RXRPC +#define PF_ISDN AF_ISDN +#define PF_PHONET AF_PHONET +#define PF_IEEE802154 AF_IEEE802154 +#define PF_CAIF AF_CAIF +#define PF_ALG AF_ALG +#define PF_MAX AF_MAX + +#define SOMAXCONN 128 + +#define MSG_OOB 1 +#define MSG_PEEK 2 +#define MSG_DONTROUTE 4 +#define MSG_TRYHARD 4 +#define MSG_CTRUNC 8 +#define MSG_PROBE 0x10 +#define MSG_TRUNC 0x20 +#define MSG_DONTWAIT 0x40 +#define MSG_EOR 0x80 +#define MSG_WAITALL 0x100 +#define MSG_FIN 0x200 +#define MSG_SYN 0x400 +#define MSG_CONFIRM 0x800 +#define MSG_RST 0x1000 +#define MSG_ERRQUEUE 0x2000 +#define MSG_NOSIGNAL 0x4000 +#define MSG_MORE 0x8000 +#define MSG_EOF MSG_FIN +#define MSG_CMSG_COMPAT 0 + +#define SOL_IP 0 +#define SOL_TCP 6 +#define SOL_UDP 17 +#define SOL_IPV6 41 +#define SOL_ICMPV6 58 +#define SOL_SCTP 132 +#define SOL_RAW 255 +#define SOL_IPX 256 +#define SOL_AX25 257 +#define SOL_ATALK 258 +#define SOL_NETROM 259 +#define SOL_ROSE 260 +#define SOL_DECNET 261 +#define SOL_X25 262 +#define SOL_PACKET 263 +#define SOL_ATM 264 +#define SOL_AAL 265 +#define SOL_IRDA 266 +#define SOL_NETBEUI 267 +#define SOL_LLC 268 +#define SOL_DCCP 269 +#define SOL_NETLINK 270 +#define SOL_TIPC 271 + +#define IPX_TYPE 1 + +#ifdef __i386__ +# define __socketcall extern __attribute__((__cdecl__)) +#else +# define __socketcall extern +#endif + +__socketcall int socket(int, int, int); +__socketcall int bind(int, const struct sockaddr *, int); +__socketcall int connect(int, const struct sockaddr *, socklen_t); +__socketcall int listen(int, int); +__socketcall int accept(int, struct sockaddr *, socklen_t *); +__socketcall int getsockname(int, struct sockaddr *, socklen_t *); +__socketcall int getpeername(int, struct sockaddr *, socklen_t *); +__socketcall int socketpair(int, int, int, int *); +__socketcall int shutdown(int, int); +__socketcall int setsockopt(int, int, int, const void *, socklen_t); +__socketcall int getsockopt(int, int, int, void *, socklen_t *); +__socketcall int sendmsg(int, const struct msghdr *, unsigned int); +__socketcall int recvmsg(int, struct msghdr *, unsigned int); + +extern ssize_t send(int, const void *, size_t, unsigned int); +extern ssize_t recv(int, void *, size_t, unsigned int); + +__socketcall ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); +__socketcall ssize_t recvfrom(int, void *, size_t, unsigned int, const struct sockaddr *, socklen_t *); + +#if defined(__BIONIC_FORTIFY) +__errordecl(__recvfrom_error, "recvfrom called with size bigger than buffer"); +extern ssize_t __recvfrom_chk(int, void*, size_t, size_t, unsigned int, const struct sockaddr*, socklen_t *); +extern ssize_t __recvfrom_real(int, void *, size_t, unsigned int, const struct sockaddr*, socklen_t*) + __asm__(__USER_LABEL_PREFIX__ "recvfrom"); + +__BIONIC_FORTIFY_INLINE +ssize_t recvfrom(int fd, void* buf, size_t len, unsigned int flags, const struct sockaddr* src_addr, socklen_t* addrlen) { + size_t bos = __bos0(buf); + +#if !defined(__clang__) + if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) { + return __recvfrom_real(fd, buf, len, flags, src_addr, addrlen); + } + + if (__builtin_constant_p(len) && (len <= bos)) { + return __recvfrom_real(fd, buf, len, flags, src_addr, addrlen); + } + + if (__builtin_constant_p(len) && (len > bos)) { + __recvfrom_error(); + } +#endif + + return __recvfrom_chk(fd, buf, len, bos, flags, src_addr, addrlen); +} + +__BIONIC_FORTIFY_INLINE +ssize_t recv(int socket, void *buf, size_t buflen, unsigned int flags) { + return recvfrom(socket, buf, buflen, flags, NULL, 0); +} + +#endif /* __BIONIC_FORTIFY */ + +#undef __socketcall + +__END_DECLS + +#endif /* _SYS_SOCKET_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/socketcalls.h b/9/platforms/android-19/arch-arm64/usr/include/sys/socketcalls.h new file mode 100644 index 0000000..c74f463 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/socketcalls.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SOCKETCALLS_H_ +#define _SYS_SOCKETCALLS_H_ + +/* socketcalls by number */ + +#define SYS_SOCKET 1 /* sys_socket(2) */ +#define SYS_BIND 2 /* sys_bind(2) */ +#define SYS_CONNECT 3 /* sys_connect(2) */ +#define SYS_LISTEN 4 /* sys_listen(2) */ +#define SYS_ACCEPT 5 /* sys_accept(2) */ +#define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */ +#define SYS_GETPEERNAME 7 /* sys_getpeername(2) */ +#define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */ +#define SYS_SEND 9 /* sys_send(2) */ +#define SYS_RECV 10 /* sys_recv(2) */ +#define SYS_SENDTO 11 /* sys_sendto(2) */ +#define SYS_RECVFROM 12 /* sys_recvfrom(2) */ +#define SYS_SHUTDOWN 13 /* sys_shutdown(2) */ +#define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */ +#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ +#define SYS_SENDMSG 16 /* sys_sendmsg(2) */ +#define SYS_RECVMSG 17 /* sys_recvmsg(2) */ + +#endif /* _SYS_SOCKETCALLS_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/stat.h b/9/platforms/android-19/arch-arm64/usr/include/sys/stat.h new file mode 100644 index 0000000..3d754c0 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/stat.h @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_STAT_H_ +#define _SYS_STAT_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <sys/time.h> +#include <linux/stat.h> + +#include <endian.h> + +__BEGIN_DECLS + +#if defined(__aarch64__) +struct stat { + unsigned long st_dev; + unsigned long st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + unsigned long st_rdev; + unsigned long __pad1; + long st_size; + int st_blksize; + int __pad2; + long st_blocks; + long st_atime; + unsigned long st_atime_nsec; + long st_mtime; + unsigned long st_mtime_nsec; + long st_ctime; + unsigned long st_ctime_nsec; + unsigned int __unused4; + unsigned int __unused5; +}; +#elif defined(__mips__) +struct stat { + unsigned long st_dev; + unsigned long __pad0[3]; + unsigned long long st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned long st_uid; + unsigned long st_gid; + unsigned long st_rdev; + unsigned long __pad1[3]; + long long st_size; + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; + unsigned long st_mtime_nsec; + unsigned long st_ctime; + unsigned long st_ctime_nsec; + unsigned long st_blksize; + unsigned long __pad2; + unsigned long long st_blocks; +}; +#elif defined(__x86_64__) +struct stat { + unsigned long st_dev; + unsigned long st_ino; + unsigned long st_nlink; + unsigned int st_mode; + unsigned int st_uid; + unsigned int st_gid; + unsigned int __pad0; + unsigned long st_rdev; + long st_size; + long st_blksize; + long st_blocks; + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; + unsigned long st_mtime_nsec; + unsigned long st_ctime; + unsigned long st_ctime_nsec; + long __pad3[3]; +}; +#else +struct stat { + unsigned long long st_dev; + unsigned char __pad0[4]; + unsigned long __st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned long st_uid; + unsigned long st_gid; + unsigned long long st_rdev; + unsigned char __pad3[4]; + long long st_size; + unsigned long st_blksize; + unsigned long long st_blocks; + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; + unsigned long st_mtime_nsec; + unsigned long st_ctime; + unsigned long st_ctime_nsec; + unsigned long long st_ino; +}; +#endif + +/* For compatibility with GLibc, we provide macro aliases + * for the non-Posix nano-seconds accessors. + */ +#define st_atimensec st_atime_nsec +#define st_mtimensec st_mtime_nsec +#define st_ctimensec st_ctime_nsec + +#ifdef __USE_BSD +/* Permission macros provided by glibc for compatibility with BSDs. */ +#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* 0777 */ +#define ALLPERMS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /* 07777 */ +#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */ +#endif + +extern int chmod(const char *, mode_t); +extern int fchmod(int, mode_t); +extern int mkdir(const char *, mode_t); + +extern int stat(const char *, struct stat *); +extern int fstat(int, struct stat *); +extern int lstat(const char *, struct stat *); +extern int mknod(const char *, mode_t, dev_t); +extern mode_t umask(mode_t); + +#if defined(__BIONIC_FORTIFY) + +extern mode_t __umask_chk(mode_t); +extern mode_t __umask_real(mode_t) + __asm__(__USER_LABEL_PREFIX__ "umask"); +__errordecl(__umask_invalid_mode, "umask called with invalid mode"); + +__BIONIC_FORTIFY_INLINE +mode_t umask(mode_t mode) { +#if !defined(__clang__) + if (__builtin_constant_p(mode)) { + if ((mode & 0777) != mode) { + __umask_invalid_mode(); + } + return __umask_real(mode); + } +#endif + return __umask_chk(mode); +} +#endif /* defined(__BIONIC_FORTIFY) */ + + +#define stat64 stat +#define fstat64 fstat +#define lstat64 lstat + +extern int mkfifo(const char*, mode_t); + +extern int fchmodat(int, const char*, mode_t, int); +extern int fstatat(int, const char*, struct stat*, int); +extern int mkdirat(int, const char*, mode_t); +extern int mknodat(int, const char*, mode_t, dev_t); + +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +extern int utimensat(int fd, const char *path, const struct timespec times[2], int flags); +extern int futimens(int fd, const struct timespec times[2]); + +__END_DECLS + +#endif /* _SYS_STAT_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/statfs.h b/9/platforms/android-19/arch-arm64/usr/include/sys/statfs.h new file mode 100644 index 0000000..53b3b5e --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/statfs.h @@ -0,0 +1 @@ +#include <sys/vfs.h> diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/statvfs.h b/9/platforms/android-19/arch-arm64/usr/include/sys/statvfs.h new file mode 100644 index 0000000..e910c03 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/statvfs.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _SYS_STATVFS_H_ +#define _SYS_STATVFS_H_ + +#include <stdint.h> +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +struct statvfs { + unsigned long f_bsize; + unsigned long f_frsize; + fsblkcnt_t f_blocks; + fsblkcnt_t f_bfree; + fsblkcnt_t f_bavail; + fsfilcnt_t f_files; + fsfilcnt_t f_ffree; + fsfilcnt_t f_favail; + unsigned long f_fsid; + unsigned long f_flag; + unsigned long f_namemax; +}; + +#define ST_RDONLY 0x0001 +#define ST_NOSUID 0x0002 +#define ST_NODEV 0x0004 +#define ST_NOEXEC 0x0008 +#define ST_SYNCHRONOUS 0x0010 +#define ST_MANDLOCK 0x0040 +#define ST_NOATIME 0x0400 +#define ST_NODIRATIME 0x0800 +#define ST_RELATIME 0x1000 + +extern int statvfs(const char* __restrict, struct statvfs* __restrict) __nonnull((1, 2)); +extern int fstatvfs(int, struct statvfs*) __nonnull((2)); + +__END_DECLS + +#endif /* _SYS_STATVFS_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/swap.h b/9/platforms/android-19/arch-arm64/usr/include/sys/swap.h new file mode 100644 index 0000000..e4c1819 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/swap.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_SWAP_H_ +#define _SYS_SWAP_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#define SWAP_FLAG_DISCARD 0x10000 +#define SWAP_FLAG_PREFER 0x8000 +#define SWAP_FLAG_PRIO_MASK 0x7fff +#define SWAP_FLAG_PRIO_SHIFT 0 + +extern int swapon(const char*, int) __nonnull((1)); +extern int swapoff(const char*) __nonnull((1)); + +__END_DECLS + +#endif /* _SYS_SWAP_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/syscall.h b/9/platforms/android-19/arch-arm64/usr/include/sys/syscall.h new file mode 100644 index 0000000..a44b2e5 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/syscall.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSCALL_H_ +#define _SYS_SYSCALL_H_ + +#include <errno.h> +#include <sys/cdefs.h> +#include <sys/types.h> +#include <asm/unistd.h> + +#include <sys/glibc-syscalls.h> /* glibc-compatible SYS_* aliases for our __NR_* names. */ + +__BEGIN_DECLS + +int syscall(int number, ...); + +__END_DECLS + +#endif /* _SYS_SYSCALL_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/sysconf.h b/9/platforms/android-19/arch-arm64/usr/include/sys/sysconf.h new file mode 100644 index 0000000..0a46e7a --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/sysconf.h @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSCONF_H_ +#define _SYS_SYSCONF_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/* as listed by Posix sysconf() description */ +/* most of these will return -1 and ENOSYS */ + +#define _SC_ARG_MAX 0x0000 +#define _SC_BC_BASE_MAX 0x0001 +#define _SC_BC_DIM_MAX 0x0002 +#define _SC_BC_SCALE_MAX 0x0003 +#define _SC_BC_STRING_MAX 0x0004 +#define _SC_CHILD_MAX 0x0005 +#define _SC_CLK_TCK 0x0006 +#define _SC_COLL_WEIGHTS_MAX 0x0007 +#define _SC_EXPR_NEST_MAX 0x0008 +#define _SC_LINE_MAX 0x0009 +#define _SC_NGROUPS_MAX 0x000a +#define _SC_OPEN_MAX 0x000b +#define _SC_PASS_MAX 0x000c +#define _SC_2_C_BIND 0x000d +#define _SC_2_C_DEV 0x000e +#define _SC_2_C_VERSION 0x000f +#define _SC_2_CHAR_TERM 0x0010 +#define _SC_2_FORT_DEV 0x0011 +#define _SC_2_FORT_RUN 0x0012 +#define _SC_2_LOCALEDEF 0x0013 +#define _SC_2_SW_DEV 0x0014 +#define _SC_2_UPE 0x0015 +#define _SC_2_VERSION 0x0016 +#define _SC_JOB_CONTROL 0x0017 +#define _SC_SAVED_IDS 0x0018 +#define _SC_VERSION 0x0019 +#define _SC_RE_DUP_MAX 0x001a +#define _SC_STREAM_MAX 0x001b +#define _SC_TZNAME_MAX 0x001c +#define _SC_XOPEN_CRYPT 0x001d +#define _SC_XOPEN_ENH_I18N 0x001e +#define _SC_XOPEN_SHM 0x001f +#define _SC_XOPEN_VERSION 0x0020 +#define _SC_XOPEN_XCU_VERSION 0x0021 +#define _SC_XOPEN_REALTIME 0x0022 +#define _SC_XOPEN_REALTIME_THREADS 0x0023 +#define _SC_XOPEN_LEGACY 0x0024 +#define _SC_ATEXIT_MAX 0x0025 +#define _SC_IOV_MAX 0x0026 +#define _SC_PAGESIZE 0x0027 +#define _SC_PAGE_SIZE 0x0028 +#define _SC_XOPEN_UNIX 0x0029 +#define _SC_XBS5_ILP32_OFF32 0x002a +#define _SC_XBS5_ILP32_OFFBIG 0x002b +#define _SC_XBS5_LP64_OFF64 0x002c +#define _SC_XBS5_LPBIG_OFFBIG 0x002d +#define _SC_AIO_LISTIO_MAX 0x002e +#define _SC_AIO_MAX 0x002f +#define _SC_AIO_PRIO_DELTA_MAX 0x0030 +#define _SC_DELAYTIMER_MAX 0x0031 +#define _SC_MQ_OPEN_MAX 0x0032 +#define _SC_MQ_PRIO_MAX 0x0033 +#define _SC_RTSIG_MAX 0x0034 +#define _SC_SEM_NSEMS_MAX 0x0035 +#define _SC_SEM_VALUE_MAX 0x0036 +#define _SC_SIGQUEUE_MAX 0x0037 +#define _SC_TIMER_MAX 0x0038 +#define _SC_ASYNCHRONOUS_IO 0x0039 +#define _SC_FSYNC 0x003a +#define _SC_MAPPED_FILES 0x003b +#define _SC_MEMLOCK 0x003c +#define _SC_MEMLOCK_RANGE 0x003d +#define _SC_MEMORY_PROTECTION 0x003e +#define _SC_MESSAGE_PASSING 0x003f +#define _SC_PRIORITIZED_IO 0x0040 +#define _SC_PRIORITY_SCHEDULING 0x0041 +#define _SC_REALTIME_SIGNALS 0x0042 +#define _SC_SEMAPHORES 0x0043 +#define _SC_SHARED_MEMORY_OBJECTS 0x0044 +#define _SC_SYNCHRONIZED_IO 0x0045 +#define _SC_TIMERS 0x0046 +#define _SC_GETGR_R_SIZE_MAX 0x0047 +#define _SC_GETPW_R_SIZE_MAX 0x0048 +#define _SC_LOGIN_NAME_MAX 0x0049 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 0x004a +#define _SC_THREAD_KEYS_MAX 0x004b +#define _SC_THREAD_STACK_MIN 0x004c +#define _SC_THREAD_THREADS_MAX 0x004d +#define _SC_TTY_NAME_MAX 0x004e + +#define _SC_THREADS 0x004f +#define _SC_THREAD_ATTR_STACKADDR 0x0050 +#define _SC_THREAD_ATTR_STACKSIZE 0x0051 +#define _SC_THREAD_PRIORITY_SCHEDULING 0x0052 +#define _SC_THREAD_PRIO_INHERIT 0x0053 +#define _SC_THREAD_PRIO_PROTECT 0x0054 +#define _SC_THREAD_SAFE_FUNCTIONS 0x0055 + +#define _SC_NPROCESSORS_CONF 0x0060 +#define _SC_NPROCESSORS_ONLN 0x0061 +#define _SC_PHYS_PAGES 0x0062 +#define _SC_AVPHYS_PAGES 0x0063 +#define _SC_MONOTONIC_CLOCK 0x0064 + +extern int sysconf(int name); + +__END_DECLS + +#endif /* _SYS_SYSCONF_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/sysinfo.h b/9/platforms/android-19/arch-arm64/usr/include/sys/sysinfo.h new file mode 100644 index 0000000..c7e46e6 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/sysinfo.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSINFO_H_ +#define _SYS_SYSINFO_H_ + +#include <sys/cdefs.h> +#include <linux/kernel.h> + +__BEGIN_DECLS + +extern int sysinfo (struct sysinfo *info); + +__END_DECLS + +#endif /* _SYS_SYSINFO_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/syslimits.h b/9/platforms/android-19/arch-arm64/usr/include/sys/syslimits.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/syslimits.h diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/sysmacros.h b/9/platforms/android-19/arch-arm64/usr/include/sys/sysmacros.h new file mode 100644 index 0000000..6f053a8 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/sysmacros.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_SYSMACROS_H_ +#define _SYS_SYSMACROS_H_ + +/* some rogue code includes this file directly :-( */ +#ifndef _SYS_TYPES_H_ +# include <sys/types.h> +#endif + +static __inline__ int major(dev_t _dev) +{ + return (_dev >> 8) & 0xfff; +} + +static __inline__ int minor(dev_t _dev) +{ + return (_dev & 0xff) | ((_dev >> 12) & 0xfff00); +} + +static __inline__ dev_t makedev(int __ma, int __mi) +{ + return ((__ma & 0xfff) << 8) | (__mi & 0xff) | ((__mi & 0xfff00) << 12); +} + +#endif /* _SYS_SYSMACROS_H_ */ + diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/system_properties.h b/9/platforms/android-19/arch-arm64/usr/include/sys/system_properties.h new file mode 100644 index 0000000..01c3db3 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/system_properties.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _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 +#define PROP_VALUE_MAX 92 + +/* Look up a system property by name, copying its value and a +** \0 terminator to the provided pointer. The total bytes +** copied will be no greater than PROP_VALUE_MAX. Returns +** the string length of the value. A property that is not +** defined is identical to a property with a length 0 value. +*/ +int __system_property_get(const char *name, char *value); + +/* Set a system property by name. +**/ +int __system_property_set(const char *key, const char *value); + +/* Return a pointer to the system property named name, if it +** exists, or NULL if there is no such property. Use +** __system_property_read() to obtain the string value from +** the returned prop_info pointer. +** +** It is safe to cache the prop_info pointer to avoid future +** lookups. These returned pointers will remain valid for +** the lifetime of the system. +*/ +const prop_info *__system_property_find(const char *name); + +/* Read the value of a system property. Returns the length +** of the value. Copies the value and \0 terminator into +** the provided value pointer. Total length (including +** terminator) will be no greater that PROP_VALUE_MAX. +** +** If name is nonzero, up to PROP_NAME_MAX bytes will be +** copied into the provided name pointer. The name will +** be \0 terminated. +*/ +int __system_property_read(const prop_info *pi, char *name, char *value); + +/* Return a prop_info for the nth system property, or NULL if +** there is no nth property. Use __system_property_read() to +** read the value of this property. +** +** Please do not call this method. It only exists to provide +** backwards compatibility to NDK apps. Its implementation +** is inefficient and order of results may change from call +** to call. +*/ +const prop_info *__system_property_find_nth(unsigned n); + +/* Pass a prop_info for each system property to the provided +** callback. Use __system_property_read() to read the value +** of this property. +** +** This method is for inspecting and debugging the property +** system. Please use __system_property_find() instead. +** +** Order of results may change from call to call. This is +** not a bug. +*/ +int __system_property_foreach( + void (*propfn)(const prop_info *pi, void *cookie), + void *cookie); + +__END_DECLS + +#endif diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/time.h b/9/platforms/android-19/arch-arm64/usr/include/sys/time.h new file mode 100644 index 0000000..1f010d4 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/time.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TIME_H_ +#define _SYS_TIME_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/time.h> + +__BEGIN_DECLS + +extern int gettimeofday(struct timeval *, struct timezone *); +extern int settimeofday(const struct timeval *, const struct timezone *); + +extern int getitimer(int, struct itimerval *); +extern int setitimer(int, const struct itimerval *, struct itimerval *); + +extern int utimes(const char *, const struct timeval *); + +#define timerclear(a) \ + ((a)->tv_sec = (a)->tv_usec = 0) + +#define timerisset(a) \ + ((a)->tv_sec != 0 || (a)->tv_usec != 0) + +#define timercmp(a, b, op) \ + ((a)->tv_sec == (b)->tv_sec \ + ? (a)->tv_usec op (b)->tv_usec \ + : (a)->tv_sec op (b)->tv_sec) + +#define timeradd(a, b, res) \ + do { \ + (res)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ + (res)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ + if ((res)->tv_usec >= 1000000) { \ + (res)->tv_usec -= 1000000; \ + (res)->tv_sec += 1; \ + } \ + } while (0) + +#define timersub(a, b, res) \ + do { \ + (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((res)->tv_usec < 0) { \ + (res)->tv_usec += 1000000; \ + (res)->tv_sec -= 1; \ + } \ + } while (0) + +__END_DECLS + +#endif /* _SYS_TIME_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/timeb.h b/9/platforms/android-19/arch-arm64/usr/include/sys/timeb.h new file mode 100644 index 0000000..cf6f255 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/timeb.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TIMEB_H +#define _SYS_TIMEB_H + +#include <sys/cdefs.h> +#include <sys/time.h> + +__BEGIN_DECLS + +struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; + +extern int ftime(struct timeb* timebuf); + +__END_DECLS + +#endif /* _SYS_TIMEB_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/timerfd.h b/9/platforms/android-19/arch-arm64/usr/include/sys/timerfd.h new file mode 100644 index 0000000..1aa97b4 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/timerfd.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_TIMERFD_H_ +#define _SYS_TIMERFD_H_ + +#include <fcntl.h> /* For O_CLOEXEC and O_NONBLOCK. */ +#include <time.h> +#include <sys/types.h> + +__BEGIN_DECLS + +#define TFD_TIMER_ABSTIME (1 << 0) +#define TFD_TIMER_CANCEL_ON_SET (1 << 1) + +#define TFD_CLOEXEC O_CLOEXEC +#define TFD_NONBLOCK O_NONBLOCK + +extern int timerfd_create(clockid_t, int); +extern int timerfd_settime(int, int, const struct itimerspec*, + struct itimerspec*); +extern int timerfd_gettime(int, struct itimerspec*); + +__END_DECLS + +#endif /* _SYS_TIMERFD_H */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/times.h b/9/platforms/android-19/arch-arm64/usr/include/sys/times.h new file mode 100644 index 0000000..1b9b8b2 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/times.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TIMES_H_ +#define _SYS_TIMES_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/times.h> + +__BEGIN_DECLS + +extern clock_t times(struct tms *); + +__END_DECLS + +#endif /* _SYS_TIMES_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/timex.h b/9/platforms/android-19/arch-arm64/usr/include/sys/timex.h new file mode 100644 index 0000000..4096e7d --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/timex.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_TIMEX_H_ +#define _SYS_TIMEX_H_ + +#include <linux/timex.h> + +#endif /* _SYS_TIMEX_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/ttychars.h b/9/platforms/android-19/arch-arm64/usr/include/sys/ttychars.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/ttychars.h diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/ttydefaults.h b/9/platforms/android-19/arch-arm64/usr/include/sys/ttydefaults.h new file mode 100644 index 0000000..405e759 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/ttydefaults.h @@ -0,0 +1,115 @@ +/* $NetBSD: ttydefaults.h,v 1.16 2008/05/24 14:06:39 yamt Exp $ */ + +/*- + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * 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. + * + * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 + */ + +/* + * System wide defaults for terminal state. + */ +#ifndef _SYS_TTYDEFAULTS_H_ +#define _SYS_TTYDEFAULTS_H_ + +/* + * Defaults on "first" open. + */ +#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY) +#define TTYDEF_OFLAG (OPOST | ONLCR | OXTABS) +#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) +#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) +#define TTYDEF_SPEED (B9600) + +/* + * Control Character Defaults + */ +#define CTRL(x) (x&037) +#define CEOF CTRL('d') +#define CEOL ((unsigned char)'\377') /* XXX avoid _POSIX_VDISABLE */ +#define CERASE 0177 +#define CINTR CTRL('c') +#define CSTATUS CTRL('t') +#define CKILL CTRL('u') +#define CMIN 1 +#define CQUIT 034 /* FS, ^\ */ +#define CSUSP CTRL('z') +#define CTIME 0 +#define CDSUSP CTRL('y') +#define CSTART CTRL('q') +#define CSTOP CTRL('s') +#define CLNEXT CTRL('v') +#define CDISCARD CTRL('o') +#define CWERASE CTRL('w') +#define CREPRINT CTRL('r') +#define CEOT CEOF +/* compat */ +#define CBRK CEOL +#define CRPRNT CREPRINT +#define CFLUSH CDISCARD + +/* PROTECTED INCLUSION ENDS HERE */ +#endif /* !_SYS_TTYDEFAULTS_H_ */ + +/* + * #define TTYDEFCHARS to include an array of default control characters. + */ +#ifdef _KERNEL +#ifdef TTYDEFCHARS +const cc_t ttydefchars[NCCS] = { + [VEOF] = CEOF, + [VEOL] = CEOL, + [VEOL2] = CEOL, + [VERASE] = CERASE, + [VWERASE] = CWERASE, + [VKILL] = CKILL, + [VREPRINT] = CREPRINT, + [7] = _POSIX_VDISABLE, /* spare */ + [VINTR] = CINTR, + [VQUIT] = CQUIT, + [VSUSP] = CSUSP, + [VDSUSP] = CDSUSP, + [VSTART] = CSTART, + [VSTOP] = CSTOP, + [VLNEXT] = CLNEXT, + [VDISCARD] = CDISCARD, + [VMIN] = CMIN, + [VTIME] = CTIME, + [VSTATUS] = CSTATUS, + [19] = _POSIX_VDISABLE, /* spare */ +}; +#undef TTYDEFCHARS +#else +extern const cc_t ttydefchars[NCCS]; +#endif +#endif /* _KERNEL */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/ttydev.h b/9/platforms/android-19/arch-arm64/usr/include/sys/ttydev.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/ttydev.h diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/types.h b/9/platforms/android-19/arch-arm64/usr/include/sys/types.h new file mode 100644 index 0000000..f8ae813 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/types.h @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_TYPES_H_ +#define _SYS_TYPES_H_ + +#include <stddef.h> +#include <stdint.h> +#include <sys/cdefs.h> + +#include <linux/types.h> +#include <linux/posix_types.h> + +/* __kernel_gid_t and __kernel_uid_t are 16 bit for legacy reasons. + * Android uses __kernel_uid32_t and __kernel_gid32_t instead. + */ +typedef __kernel_gid32_t gid_t; +typedef __kernel_uid32_t uid_t; + +typedef unsigned long blkcnt_t; +typedef unsigned long blksize_t; +typedef __kernel_caddr_t caddr_t; +typedef __kernel_clock_t clock_t; +typedef __kernel_clockid_t clockid_t; +typedef __kernel_daddr_t daddr_t; +typedef unsigned long fsblkcnt_t; +typedef unsigned long fsfilcnt_t; +typedef __kernel_ino_t ino_t; +typedef __kernel_key_t key_t; +typedef __kernel_mode_t mode_t; +typedef __nlink_t nlink_t; +typedef __kernel_pid_t pid_t; +typedef __kernel_suseconds_t suseconds_t; +typedef __kernel_timer_t timer_t; +typedef unsigned int useconds_t; + +#if !defined(__LP64__) +/* This historical accident means that we had a 32-bit dev_t on 32-bit architectures. */ +typedef uint32_t dev_t; +#else +typedef uint64_t dev_t; +#endif + +/* This historical accident means that we had a 32-bit time_t on 32-bit architectures. */ +typedef __kernel_time_t time_t; + +/* This historical accident means that we had a 32-bit off_t on 32-bit architectures. */ +#ifndef _OFF_T_DEFINED_ +#define _OFF_T_DEFINED_ +typedef __kernel_off_t off_t; +#endif +typedef __kernel_loff_t loff_t; +typedef loff_t off64_t; + +/* This one really is meant to be just 32 bits! */ +typedef uint32_t id_t; + +/* while POSIX wants these in <sys/types.h>, we + * declare then in <pthread.h> instead */ +#if 0 +typedef .... pthread_attr_t; +typedef .... pthread_cond_t; +typedef .... pthread_condattr_t; +typedef .... pthread_key_t; +typedef .... pthread_mutex_t; +typedef .... pthread_once_t; +typedef .... pthread_rwlock_t; +typedef .... pthread_rwlock_attr_t; +typedef .... pthread_t; +#endif + +#ifndef _SSIZE_T_DEFINED_ +#define _SSIZE_T_DEFINED_ +/* Traditionally, bionic's ssize_t was "long int". This caused GCC to emit warnings when you + * pass a ssize_t to a printf-style function. The correct type is __kernel_ssize_t, which is + * "int", which isn't an ABI change for C code (because they're the same size) but is an ABI + * change for C++ because "int" and "long int" mangle to "i" and "l" respectively. So until + * we can fix the ABI, this change should not be propagated to the NDK. http://b/8253769. */ +typedef __kernel_ssize_t ssize_t; +#endif + +typedef unsigned int uint_t; +typedef unsigned int uint; + +/* for some applications */ +#include <sys/sysmacros.h> + +#ifdef __BSD_VISIBLE +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; + +typedef uint32_t u_int32_t; +typedef uint16_t u_int16_t; +typedef uint8_t u_int8_t; +typedef uint64_t u_int64_t; +#endif + +#endif diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/uio.h b/9/platforms/android-19/arch-arm64/usr/include/sys/uio.h new file mode 100644 index 0000000..0251716 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/uio.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UIO_H_ +#define _SYS_UIO_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <linux/uio.h> + +__BEGIN_DECLS + +int readv(int, const struct iovec *, int); +int writev(int, const struct iovec *, int); + +__END_DECLS + +#endif /* _SYS_UIO_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/un.h b/9/platforms/android-19/arch-arm64/usr/include/sys/un.h new file mode 100644 index 0000000..f89ead3 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/un.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UN_H_ +#define _SYS_UN_H_ + +#include <sys/_types.h> +typedef __sa_family_t sa_family_t; + +#include <linux/un.h> + +#endif /* _SYS_UN_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/user.h b/9/platforms/android-19/arch-arm64/usr/include/sys/user.h new file mode 100644 index 0000000..9f11a83 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/user.h @@ -0,0 +1,238 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_USER_H_ +#define _SYS_USER_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#if __i386__ + +struct user_i387_struct { + long cwd; + long swd; + long twd; + long fip; + long fcs; + long foo; + long fos; + long st_space[20]; +}; +struct user_fxsr_struct { + unsigned short cwd; + unsigned short swd; + unsigned short twd; + unsigned short fop; + long fip; + long fcs; + long foo; + long fos; + long mxcsr; + long reserved; + long st_space[32]; + long xmm_space[32]; + long padding[56]; +}; +struct user_regs_struct { + long ebx; + long ecx; + long edx; + long esi; + long edi; + long ebp; + long eax; + long xds; + long xes; + long xfs; + long xgs; + long orig_eax; + long eip; + long xcs; + long eflags; + long esp; + long xss; +}; +struct user { + struct user_regs_struct regs; + int u_fpvalid; + struct user_i387_struct i387; + unsigned long int u_tsize; + unsigned long int u_dsize; + unsigned long int u_ssize; + unsigned long start_code; + unsigned long start_stack; + long int signal; + int reserved; + unsigned long u_ar0; + struct user_i387_struct* u_fpstate; + unsigned long magic; + char u_comm[32]; + int u_debugreg[8]; +}; + +#elif defined(__x86_64__) + +struct user_i387_struct { + unsigned short cwd; + unsigned short swd; + unsigned short twd; + unsigned short fop; + __u64 rip; + __u64 rdp; + __u32 mxcsr; + __u32 mxcsr_mask; + __u32 st_space[32]; + __u32 xmm_space[64]; + __u32 padding[24]; +}; +struct user_regs_struct { + unsigned long r15; + unsigned long r14; + unsigned long r13; + unsigned long r12; + unsigned long rbp; + unsigned long rbx; + unsigned long r11; + unsigned long r10; + unsigned long r9; + unsigned long r8; + unsigned long rax; + unsigned long rcx; + unsigned long rdx; + unsigned long rsi; + unsigned long rdi; + unsigned long orig_rax; + unsigned long rip; + unsigned long cs; + unsigned long eflags; + unsigned long rsp; + unsigned long ss; + unsigned long fs_base; + unsigned long gs_base; + unsigned long ds; + unsigned long es; + unsigned long fs; + unsigned long gs; +}; +struct user { + struct user_regs_struct regs; + int u_fpvalid; + int pad0; + struct user_i387_struct i387; + unsigned long int u_tsize; + unsigned long int u_dsize; + unsigned long int u_ssize; + unsigned long start_code; + unsigned long start_stack; + long int signal; + int reserved; + int pad1; + unsigned long u_ar0; + struct user_i387_struct* u_fpstate; + unsigned long magic; + char u_comm[32]; + unsigned long u_debugreg[8]; + unsigned long error_code; + unsigned long fault_address; +}; + +#elif defined(__mips__) + +struct user { + unsigned long regs[180 / sizeof(unsigned long) + 64]; + size_t u_tsize; + size_t u_dsize; + size_t u_ssize; + unsigned long start_code; + unsigned long start_data; + unsigned long start_stack; + long int signal; + unsigned long u_ar0; + unsigned long magic; + char u_comm[32]; +}; + +#elif defined(__arm__) + +struct user_fp { + struct fp_reg { + unsigned int sign1:1; + unsigned int unused:15; + unsigned int sign2:1; + unsigned int exponent:14; + unsigned int j:1; + unsigned int mantissa1:31; + unsigned int mantissa0:32; + } fpregs[8]; + unsigned int fpsr:32; + unsigned int fpcr:32; + unsigned char ftype[8]; + unsigned int init_flag; +}; +struct user_vfp { + unsigned long long fpregs[32]; + unsigned long fpscr; +}; +struct user_vfp_exc { + unsigned long fpexc; + unsigned long fpinst; + unsigned long fpinst2; +}; +struct user { + struct pt_regs regs; + int u_fpvalid; + unsigned long int u_tsize; + unsigned long int u_dsize; + unsigned long int u_ssize; + unsigned long start_code; + unsigned long start_stack; + long int signal; + int reserved; + unsigned long u_ar0; + unsigned long magic; + char u_comm[32]; + int u_debugreg[8]; + struct user_fp u_fp; + struct user_fp_struct* u_fp0; +}; + +#elif defined(__aarch64__) + +// There are no user structures for 64 bit arm. + +#else + +#error "Unsupported architecture." + +#endif + +__END_DECLS + +#endif /* _SYS_USER_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/utime.h b/9/platforms/android-19/arch-arm64/usr/include/sys/utime.h new file mode 100644 index 0000000..9f8810e --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/utime.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UTIME_H_ +#define _SYS_UTIME_H_ + +#include <linux/utime.h> + +#endif /* _SYS_UTIME_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/utsname.h b/9/platforms/android-19/arch-arm64/usr/include/sys/utsname.h new file mode 100644 index 0000000..d54a994 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/utsname.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_UTSNAME_H_ +#define _SYS_UTSNAME_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#define SYS_NMLN 65 + +struct utsname { + char sysname [SYS_NMLN]; + char nodename [SYS_NMLN]; + char release [SYS_NMLN]; + char version [SYS_NMLN]; + char machine [SYS_NMLN]; + char domainname[SYS_NMLN]; +}; + +extern int uname(struct utsname *); + +__END_DECLS + +#endif /* _SYS_UTSNAME_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/vfs.h b/9/platforms/android-19/arch-arm64/usr/include/sys/vfs.h new file mode 100644 index 0000000..10fe502 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/vfs.h @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_VFS_H_ +#define _SYS_VFS_H_ + +#include <stdint.h> +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +/* The kernel's __kernel_fsid_t has a 'val' member but glibc uses '__val'. */ +typedef struct { int __val[2]; } __fsid_t; +typedef __fsid_t fsid_t; + +#if defined(__LP64__) +struct statfs { + uint64_t f_type; + uint64_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + fsid_t f_fsid; + uint64_t f_namelen; + uint64_t f_frsize; + uint64_t f_flags; + uint64_t f_spare[4]; +}; +#elif defined(__mips__) +/* 32-bit MIPS (corresponds to the kernel's statfs64 type). */ +struct statfs { + uint32_t f_type; + uint32_t f_bsize; + uint32_t f_frsize; + uint32_t __pad; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_files; + uint64_t f_ffree; + uint64_t f_bavail; + fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_flags; + uint32_t f_spare[5]; +}; +#else +/* 32-bit ARM or x86 (corresponds to the kernel's statfs64 type). */ +struct statfs { + uint32_t f_type; + uint32_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + fsid_t f_fsid; + uint32_t f_namelen; + uint32_t f_frsize; + uint32_t f_flags; + uint32_t f_spare[4]; +}; +#endif + +/* Source compatibility with glibc. */ +#define statfs64 statfs + +/* Declare that we have the f_namelen, f_frsize, and f_flags fields. */ +#define _STATFS_F_NAMELEN +#define _STATFS_F_FRSIZE +#define _STATFS_F_FLAGS + +#define ADFS_SUPER_MAGIC 0xadf5 +#define AFFS_SUPER_MAGIC 0xADFF +#define BEFS_SUPER_MAGIC 0x42465331 +#define BFS_MAGIC 0x1BADFACE +#define CIFS_MAGIC_NUMBER 0xFF534D42 +#define CODA_SUPER_MAGIC 0x73757245 +#define COH_SUPER_MAGIC 0x012FF7B7 +#define CRAMFS_MAGIC 0x28cd3d45 +#define DEVFS_SUPER_MAGIC 0x1373 +#define EFS_SUPER_MAGIC 0x00414A53 +#define EXT_SUPER_MAGIC 0x137D +#define EXT2_OLD_SUPER_MAGIC 0xEF51 +#define EXT2_SUPER_MAGIC 0xEF53 +#define EXT3_SUPER_MAGIC 0xEF53 +#define HFS_SUPER_MAGIC 0x4244 +#define HPFS_SUPER_MAGIC 0xF995E849 +#define HUGETLBFS_MAGIC 0x958458f6 +#define ISOFS_SUPER_MAGIC 0x9660 +#define JFFS2_SUPER_MAGIC 0x72b6 +#define JFS_SUPER_MAGIC 0x3153464a +#define MINIX_SUPER_MAGIC 0x137F /* orig. minix */ +#define MINIX_SUPER_MAGIC2 0x138F /* 30 char minix */ +#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 */ +#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2, 30 char names */ +#define MSDOS_SUPER_MAGIC 0x4d44 +#define NCP_SUPER_MAGIC 0x564c +#define NFS_SUPER_MAGIC 0x6969 +#define NTFS_SB_MAGIC 0x5346544e +#define OPENPROM_SUPER_MAGIC 0x9fa1 +#define PROC_SUPER_MAGIC 0x9fa0 +#define QNX4_SUPER_MAGIC 0x002f +#define REISERFS_SUPER_MAGIC 0x52654973 +#define ROMFS_MAGIC 0x7275 +#define SMB_SUPER_MAGIC 0x517B +#define SYSV2_SUPER_MAGIC 0x012FF7B6 +#define SYSV4_SUPER_MAGIC 0x012FF7B5 +#define TMPFS_MAGIC 0x01021994 +#define UDF_SUPER_MAGIC 0x15013346 +#define UFS_MAGIC 0x00011954 +#define USBDEVICE_SUPER_MAGIC 0x9fa2 +#define VXFS_SUPER_MAGIC 0xa501FCF5 +#define XENIX_SUPER_MAGIC 0x012FF7B4 +#define XFS_SUPER_MAGIC 0x58465342 +#define _XIAFS_SUPER_MAGIC 0x012FD16D + +extern int statfs(const char*, struct statfs*) __nonnull((1, 2)); +extern int fstatfs(int, struct statfs*) __nonnull((2)); + +__END_DECLS + +#endif /* _SYS_VFS_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/vt.h b/9/platforms/android-19/arch-arm64/usr/include/sys/vt.h new file mode 100644 index 0000000..b37a869 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/vt.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <linux/vt.h> diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/wait.h b/9/platforms/android-19/arch-arm64/usr/include/sys/wait.h new file mode 100644 index 0000000..b30b7ec --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/wait.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_WAIT_H_ +#define _SYS_WAIT_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <sys/resource.h> +#include <linux/wait.h> +#include <signal.h> + +__BEGIN_DECLS + +#define WEXITSTATUS(s) (((s) & 0xff00) >> 8) +#define WCOREDUMP(s) ((s) & 0x80) +#define WTERMSIG(s) ((s) & 0x7f) +#define WSTOPSIG(s) WEXITSTATUS(s) + +#define WIFEXITED(s) (WTERMSIG(s) == 0) +#define WIFSTOPPED(s) (WTERMSIG(s) == 0x7f) +#define WIFSIGNALED(s) (WTERMSIG((s)+1) >= 2) + +extern pid_t wait(int *); +extern pid_t waitpid(pid_t, int *, int); +extern pid_t wait3(int *, int, struct rusage *); +extern pid_t wait4(pid_t, int *, int, struct rusage *); + +/* Posix states that idtype_t should be an enumeration type, but + * the kernel headers define P_ALL, P_PID and P_PGID as constant macros + * instead. + */ +typedef int idtype_t; + +extern int waitid(idtype_t which, id_t id, siginfo_t *info, int options); + +__END_DECLS + +#endif /* _SYS_WAIT_H_ */ diff --git a/9/platforms/android-19/arch-arm64/usr/include/sys/xattr.h b/9/platforms/android-19/arch-arm64/usr/include/sys/xattr.h new file mode 100644 index 0000000..39b25b1 --- /dev/null +++ b/9/platforms/android-19/arch-arm64/usr/include/sys/xattr.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_XATTR_H_ +#define _SYS_XATTR_H_ + +#include <sys/types.h> + +__BEGIN_DECLS + +#define XATTR_CREATE 1 +#define XATTR_REPLACE 2 + +extern int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); +extern int setxattr(const char *path, const char *name, const void *value, size_t size, int flags); +extern int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); + +extern ssize_t fgetxattr(int fd, const char *name, void *value, size_t size); +extern ssize_t getxattr(const char *path, const char *name, void *value, size_t size); +extern ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size); + +extern ssize_t listxattr(const char *path, char *list, size_t size); +extern ssize_t llistxattr(const char *path, char *list, size_t size); +extern ssize_t flistxattr(int fd, char *list, size_t size); + +extern int removexattr(const char *path, const char *name); +extern int lremovexattr(const char *path, const char *name); +extern int fremovexattr(int fd, const char *name); + +__END_DECLS + +#endif /* _SYS_XATTR_H_ */ |