Properly detect timeout in pthread_mutex_lock_timeout_np_impl

Previously we were checking against a positive errno which
would not be returned from a system call.

Change-Id: I8e3a36f6fbf5ccc2191a152a1def37e2d6f93124
Small style cleanup.

Change-Id: Ib45a4a2296232968296f9bd7cc3592ba46fd412d

Conflicts:
	libc/bionic/pthread_cond.cpp
Clean up more recursive FORTIFY_SOURCE calls

Don't use FORTIFY_SOURCE on functions which implement
FORTIFY_SOURCE, to avoid infinite recursion problems.

The previous patch only addressed one of the problems.

Bug: 12216860
Change-Id: I6f30ae7cb5b481be9942add18182ea4839d348a6
We actually have modfl.

Change-Id: I22bb4d14f99a418819f2941c2dfec49094807c5f

Conflicts:
	libm/fake_long_double.c
Add C linkage for __open_2 and __openat_2.

Otherwise Clang mangle them with C++ names.

Change-Id: I844e28d834df8b0752b32d2aadd2013fc8804a43

Conflicts:
	libc/bionic/open.cpp
Don't abort in stdio.getdelim_invalid and stdio.getline_invalid.

Change-Id: Ie1aefed732f4bea77887bddd1be9a0578e247aa3
Add __popcountsi2 to the function compat list.

This is needed if we use Clang to compile Bionic, which won't include
__popcountsi2 anymore as Clang generates inline instructions. However
prebuilt binary blobs still depend on libc.so to resolve __popcountsi2.

Change-Id: I9001a3884c4be250c0ceebcd79922783fae1a0b7
Don't force O_LARGEFILE on LP64.

aarch64's strace is confused by this, and it isn't necessary anyway.

Change-Id: Ib07b649eb1c38ff0296003874f73af78c47bc276

Conflicts:
	libc/bionic/open.cpp
Allow GCC-built fortified code to run on a clang-built bionic.

Even though code built with clang won't be fully fortified
and won't contain calls to our various helpers, binaries built
with GCC will.

Change-Id: I389b2f1e22a3e89b22aadedc46397bf704f9ca79
Fix backwards compatible system property structure

The original structure included four reserved 32-bit values. This
change adds these back into the structure so that the
__system_property_find_compat function will (again) process the system
properties correctly.
Allocate additional space on stack for indirect syscall

The caller is only required to allocate 16 bytes on the
stack for a0-a3. syscall is handling up to 6 arguments so
additional space is needed on the stack to avoid corrupting the
callers frame.

Change-Id: I054b31696decc3e17d9c70af18cd278b852235d1

Conflicts:
	libc/arch-mips/bionic/syscall.S
Define fsid_t as well as __fsid_t.

Change-Id: Ib8efbd913a0e6bfe27b88c1342bd5cec926dd74e

Conflicts:
	libc/include/sys/vfs.h
Add SWAP_FLAG_* constants to <sys/swap.h>.

Bug: 9336527
Change-Id: I679be4d8425ba177dd782e714f465caf9daa976c
<fcntl.h> should get you the POSIX_FADV_* constants.

Change-Id: I9de8b840570b228308c12d72b7617b8758237fb8
<sched.h> should offer both __sched_priority and sched_priority.

If glibc hadn't already done things this way round, I'd have
called the field sched_priority and the macro __sched_priority
since that would seem less likely to cause trouble, but glibc
source compatibility is probably more important.

Change-Id: I8a8a477f2aa87cae641069c5c84b4fcab3152a82

Conflicts:
	libc/include/sched.h
We shouldn't have a <sys/dirent.h> that's a subset of <dirent.h>.

glibc has no <sys/dirent.h>. If we do have to bring this back, we
should probably just have one file #include the other.

Change-Id: I5c0bf9c03769daf3b23f69778e9f01f81c3de9ec
Add <sgidefs.h>.

Change-Id: I543d502a81dcb8d5969f814b8a9a9c819bc4fa2c
Add NT_PRSTATUS to <elf.h>.

Needed by aarch64.

Bug: 12476126
Change-Id: I7764664459a06cf4f2a60e707bd968d321a78430

Conflicts:
	libc/include/elf.h
Add extra libc stubs for mntent related functions.

This adds stubs for setmntent() and endmntent().

Change-Id: I6ccaa044145405cd7226c1c54a25d435c96a2308
Add some more headers.

This patch adds trivial implementations of the missing sys headers
needed by strace. All strace needs are the constants and structures,
so this is enough for now. We can come back and add the functions
if/when we ever need them.

Change-Id: Idb87c1a8b6b1c62f6e16ae94f147e1169722b48e