Commit graph

743 commits

Author SHA1 Message Date
Calin Juravle
9e8a8dc18c Merge "Remove ALIGNBYTES and ALIGN from <sys/param.h>" 2014-03-24 12:11:30 +00:00
Calin Juravle
c20de90287 Remove ALIGNBYTES and ALIGN from <sys/param.h>
There are only three users of bionic definition of ALIGN and keeping it
in sys/param.h polutes the namespace.

I inline the definition in the the three places that's used.

Bug: 13400663
Change-Id: I565008e8426c38ffb07422f42cd8e547d53044e9
2014-03-21 09:59:34 +00:00
Nick Kralevich
7eb28b59c7 FORTIFY_SOURCE: don't define s?printf macros if already defined
Clang specific: Don't #define sprintf and snprintf macros if they
are already defined.

Change-Id: I30fc507d898377e1b8a57a65a147926229e0f9e2
2014-03-18 17:03:38 -07:00
Elliott Hughes
205c7887ad Clean up reentrancy cruft.
The DNS copy of reentrant.h was unused, so remove it.

The strtod implementation can use the upstream-netbsd reentrant.h and
get a little closer to what was then upstream. (It's since been replaced
by gdtoa, and we'll have to follow at some point, but for now this doesn't
make anything any worse.)

ANDROID_CHANGES is (now) only used in the DNS code, so push the -D
down.

The <locale.h> change prevents an LP32 hack from leaking into LP64.

Change-Id: Idf30b98a59d7ca8f7c6cd6d07020b512057911ef
2014-03-13 16:17:43 -07:00
Elliott Hughes
f2cea021ab Clean up <stdio.h> macros.
Also neuter __isthreaded.

We should come back to try to hide struct FILE's internals for LP64.

Bug: 3453512
Bug: 3453550
Change-Id: I7e115329fb4579246a72fea367b9fc8cb6055d18
2014-03-13 14:54:53 -07:00
Elliott Hughes
5a8173860d Ensure we always have symbols for atof, strtof, strtold.
We'll need a better implementation of strtold for LP64, but all our
long double functions are currently broken for LP64 anyway so this
isn't a regression.

Change-Id: I2bdebac11245d31521d5fa09a16331c03dc4339c
2014-03-12 16:12:57 -07:00
Elliott Hughes
2282e16d76 Merge "Use [u]int32_t instead of __[u]int32_t in sys/types.h" 2014-03-12 20:48:39 +00:00
Pavel Chupin
2725ca95b2 Use [u]int32_t instead of __[u]int32_t in sys/types.h
Avoid this error in -ffreestanding mode:
sys/types.h:45:1: error: unknown type name '__uint32_t'

Change-Id: I826b36873862d1d70b47401f31f4369a77666b8e
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-03-13 00:23:43 +04:00
Elliott Hughes
8d4b5849f2 Clean up our termios implementation.
It's safe to fix our constant definitions because we know we never
had symbols before, so can't be passing the bad old constants to the new
functions, or the correct new constants to the old inlines.

Change-Id: I858fc680df39bdd3ba471e867833bdfa71f6224e
2014-03-11 19:13:25 -07:00
Elliott Hughes
cccfe1e17c Reimplement clock(3) and switch to OpenBSD time(3).
The new implementation is a better approximation to the processor time used
by the process because it's actually based on resource usage rather than just
elapsed wall clock time.

Change-Id: I9e13b69c1d3048cadf0eb9dec1e3ebc78225596a
2014-03-11 13:37:11 -07:00
Calin Juravle
a4eafa6dbc Removed pthread_attr_getstackaddr/pthread_attr_setstackaddr
Moved existing definitions to ndk_cruft to preserve NDK compatibility.

Bug: 13281069
Change-Id: I6f260de69afa55a6274f0d13145c19ac6517b9d5
2014-03-11 10:44:36 +00:00
Elliott Hughes
247dc91889 Take ownership of various simple syscall wrappers.
None of these trivial functions is something we're going to get from BSD.

