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
Add -Bsymbolic to the ld flags when linking the dynamic linker.

We don't need this on architectures other than aarch64, and
we're still investigating why we need it on aarch64, but it
doesn't seem unreasonable to have this flag set when linking
the dynamic linker anyway; it's clearly the intended behavior.

Change-Id: I4fa1b4ae543a818979934bf818eabac03bb9154f
Add "__noreturn" to assert and assert2

These functions should print assertion violation messages and then
call abort(). They do really not return control flow afterwards.
Consider the declaration of the similar __assert_fail from glibc:

extern void __assert_fail (const char *__assertion,
                           const char *__file,
			   unsigned int __line,
                           const char *__function)
     __THROW __attribute__ ((__noreturn__));

Bionic has __noreturn defined in sys/cdefs.h to be that GNU
noreturn attribute.

This patch has a practical value. Consider the following function:

void check(void* ptr) {
  assert(ptr != NULL);
}

Without this patch applied, gcc (and presumably clang) shows even in
debug mode:

warning: unused parameter 'ptr' [-Wunused-parameter]

In release mode, NDEBUG is defined and assert() becomes a no-op, as
one should expect. Thus, the warning is shown correctly then.

Another code sample:

float array[2];
int i = 3;
...
assert(i < 2);
array[i] = 0;

gcc says,

warning: array subscript is below array bounds [-Warray-bounds]

In other words, without noreturn attribute, assertions do not
allow a compiler's static analyzer to properly understand
the preconditions.

Change-Id: I3be92e99787c528899cf243ed448c4730c00c45b
Signed-off-by: Vadim Markovtsev <gmarkhor@gmail.com>