Add an optional alias list to SYSCALLS.TXT

This patch adds an optional alias list to SYSCALLS.TXT.  It is used to
create aliases for a syscall.  For x86-64, lseek64 is an alias for lseek.

Change-Id: Icb11fd2bb461ea4f5f0a26bfc585471d7d7cc468
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

Conflicts:
	libc/SYSCALLS.TXT
	libc/arch-x86_64/syscalls/lseek.S
	libc/tools/gensyscalls.py
Fix Clang warning since KernelArgumentBlock is actually a class.

Change-Id: Id72868d80feffbbc5f7d1e43beaed5d4e4d95f52
Refactor the syscall generation script.

Primarily so that the new x86_64 alias functionality is now available for
all architectures.

Change-Id: I9fde59093a1d08de98923f121a6e3d05ec5801d2

Conflicts:
	libc/tools/gensyscalls.py
Use C99 structure initializer designator style.

clang warns about using the GCC style of designator.

Change-Id: I86ec79f06c8774618082859f48d7d1f576520e32

Conflicts:
	linker/dlfcn.cpp
pthread_exit should call __NR_exit with status 0.

We shouldn't have been passing the bottom 32 bits of the address used
for pthread_join to the kernel.

Change-Id: I487e5002d60c27adba51173719213abbee0f183f

Conflicts:
	libc/arch-x86/bionic/_exit_with_stack_teardown.S
	libc/arch-x86_64/bionic/_exit_with_stack_teardown.S
	libc/bionic/pthread.c
Fix the ALIGN and ALIGNBYTES macros for LP64.

Change-Id: I3a361255afce375ab1cefa449721f0aea4d47919
Fix malloc debugging for LP64.

Change-Id: Idd0b239f5c66d45de315d556271a5d13b8eb907c

Conflicts:
	libc/bionic/malloc_debug_check.cpp
Correct the return value of setvbuf

When setting fully buffered or line buffered, if buf == NULL setvbuf
tries to allocate a buffer itself twice, fistly with the buffer size = size
(the fourth parameter) and then with the buffer size = iosize. if it succeeds
the second time, the request is be honored, so the value returned should be 0
but not EOF in this situation.

Change-Id: I981831973817cee0779b62304acdb110d11de80c
Fix clang warnings in bionic.

This fixes a few diverse issues that clang warns on in bionic. First,
it specifies the appropriate converted types for format specifiers.
The "h" and "hh" modifiers specify that the user is passing a short or
char respectively. We were passing int deliberately in both cases and
relying on the compiler to implicitly downcast to the smaller type.
We also remove the non-standard "d" suffix from our double-precision
floating point constant. This is an extension for gcc that clang does
not implement. The third fix is to mark the c1 variable as unused,
since it truly is neither read nor written.

Change-Id: I4793352b9d3e58f1f4cac9e7581ef4b2a70b43c7

Conflicts:
	tests/stack_unwinding_test_impl.c
Modify prefetch for krait memcpy.

I originally modified the krait mainloop prefetch from cacheline * 8 to * 2.
This causes a perf degradation for copies bigger than will fit in the cache.
Fixing this back to the original * 8. I tried other multiples, but * 8 is th
sweet spot on krait.

Bug: 11221806

Change-Id: I1f75fad6440f7417e664795a6e7b5616f6a29c45

Conflicts:
	libc/arch-arm/krait/bionic/memcpy_base.S
Make pthread_create report sched_setscheduler failures on LP64.

We couldn't fix this for 32-bit because there's too much broken
code out there. (Pretty much everyone asks for real-time
scheduling for all their threads, and the kernel says "don't be
stupid".)

Change-Id: I43c5271e6b6bb91278b9a19eec08cbf05391e3c4

Conflicts:
	libc/bionic/pthread_create.cpp
Remove support for the useless 'custom' option in SYSCALLS.TXT.

This cruft dates from a time when bionic would only output syscall
contants for the syscalls mentioned in SYSCALLS.TXT. I fixed that
a long time ago, but never followed through with the removal of what
was then confusingly called "stub" and was recently renamed "custom".

Change-Id: I8f3872a200b2dc8325e357cc5ee505ea4212ef95

Conflicts:
	libc/SYSCALLS.TXT
Tweaked the cleanup scripts to handle uapi and aarch64 headers.

The processed uapi directory is now placed at libc/kernel/uapi as
opposed to libc/kernel/common/uapi as it contains
architectural-dependent headers now.

Change-Id: I53f814704a4d231b452fde398cd94257a0fb2eea

Conflicts:
	libc/kernel/tools/defaults.py
Add processed uapi kernel headers (common and aarch64-specific)

Change-Id: If0be7b83bd8fe7cb02472d173f7c452aabf61124
Refresh libc/kernel/common/linux/auxvec.h

Change-Id: If9bb50a2f233cdb60e91bd979876edb917e0f66d
Build the linker with the same -std flags as the rest of bionic.

Change-Id: I5bdb28ecfdf78a90f6b072077a1c5ffd63f5d2ae

Conflicts:
	linker/Android.mk
Add SOCK_CLOEXEC and SOCK_NONBLOCK socket flags.

SOCK_CLOEXEC is used to atomically set close-on-exec flag for the new
descriptor(s), and SOCK_NONBLOCK is used to mark descriptor(s) as
non-blocking.
Add SOCK_CLOEXEC and SOCK_NONBLOCK socket flags.

SOCK_CLOEXEC is used to atomically set close-on-exec flag for the new
descriptor(s), and SOCK_NONBLOCK is used to mark descriptor(s) as
non-blocking.

Change-Id: I8ba6a70543d23759e3ddcc7ff9c21b567184d681

Conflicts:
	libc/include/sys/socket.h
<pthread.h>: Mark pthread_exit() as __noreturn

+ Mark pthread_self() as __pure2, to be more like GLibc.

Fix for: https://code.google.com/p/android/issues/detail?id=60686

Change-Id: Iac472178508d885a076575f566e558a2beeba880

Conflicts:
	libc/include/pthread.h
Fix PTHREAD_STACK_MIN definition in pthread.h

The definition of PTHREAD_STACK_MIN in pthread.h
depends on PAGE_SIZE. PAGE_SIZE is not defined
in pthread.h, so whoever wants to use PTHREAD_STACK_MIN
needs to include first asm/page.h.

Including pthread.h should be enough to have a valid
definition of PTHREAD_STACK_MIN. Including asm/page.h
in pthread.h so that PAGE_SIZE is visibile and the
definition for PTHREAD_STACK_MIN valid.

Change-Id: I8bb51ea6d5868893c2821320398a906fb033785c
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>