Change-Id: Iee1d1281b73db67da5ec303da7a49748121464bf
2014-03-10 17:17:01 -07:00
Elliott Hughes
152b9de19a Remove non-standard memswap.
Change-Id: I06548dda339987b755ef7139c590ca3e1f9fe0a9
2014-03-10 15:54:40 -07:00
Elliott Hughes
333e2ae87d Merge "Add si_timerid to <signal.h>." 2014-03-08 00:52:02 +00:00
Elliott Hughes
4d46c94031 Merge "Rewrite the POSIX timer functions." 2014-03-08 00:50:56 +00:00
Elliott Hughes
4b558f50a4 Rewrite the POSIX timer functions.
This is a much simpler implementation that lets the kernel
do as much as possible.

Co-authored-by: Jörgen Strand <jorgen.strand@sonymobile.com>
Co-authored-by: Snild Dolkow <snild.dolkow@sonymobile.com>
Change-Id: Iad19f155de977667aea09410266d54e63e8a26bf
2014-03-07 16:49:46 -08:00
Elliott Hughes
a0cd9bc339 Add si_timerid to <signal.h>.
The kernel uses the very misleading name "si_tid", but glibc uses the more
intention-revealing "si_timerid". We should let people use that.

(Added because I wanted to improve SI_TIMER siginfo_t dumping in strace.)

Change-Id: Ib626cdd3b57a6afb276a15753a237b4e81ec45e3
2014-03-07 15:41:25 -08:00
Calin Juravle
d9ba757ef4 Merge "Sync up nameser with upstream(2014.03.05)" 2014-03-07 11:45:58 +00:00
Calin Juravle
fcb502e3ec Sync up nameser with upstream(2014.03.05)
Bug: 13219633

Change-Id: I8ee4ddf270710e9eea415fa3db984af7719a8dd4
2014-03-06 18:36:43 +00:00
Narayan Kamath
252ee1e112 Stop defining HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC.
No code is using this definition.

Change-Id: I188db63f38d62baf1cb57d0a36fcda540ad98492
2014-03-05 13:19:10 +00:00
Elliott Hughes
0e714a5b41 Implement POSIX pthread_mutex_timedlock.
This replaces the non-standard pthread_mutex_lock_timeout_np, which we have
to keep around on LP32 for binary compatibility.

Change-Id: I098dc7cd38369f0c1bec1fac35687fbd27392e00
2014-03-04 10:27:58 -08:00
Calin Juravle
569fb9887d Moved nameser.h and namser_compat.h to public include dir
This is part of the upstream sync (Net/Open/Free BSDs expose the
nameser.h in their public headers).

Change-Id: Ib063d4e50586748cc70201a8296cd90d2e48bbcf
2014-03-04 15:07:07 +00:00
Narayan Kamath
51e6cb33e3 Implement pthread_condattr_{get,set}clock.
We only support CLOCK_REALTIME and CLOCK_MONOTONIC for now,
so we us a single bit from pthread_cond_t->value to denote
the clock type. Note that this reduces the width of the counter
to 30 bits, but this should be large enough for all practical
purposes.

bug: 13232338

Change-Id: I857e7da64b3ecbb23eeac7c9f3fbd460f60231bd
2014-03-04 11:17:13 +00:00
Elliott Hughes
e4ab19c67d Remove deprecated and unused constants from <sys/klog.h>.
Change-Id: I23d54b5eaf918859480f927534a3f9e3af602311
2014-03-03 10:57:28 -08:00
Elliott Hughes
a8b1eb3fcf Fix build.
Change-Id: I71cde79263d5f5a8382865b8151f65c5c05ea17b
2014-02-28 17:59:29 -08:00
Elliott Hughes
2ec592c338 Merge "Add recvmmsg and sendmmsg syscalls." 2014-03-01 01:14:23 +00:00
Elliott Hughes
692207eb45 Add getprogname/setprogname for BSD compatibility.
This is one less change we have to make when porting BSD code.

Bug: https://code.google.com/p/android/issues/detail?id=34898
Change-Id: If9b1a8d16996c7a19abcce8d3a456afc3e105a41
2014-02-28 16:23:27 -08:00
Guillaume Ranquet
6ff0c75c83 Add recvmmsg and sendmmsg syscalls.
Also add the corresponding constant, struct, and function declarations
to <sys/socket.h>, and perfunctory tests so we know that the symbols
actually exist.

Signed-off-by: Guillaume Ranquet <guillaumex.ranquet@intel.com>
Change-Id: Ib0d854239d3716be90ad70973c579aff4895a4f7
2014-02-27 14:29:01 -08:00
Elliott Hughes
3434727b3e Ensure that <fcntl.h> has the SYNC_FILE_RANGE_* constants.
Needed to build strace at their tip of tree.

Change-Id: I64db00a332088e08e25bc30357293a9308b8a226
2014-02-26 15:51:01 -08:00
Elliott Hughes
5c7816f425 Merge "More OpenBSD cleanup (primarily string)." 2014-02-25 21:41:48 +00:00
Calin Juravle
a92b57c7f8 Merge "Added ftw64, nftw64" 2014-02-25 10:44:26 +00:00
Calin Juravle
7c1efffc24 Merge "Added mkstemp64" 2014-02-25 10:43:31 +00:00
Elliott Hughes
53e43292aa More OpenBSD cleanup (primarily string).
This patch removes the string/ and wchar/ directories.

Change-Id: Ia489904bc67047e4bc79acb1f3eec21aa3fe5f0d
2014-02-24 18:02:05 -08:00
Elliott Hughes
0e44bc3bae Remove <asm/page.h>.
If we have PAGE_SIZE/PAGESIZE, POSIX says they should be in <limits.h>.

Change-Id: I3c2d574ea2aea81f524874a156361411a4ffa18e
2014-02-24 15:55:31 -08:00
Calin Juravle
d4934a70e6 Added ftw64, nftw64
Bug: 13076637
Change-Id: I5b926526f935b00bba14c2807b61d85f95089c33
2014-02-24 20:22:11 +00:00
Calin Juravle
fe317a3775 Added mkstemp64
Bug: 13076637
Change-Id: I41bf28ab3e6c7325470781e9323eeec023483df5
2014-02-24 20:19:19 +00:00
Narayan Kamath
c9ae21a5c3 Move system_properties over to C++.
This change constitutes the minimum amount of
work required to move the code over to C++, address
compiler warnings, and to make it const correct and
idiomatic (within the constraints of being called
from C code).

bug: 13058886

Change-Id: Ic78cf91b7c8e8f07b4ab0781333a9e243763298c
2014-02-24 10:45:35 +00:00
Elliott Hughes
9150dfb1c6 Merge "Clean up our OpenBSD usage." 2014-02-21 23:46:52 +00:00
Elliott Hughes
0133944b09 Clean up our OpenBSD usage.
Also undo some of the mess where we have OpenBSD <stdio.h> but a mix of
different BSD's implementations.

In this first pass, I've only moved easy OpenBSD stuff.

Change-Id: Iae67b02cde6dba9d8d06fedeb53efbfdac0a8cf6
2014-02-21 14:30:18 -08:00
Calin Juravle
da030de702 Fixed int fast types for LP64
Bug: 13110474
Change-Id: Id5591603ad4ba7e149c0852f4abb25e4e5a5d065
2014-02-21 16:27:21 +00:00
Elliott Hughes
6b5559315d Use uid_t and gid_t for st_uid and st_gid in struct stat.
Change-Id: Ide62dc714d76d881e3aa79e7a59ee6533a23dd00
2014-02-18 16:43:31 -08:00
Elliott Hughes
db1ea34748 Implement some of the missing LFS64 support.
This gives us:

* <dirent.h>
  struct dirent64
  readdir64, readdir64_r, alphasort64, scandir64

* <fcntl.h>
  creat64, openat64, open64.

* <sys/stat.h>
  struct stat64
  fstat64, fstatat64, lstat64, stat64.

* <sys/statvfs.h>
  struct statvfs64
  statvfs64, fstatvfs64.

* <sys/vfs.h>
  struct statfs64
  statfs64, fstatfs64.

This also removes some of the incorrect #define hacks we've had in the
past (for stat64, for example, which we promised to clean up way back
in bug 8472078).

Bug: 11865851
Bug: 8472078
Change-Id: Ia46443521918519f2dfa64d4621027dfd13ac566
2014-02-18 15:39:24 -08:00
Elliott Hughes
671e236d5f Restore sys_signame for LP64.
mksh is using this, and we probably build as much BSD source as glibc source.

Change-Id: I400d255a67f9614ca9e57090e3a2e49d2b10cba4
2014-02-12 19:04:27 -08:00
Elliott Hughes
aa0ebdafc7 Clean up sys_signame and sys_siglist a little.
We don't need quite so much duplication because we already have a way
to get the signal number from its name, and that already copes with the
fact that the mips/mips64 numbers are different from everyone else's.

Also remove sys_signame from LP64. glibc doesn't have this BSD-ism.

Change-Id: I6dc411a3d73589383c85d3b07d9d648311492a10
2014-02-12 17:09:25 -08:00
Elliott Hughes
199346a2ab Fix NSIG.
Our sigset_t definition hasn't been tied to our NSIG definition since we
switched to uapi headers, so we can now fix it without breaking the LP32 ABI.
The kernel uapi headers define and use _NSIG, so we need to have our scripts
rename the kernel's definitions out of the way, then we can define _NSIG
and NSIG in terms of the kernel's off-by-one value.

Bug: 12938442
Change-Id: Ic7c86fd5be5ad1d822f7b2b1d88c8a0d70a1ac0f
2014-02-11 22:16:04 -08:00
Elliott Hughes
a6ecba4d23 Clean up cacheflush.
No cacheflush for LP64; use the GCC builtin instead. Clean up the
32-bit MIPS implementation now we no longer need to worry about
old versions of GCC.

Bug: 12924756
Change-Id: Ie23955b3ec194e226c4b2bce35b11d5e061f4753
2014-02-11 10:24:40 -08:00
Elliott Hughes
0266ae5f88 Switch <elf.h> over to linux uapi under the covers.
Remove the linker's reliance on BSD cruft and use the glibc-style
ElfW macro. (Other code too, but the linker contains the majority
of the code that needs to work for Elf32 and Elf64.)

All platforms need dl_iterate_phdr_static, so it doesn't make sense
to have that part of the per-architecture configuration.

Bug: 12476126
Change-Id: I1d7f918f1303a392794a6cd8b3512ff56bd6e487
2014-02-10 18:22:24 -08:00
Elliott Hughes
3a9c5d66dc Fix <link.h>.
Also move some of the stuff that should be in <link.h> out of the
private "linker.h", to make it clearer that these are public API
known to gdb that we can't change.

Bug: 12554197
Change-Id: I830e1260d3d8b833ed99bc1518f1c6b6102be8af
2014-02-10 13:31:13 -08:00
Elliott Hughes
ebd90b9ba9 Fix socklen_t (on LP64 only).
Too late to fix LP32 :-(

Bug: 12935461
Change-Id: Ib056ca1eaf9ae8712f88ae21ff94e91b08cf588b
2014-02-07 16:50:55 -08:00
Elliott Hughes
c16a453291 Merge "Remove <sys/_types.h>." 2014-02-08 00:23:50 +00:00
Elliott Hughes
9f87a0b285 Remove <sys/_types.h>.
Bug: 12213562
Change-Id: I0d10664f9da60739bdbad0408be0dd61eea3c1fe
2014-02-07 14:55:58 -08:00
Chris Dearman
645d0312c2 [MIPS64] libc/libm support
libc/libm support for MIPS64 targets

Change-Id: I8271941d418612a286be55495f0e95822f90004f
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Raghu Gandham <raghu.gandham@imgtec.com>
2014-02-06 16:22:20 -08:00
Elliott Hughes
9afe2884c7 Kill <machine/_types.h>.
Most of <machine/_types.h> was either unused, wrong, or identical across
all 32-/64-bit architectures.

I'm not a huge fan of <sys/_types.h> either, but moving the bits we need
up into there is a step forward.

Bug: 12213562
Change-Id: Id13551c78966e324beee2dd90c5575e37d2a71e6
2014-02-04 19:26:31 -08:00
Elliott Hughes
f64b8ea09d Add fallocate/fallocate64/posix_fallocate/posix_fallocate64.
Bug: 5287571
Bug: 12612860
Change-Id: I4501b9c6cdf9a830336ce0b3afc4ea716b6a0f6f
2014-02-03 16:20:46 -08:00
Elliott Hughes
8d60cc6316 Use __inline__ for fortify.
libunwind has #define inline /* empty */ which breaks our fortified headers.
glibc uses __inline but our BSD-derived headers often override that. __inline__
is the third alternative understood by GCC that -- as far as I know -- neither
the C library itself nor third-party code tries to mess with.

Bug: 12871594
Change-Id: I6677e70ea531bb7d4c46021b43af760d4ad8ecf7
2014-02-03 15:41:57 -08:00
Ross McIlroy
7b95807fa0 Add missing ucontext_t definition to bionic for arch-arm64.
Change-Id: I1ee15230c63e00f01d2063cfffcffe7f1a1eeb6a
2014-01-31 04:45:53 +00:00
Elliott Hughes
3614424e10 Make ARM <user.h> more glibc-compatible.
Change-Id: I681930ad7f80a5e7bc40eb0f36872e415445f0f9
2014-01-30 10:39:02 -08:00
Elliott Hughes
02c661b883 Add mips <sys/ucontext.h>.
Change-Id: I2821f523f0c3bb4400b2ad5d36e21e5a3d6d777c
2014-01-29 18:37:15 -08:00
Elliott Hughes
4e72fcc3c2 Add arm <sys/ucontext.h>.
Change-Id: I14d435f9e3e82f77d8a7e886ff88c18f5d09d14a
2014-01-29 17:53:59 -08:00
Elliott Hughes
677a07cb9a Add x86 <sys/ucontext.h>.
Change-Id: I43e72604f7a932f134733b78094b577415a5edb7
2014-01-29 16:46:00 -08:00
Pavel Chupin
e61d106008 Add x86_64 ucontext.h for better compatibility
As suggested here: https://android-review.googlesource.com/#/c/71267/
it may be used for x86_64 libunwind enabling.

Change-Id: I21623261a48ea7099e030d33932556e294d226ff
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-01-29 15:35:33 -08:00
Elliott Hughes
e2a292d278 Remove __STDC_FORMAT_MACROS and __STDC_LIMIT_MACROS guards (and fix SIZE_MAX for LP64).
The various committees decided that everyone should get all these macros,
all the time.

Bug: 12708004
Change-Id: Ib56010dcba9b0656e5701546fefb7f78dc0bf916
2014-01-24 16:38:07 -08:00
Vadim Markovtsev
323d4b6f68 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>
2014-01-15 07:32:52 +00:00
Elliott Hughes
ae189740de Merge "Add some more headers." 2014-01-10 23:35:47 +00:00
Elliott Hughes
c835c35727 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
2014-01-10 15:32:31 -08:00
JP Abgrall
4e9cb032d1 Add extra libc stubs for mntent related functions.
This adds stubs for setmntent() and endmntent().

Change-Id: I6ccaa044145405cd7226c1c54a25d435c96a2308
2014-01-10 01:24:34 +00:00
Elliott Hughes
33c3e8d3b2 Merge "Add NT_PRSTATUS to <elf.h>." 2014-01-09 23:53:58 +00:00
Elliott Hughes
1272dbd1d7 Add NT_PRSTATUS to <elf.h>.
Needed by aarch64.

Bug: 12476126
Change-Id: I7764664459a06cf4f2a60e707bd968d321a78430
2014-01-09 15:45:07 -08:00
Elliott Hughes
8e6bf35a16 Merge "Add <sgidefs.h>." 2014-01-09 22:24:34 +00:00
Elliott Hughes
f8b2b3c81e Fix x86 user_regs_struct.
I fixed x86-64 yesterday, but didn't fix x86 at the same time.

Change-Id: I5c081f5956dfedb9389af303369b841dd0fc1953
2014-01-09 14:01:18 -08:00
Elliott Hughes
1c2cf23a0c Add <sgidefs.h>.
Change-Id: I543d502a81dcb8d5969f814b8a9a9c819bc4fa2c
2014-01-09 13:54:49 -08:00
Elliott Hughes
a8a3178445 Add the glibc-compatible d_fileno.
d_ino is the POSIX name, but glibc also offers d_fileno, and
that's what strace is using.

Change-Id: I3fadbe7a64700b42e78c7f4631620e864d43147b
2014-01-09 12:37:12 -08:00
Elliott Hughes
0f461e35f6 Fix <sys/resource.h>.
The situation here is a bit confusing. On 64-bit, rlimit and rlimit64 are
the same, and so getrlimit/getrlimit64, setrlimit/setrlimit64,
and prlimit/prlimit64 are all the same. On 32-bit, rlimit and rlimit64 are
different. 32-bit architectures other than MIPS go one step further by having
an even more limited getrlimit system call, so arm and x86 need to use
ugetrlimit instead of getrlimit. Worse, the 32-bit architectures don't have
64-bit getrlimit- and setrlimit-equivalent system calls, and you have to use
prlimit64 instead. There's no 32-bit prlimit system call, so there's no
easy implementation of that --- what should we do if the result of prlimit64
won't fit in a struct rlimit? Since 32-bit survived without prlimit/prlimit64
for this long, I'm not going to bother implementing prlimit for 32-bit.

We need the rlimit64 functions to be able to build strace 4.8 out of the box.

Change-Id: I1903d913b23016a2fc3b9f452885ac730d71e001
2014-01-09 11:00:04 -08:00
Elliott Hughes
8276d2875f Merge "Our dirent is a dirent64." 2014-01-09 01:15:27 +00:00
Elliott Hughes
38f0ef3ff7 Our dirent is a dirent64.
Change-Id: Idc9ebfd900fddd4f7c7ac95bc9b74401ebc801a3
2014-01-08 16:31:36 -08:00
Elliott Hughes
5b17e4da39 Add <sys/reg.h>.
This describes the offsets into ptrace's returned arrays of registers
for x86 and x86-64.

Change-Id: I044f03e286673999a298b73a813d4ad366625845
2014-01-08 16:29:22 -08:00
Elliott Hughes
8a6eec38eb Merge "Fix x86_64 register names in <sys/user.h>." 2014-01-09 00:24:55 +00:00
Elliott Hughes
eddc8ece3d Fix x86_64 register names in <sys/user.h>.
Change-Id: Ieb327247a41f6195589716170e324d1cd1251b96
2014-01-08 15:54:19 -08:00
Elliott Hughes
155b076420 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
2014-01-08 15:51:13 -08:00
Elliott Hughes
4c8caf0ad3 Merge "<sched.h> should offer both __sched_priority and sched_priority." 2014-01-08 02:41:04 +00:00
Elliott Hughes
4faf76ca11 Merge "<fcntl.h> should get you the POSIX_FADV_* constants." 2014-01-08 02:40:44 +00:00
Elliott Hughes
bc4e135a8e Merge "Add SWAP_FLAG_* constants to <sys/swap.h>." 2014-01-08 02:31:55 +00:00
Elliott Hughes
65c6f3099e Add SWAP_FLAG_* constants to <sys/swap.h>.
Bug: 9336527
Change-Id: I679be4d8425ba177dd782e714f465caf9daa976c
2014-01-08 02:23:06 +00:00
Elliott Hughes
bbb34f9536 <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
2014-01-07 17:48:30 -08:00
Elliott Hughes
01e505ac9c <fcntl.h> should get you the POSIX_FADV_* constants.
Change-Id: I9de8b840570b228308c12d72b7617b8758237fb8
2014-01-07 17:47:20 -08:00
Elliott Hughes
abfc88fed7 Define fsid_t as well as __fsid_t.
Change-Id: Ib8efbd913a0e6bfe27b88c1342bd5cec926dd74e
2014-01-07 17:44:51 -08:00
Elliott Hughes
b235f8c877 Merge "Fix dev_t (for LP64)." 2014-01-06 20:37:03 +00:00
Elliott Hughes
338e6102a6 Add TCPOPT_* constants.
Adds the TCPOPT_* constants from NetBSD. Note that the BSDs also have
TCPOPT_SIGNATURE, but Linux calls that TCPOPT_MD5SIG and glibc doesn't
have any corresponding constant yet, so let's wait until we see which name
wins out.

Change-Id: If53cdada5595285d9a7e7248ef74cd7502d804c0
2014-01-03 15:58:40 -08:00
Elliott Hughes
894f8cb139 Fix dev_t (for LP64).
32-bit Android's dev_t was wrong too. We can't fix that without ABI breakage,
but we can at least fix 64-bit Android. And add tests.

Bug: https://code.google.com/p/android/issues/detail?id=54966
Change-Id: Ie2e42cc042b78b669a1a44e55f959dbd9c52c5c9
2014-01-03 14:49:37 -08:00
Elliott Hughes
887e1140fe Clean up <sched.h>.
This patch switches to using the uapi constants. It also adds the missing
setns system call, fixes sched_getcpu's error behavior, and fixes the
gensyscalls script now ARM is uapi-only too.

Change-Id: I8e16b1693d6d32cd9b8499e46b5d8b0a50bc4f1d
2014-01-02 12:05:50 -08:00
Elliott Hughes
68d89c7d65 Remove some old kernel header cruft not needed with uapi.
Change-Id: If543b056ae40f0eb660be4a0629ad22f4c4cb92f
2013-12-20 17:26:30 -08:00
Elliott Hughes
aa267685c9 Merge "Allow GCC-built fortified code to run on a clang-built bionic." 2013-12-20 02:54:56 +00:00
Elliott Hughes
b8fa5b1ca9 Fix struct stat for aarch64.
Another kernel, another struct stat.

Change-Id: Ia5ee553d4a2ffc878d2fed82a763ff64c02b12e8
2013-12-19 16:50:22 -08:00
Elliott Hughes
cd0609f4fc 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
2013-12-19 14:20:22 -08:00
Elliott Hughes
ad8842f5c6 Don't use __kernel_ulong_t.
Change-Id: Ifdfbac0ac6da647276a84bd64bb342bb5a07ad61
2013-12-18 12:22:33 -08:00
Elliott Hughes
2b333ea31e Remove <machine/kernel.h>.
Bug: 12175484
Change-Id: I127f7f91f36bd879109d653e0c56ec56e2529d4d
2013-12-18 11:21:55 -08:00
Elliott Hughes
c13fb75cea Move bionic over to GCC's 'warning' attribute.
This is a better solution than the old __warn_references because it's
a compile-time rather than link-time warning, it doesn't rely on something
that doesn't appear to be supported by gold (which is why you only used
to see these warnings on mips builds), and the errors refer to the exact
call site(s) rather than just telling you which object file contains a
reference to the bad function.

This is primarily so we can build bionic for aarch64; building libc.so
caused these warnings to fire (because link time is the wrong time) and
warnings are errors.

Change-Id: I5df9281b2a9d98b164a9b11807ea9472c6faa9e3
2013-12-17 20:43:30 -08:00
Elliott Hughes
c2f082f655 Make <sys/param.h> more glibc-like.
In particular, add MAX and MIN, needed by elfutils.

Bug: 11864683
Change-Id: I1b876732cdf68cdf5b930319e5ef5b5647586718
2013-12-12 15:31:35 -08:00
Christopher Ferris
ed45970ac5 Add cfi directives to all arm assembly.
Since the ENTRY/END macros now have .cfi_startproc/.cfi_endproc, most of the
custom arm assembly has no unwind information. Adding the proper cfi directives
for these and removing the arm directives.

Update the gensyscalls.py script to add these cfi directives for the generated
assembly. Also fix the references to non-uapi headers to the proper uapi
header.

In addition, remove the kill.S, tkill.S, tgkill.S for arm since they are not
needed at all. The unwinder (libunwind) is able to properly unwind using the
normal abort.

After this change, I can unwind through the system calls again.

Bug: 11559337
Bug: 11825869
Bug: 11321283

Change-Id: I18b48089ef2d000a67913ce6febc6544bbe934a3
2013-12-02 19:13:12 -08:00
Elliott Hughes
ab797cb4fd Finish <sys/user.h>.
Change-Id: I1d97d7fa3d5be2ff4728571ed5376705a27091ec
2013-11-26 17:57:31 -08:00