Commit graph

615 commits

Author SHA1 Message Date
Andrei Emeltchenko
43d2137af0 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
2013-10-17 13:32:32 -07:00
Elliott Hughes
e989399dc2 O_CLOEXEC is always defined for arm, mips, x86, and x86_64.
I built all four, just to be sure.

Change-Id: I5c818575c8142fccfc8fb163468832807a535e90
2013-10-17 11:45:22 -07:00
Elliott Hughes
c7e9b23317 Fix sigaction(3) for 64-bit.
Also clean up <signal.h> and revert the hacks that were necessary
for 64-bit in linker/debugger.cpp until now.

Change-Id: I3b0554ca8a49ee1c97cda086ce2c1954ebc11892
2013-10-17 11:36:55 -07:00
Elliott Hughes
b2386fed55 am 4346bd9f: am bffe261a: Merge "Sort the syscalls.mk files, give all generated files the same header."
* commit '4346bd9fbcfe4144df7ac0e920bdda274d523fc4':
  Sort the syscalls.mk files, give all generated files the same header.
2013-10-16 16:33:50 -07:00
Elliott Hughes
6b9321b858 am d6e117b6: am 1f29c2f5: Merge "Switch sigpending over to rt_sigpending."
* commit 'd6e117b64bdfbf8d793eb59ea9604b806608ec75':
  Switch sigpending over to rt_sigpending.
2013-10-16 16:09:42 -07:00
Elliott Hughes
103ccde8fe Sort the syscalls.mk files, give all generated files the same header.
No non-comment changes to the .S files.

Change-Id: Iafcfd004c3ea92b64268f80ab16df615b97cefac
2013-10-16 14:27:59 -07:00
Elliott Hughes
40d105ccb3 Switch sigpending over to rt_sigpending.
Change-Id: I7b28984796b5fb343cfbcc47e0afc3a84293d417
2013-10-16 14:07:01 -07:00
Stephen Hines
8161b23689 am 4691325d: am abeafbd6: Merge "Wrap sprintf()/snprintf() macros to prevent expansion errors."
* commit '4691325d48406033632fe84a944ac9c3bd2e5097':
  Wrap sprintf()/snprintf() macros to prevent expansion errors.
2013-10-11 16:33:07 -07:00
Stephen Hines
6e38072add Wrap sprintf()/snprintf() macros to prevent expansion errors.
Previously, FORTIFY_SOURCE used single macros to define these standard
functions for use with clang. This can cause conflicts with other macros used
to call these functions, particularly when those macros expand the number of
arguments to the function. This change wraps our macro definitions, so that
expansion properly takes place for programmer arguments first.

Change-Id: I55929b1fd2a643b9d14a17631c4bcab3b0b712cf
2013-10-11 12:14:49 -07:00
Nick Kralevich
49bb53c8e2 am 95de0df8: am eda2679e: Merge "FORTIFY_SOURCE: fortify read()"
* commit '95de0df8c2daeefca358010f2d15c3346a5284f1':
  FORTIFY_SOURCE: fortify read()
2013-10-09 21:28:52 -07:00
Nick Kralevich
b036b5ca36 FORTIFY_SOURCE: fortify read()
Change-Id: Ic7de163fe121db13e00560adb257331bc709814d
2013-10-09 20:17:03 -07:00
Nick Kralevich
b8771d9fd8 am b35ebe3d: am 848efa9d: Merge "Revert "FORTIFY_SOURCE: fortify read()""
* commit 'b35ebe3d7097899fd4498ebb2b93e48fd836ebcf':
  Revert "FORTIFY_SOURCE: fortify read()"
2013-10-09 16:53:05 -07:00
Nick Kralevich
8d25327639 Revert "FORTIFY_SOURCE: fortify read()"
This change reverts
* fb3f956d07.
* 65c99de2cb

Change-Id: Id5774eeede41130579115cf67a72ee914f2b47d5
2013-10-09 16:46:25 -07:00
Nick Kralevich
45e3076cdc am 731ced6b: am c147478c: Merge "FORTIFY_SOURCE: fortify read()"
* commit '731ced6b289629a552b5841561fdcccf08d8c43a':
  FORTIFY_SOURCE: fortify read()
2013-10-09 16:32:25 -07:00
Nick Kralevich
65c99de2cb FORTIFY_SOURCE: fortify read()
Change-Id: I3d7b4ec86d04efb865117ce7629a2e26917f3331
2013-10-09 13:44:38 -07:00
Elliott Hughes
e769368d76 am c8bd2c2e: am 458076c3: Merge "Fix the ALIGN and ALIGNBYTES macros for LP64."
* commit 'c8bd2c2e45c93b999a40449e4c6f44470f010367':
  Fix the ALIGN and ALIGNBYTES macros for LP64.
2013-10-08 16:15:33 -07:00
Elliott Hughes
78df45e1d1 Fix the ALIGN and ALIGNBYTES macros for LP64.
Change-Id: I3a361255afce375ab1cefa449721f0aea4d47919
2013-10-08 15:31:44 -07:00
Elliott Hughes
9258c7b23e am b7d77a9e: am 56777421: Merge "Add arch-x86_64/include/machine."
* commit 'b7d77a9eb1effd5f0472dff14a8fe77d9da2c7a2':
  Add arch-x86_64/include/machine.
2013-10-04 16:21:25 -07:00
Elliott Hughes
72645164b6 Add arch-x86_64/include/machine.
This is basically the other half of I5de76f6c46ac87779f207d568a86bb453e2414de
from Pavel Chupin <pavel.v.chupin@intel.com>, but taking the exact upstream
_types.h instead of the modified version. (I was confused when I suggested
otherwise.)

I've also cleaned up the internal_types.h situation; we weren't gaining
anything from these empty files, and there is no upstream internal_types.h
for x86_64.

Change-Id: I802a9a6a8df1c979e820659212c75a47c2ef392e
2013-10-04 16:10:13 -07:00
Nick Kralevich
6f10368926 am 2e819c58: am 2ff3c746: Merge "Check memory size on FD_* functions"
* commit '2e819c58c9396eec3e4311ef2c9bdcadd107f001':
  Check memory size on FD_* functions
2013-10-03 15:57:09 -07:00
Nick Kralevich
7943df62f7 Check memory size on FD_* functions
Make sure the buffer we're dealing with has enough room.
Might as well check for memory issues while we're here,
even though I don't imagine they'll happen in practice.

Change-Id: I0ae1f0f06aca9ceb91e58c70183bb14e275b92b5
2013-10-03 15:45:10 -07:00
Nick Kralevich
5634373320 am 8598cd68: am f741e1c2: Merge "FORTIFY_SOURCE: Add __FD_* checks"
* commit '8598cd6888366008033286113bd633b44c70b7dd':
  FORTIFY_SOURCE: Add __FD_* checks
2013-10-02 16:30:51 -07:00
Nick Kralevich
90201d5eca FORTIFY_SOURCE: Add __FD_* checks
Add FORTIFY_SOURCE checks for the following macros:

* FD_CLR
* FD_ISSET
* FD_SET

Bug: 11047121
Change-Id: I3c5952136aec9eff3288b91b1318677ff971525c
2013-10-02 16:11:30 -07:00
Nick Kralevich
944ce989f8 am f7da611b: am 00d51c9f: Merge "Use alloc_size attribute on *alloc functions"
* commit 'f7da611b3dedaf9951e08b0296daf67eda8228c0':
  Use alloc_size attribute on *alloc functions
2013-10-02 14:38:12 -07:00
Nick Kralevich
b91791d71c Use alloc_size attribute on *alloc functions
malloc and family were not declared with __attribute__((alloc_size)).
This was (sometimes) preventing FORTIFY_SOURCE related functions
from knowing the size of the buffer it's dealing with, inhibiting
FORTIFY_SOURCE protections.

Add __attribute__((alloc_size))

Information about the alloc_size attribute can be found
at http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Change-Id: Ia2f0a445f0170a7325f69259b5e7fb35a9f14921
2013-10-02 14:14:40 -07:00
Elliott Hughes
a0a5a50152 am 2e2a4f97: am 4bbf3a8b: Merge "Remove #define _BITSIZE 32."
* commit '2e2a4f97bfbb7b94d12690395c5cbcf7d7d1edc7':
  Remove #define _BITSIZE 32.
2013-10-02 10:10:27 -07:00
Elliott Hughes
5e72c513bf Remove #define _BITSIZE 32.
I've no idea what _BITSIZE was supposed to be, glibc doesn't have it,
the BSDs don't have it, and no code is currently using it. But having
it set unconditionally to 32 sounds like a bad idea.

Change-Id: I900235c1489afba891fff0bc3b43e9d593249a4f
2013-10-02 09:23:46 -07:00
Elliott Hughes
35336777f1 am 67e0214d: am 232dff3a: Merge "Regenerate the system call stubs (to get x86_64)."
* commit '67e0214d0f620df7a7928ef0fa1a9c0aac326a20':
  Regenerate the system call stubs (to get x86_64).
2013-10-01 13:59:59 -07:00
Elliott Hughes
e4ffd9f234 Regenerate the system call stubs (to get x86_64).
This touches the x86 stubs too because arm, x86, and x86_64 now
all share the same header (at a source level), which causes a
reordering of the #include lines.

Change-Id: If9a1e2b2718bd41d8399fea748bce672c513ef84
2013-10-01 13:29:43 -07:00
Elliott Hughes
d4e6961041 am 1a46de67: am f281fd02: Merge "Better statfs/fstatfs glibc compatibility."
* commit '1a46de67b3f78ce44ddf622bcf5918fe758dd4d4':
  Better statfs/fstatfs glibc compatibility.
2013-10-01 10:04:30 -07:00
Elliott Hughes
58413fe735 am 4b5a0e1a: am 693bd73f: Merge "Remove 32-bit assumptions from the ELF code."
* commit '4b5a0e1ad76d76d6a8793f61e3c0902ea4628ce7':
  Remove 32-bit assumptions from the ELF code.
2013-10-01 10:04:29 -07:00
Elliott Hughes
f281fd02e9 Merge "Better statfs/fstatfs glibc compatibility." 2013-10-01 15:30:40 +00:00
Elliott Hughes
01a700e5d2 Better statfs/fstatfs glibc compatibility.
Change-Id: I069d169c96cd71b75a045ec911fb4bd484c6b2c9
2013-09-30 21:57:07 -07:00
Elliott Hughes
5d641bcf70 am f5dcdfc4: am 6dee3b9a: Merge "Add x86_64 to the bionic headers."
* commit 'f5dcdfc438684bbe93e398b6551f915fe3fe10bf':
  Add x86_64 to the bionic headers.
2013-09-30 18:45:57 -07:00
Elliott Hughes
c620059479 Remove 32-bit assumptions from the ELF code.
Change-Id: I2c1f3d34c33685799aade8866eec44479ff9f963
2013-09-30 18:43:46 -07:00
Elliott Hughes
d3e64a3f40 Add x86_64 to the bionic headers.
Manual changes:

  cpp.py: cope with macros that refer to other macros.

  defaults.py: x86 no longer always implies __i386__; use __i386__ to replace
  the kernel CONFIG_X86_32 flag.

  asm/page.h: the upstream page.h isn't a uapi header and no longer includes
  the stuff we were using it for. Let's just have our own static file, since
  it's the same for all our architectures (both 32- and 64-bit).

  sys/select.h: we used to use the various FD_SET-related macros from the
  kernel header files, but they've gone. Adjust by adding trivial equivalent
  definitions.

Automated changes:

  libc/kernel/arch-x86, libc/kernel/common: regenerated from
  external/kernel-headers.

Change-Id: I84fc0ed52dc742e043b4ae300fd3b58ee99b7fcd
2013-09-30 18:42:13 -07:00
Elliott Hughes
b277509095 am 34284954: am 76218efb: Merge "Fix inttypes.h and stdint.h for 64-bit (and C++11)."
* commit '34284954b3b43010d87c6f99a50dc673a55fbb04':
  Fix inttypes.h and stdint.h for 64-bit (and C++11).
2013-09-30 16:23:03 -07:00
Elliott Hughes
a9a02acc9f Fix inttypes.h and stdint.h for 64-bit (and C++11).
Change-Id: I394630348413c9aafcac137ce1ca5f0a93d9ab6f
2013-09-30 14:46:47 -07:00
Nick Kralevich
cadc6aaf41 am f56e0e4b: am 6aed6077: Merge "Fix unnecessary call to __strncpy_chk2"
* commit 'f56e0e4b5e97f4e7fed6e06dde30053ea687716e':
  Fix unnecessary call to __strncpy_chk2
2013-09-27 15:18:21 -07:00
Nick Kralevich
d13c2b1ba6 Fix unnecessary call to __strncpy_chk2
If "n" is smaller than the size of "src", then we'll
never read off the end of src. It makes no sense to call
__strncpy_chk2 in those circumstances.

For example, consider the following code:

int main() {
  char src[10];
  char dst[5];
  memcpy(src, "0123456789", sizeof(src));
  strncpy(dst, src, sizeof(dst));
  dst[4] = '\0';
  printf("%s\n", dst);
  return 0;
}

In this code, it's clear that the strncpy will never read off
the end of src.

Change-Id: I9cf58857a0c5216b4576d21d3c1625e2913ccc03
2013-09-27 13:21:24 -07:00
Nick Kralevich
9a622f874c am cc362291: am 8427b745: Merge "libc: fortify recvfrom()"
* commit 'cc362291362f8183431eccb19267c8a625f36006':
  libc: fortify recvfrom()
2013-09-27 09:11:00 -07:00
Nick Kralevich
60f4f9a5b9 libc: fortify recvfrom()
Fortify calls to recv() and recvfrom().

We use __bos0 to match glibc's behavior, and because I haven't
tested using __bos.

Change-Id: Iad6ae96551a89af17a9c347b80cdefcf2020c505
2013-09-24 16:45:01 -07:00
Elliott Hughes
e74f77f92d am 48a909c9: am aad3c52e: Merge "Ensure we have the off64_t variant of every function that takes an off_t."
* commit '48a909c9fd6dbe9be5655ad172d1083fa69c4107':
  Ensure we have the off64_t variant of every function that takes an off_t.
2013-09-19 17:43:01 -07:00
Elliott Hughes
b4f7616fd6 Ensure we have the off64_t variant of every function that takes an off_t.
Change-Id: Ib2eee0cf13162be3b62559b84e90c6dcf5aab1c3
2013-09-19 16:27:24 -07:00
Elliott Hughes
a5a508a9b6 am 35cfcc11: am f8e71bac: Merge "Add mmap64()"
* commit '35cfcc11fa923c75ead9356c71466ecabfafcc42':
  Add mmap64()
2013-09-19 14:27:34 -07:00
Daniel Leung
afcc0cccda Add mmap64()
This adds mmap64() to bionic so that it is possible to have
large offset passed to kernel. However, the syscall mechanism
only passes 32-bit number to kernel. So effectively, the
largest offset that can be passed is about 43 bits (since
offset is signed, and the number passed to kernel is number
of pages (page size == 4K => 12 bits)).

Change-Id: Ib54f4e9b54acb6ef8b0324f3b89c9bc810b07281
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2013-09-19 14:11:26 -07:00
Elliott Hughes
44fd0d92d6 am 94c325fb: am 269851bf: Merge "Declare __page_shift and __page_size with C linkage."
* commit '94c325fb3bd8844dcc58640afb8f33668b684bc1':
  Declare __page_shift and __page_size with C linkage.
2013-09-19 12:06:43 -07:00
Bernhard Rosenkraenzer
9ae59c02ca Declare __page_shift and __page_size with C linkage.
__page_shift and __page_size were accidentally declared in unistd.h with
C linkage - their implementation needs to use the same linkage.

Going forward, though, let's stop the inlining madness and let's kill
the non-standard __getpageshift(). This patch takes getpagesize(3) out
of line and removes __getpageshift but fixes __page_shift and __page_size
for backwards binary compatibility.

Change-Id: I35ed66a08989ced1db422eb03e4d154a5d6b5bda
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
2013-09-19 11:55:36 -07:00
Christopher Ferris
5cb0436930 am 1a88ca08: am 98c726ec: Merge "Add the dl_iterate_phdr function to libdl for arm."
* commit '1a88ca08046ea510bfc8d3de6875537f124b3ce3':
  Add the dl_iterate_phdr function to libdl for arm.
2013-09-06 10:57:40 -07:00
Christopher Ferris
24053a461e Add the dl_iterate_phdr function to libdl for arm.
Bug: 8410085

Merge from internal master.

(cherry-picked from cb491bc66d)

Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
2013-09-06 09:53:54 -07:00
Elliott Hughes
eb31e1c558 am 1e96d49a: am afa31042: Merge "Fix strchr for basic non-sse case on x86"
* commit '1e96d49a7d4d1af8f3bd6630e4ec9369813f18e7':
  Fix strchr for basic non-sse case on x86
2013-09-03 14:07:11 -07:00
Pavel Chupin
3c4b50fd8c Fix strchr for basic non-sse case on x86
Fix source location. Move declaration of __strchr_chk out of
ifdef __BIONIC_FORTIFY which should be available for strchr.cpp
compilation when __BIONIC_FORTIFY is not defined.

Change-Id: I552a6e16656e59b276b322886cfbf57bbfb2e6a7
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-09-03 16:20:52 +04:00
Nick Kralevich
4d0fbf9b07 am 89dcc10c: am 4e3ed44d: Merge "cdefs.h: introduce __bos0"
* commit '89dcc10c320c032faef83c4940a57949ade01dba':
  cdefs.h: introduce __bos0
2013-08-28 14:36:50 -07:00
Nick Kralevich
bd8e6749b7 cdefs.h: introduce __bos0
Introduce __bos0 as a #define for __builtin_object_size((s), 0).
This macro is intended to be used for places where the standard
__bos macro isn't appropriate.

memcpy, memmove, and memset deliberately use __bos0. This is done
for two reasons:

1) I haven't yet tested to see if __bos is safe to use.
2) glibc uses __bos0 for these methods.

Change-Id: Ifbe02efdb10a72fe3529dbcc47ff647bde6feeca
2013-08-28 14:27:14 -07:00
Nick Kralevich
2c87c3ff02 am cfd0d72d: am eb8f3622: Merge "FORTIFY_SOURCE: introduce __strncpy_chk2"
* commit 'cfd0d72da8641087f9c4015ee586614da9f7320a':
  FORTIFY_SOURCE: introduce __strncpy_chk2
2013-08-28 13:07:57 -07:00
Nick Kralevich
93501d3ab8 FORTIFY_SOURCE: introduce __strncpy_chk2
This change detects programs reading beyond the end of "src" when
calling strncpy.

Change-Id: Ie1b42de923385d62552b22c27b2d4713ab77ee03
2013-08-28 12:39:06 -07:00
Elliott Hughes
34cd499875 am fd61eccf: am ff9b7aa6: Merge "Make ctype.h a little less unhygienic."
* commit 'fd61eccf6b909ee6374ad43164f0e9bcd4b3547c':
  Make ctype.h a little less unhygienic.
2013-08-13 14:45:44 -07:00
Elliott Hughes
5e9b20f721 Make ctype.h a little less unhygienic.
This caused trouble for stlport.

Change-Id: Id40787c5a2b7a3a4e12fb557efe549778a01cbbd
2013-08-13 14:30:59 -07:00
Elliott Hughes
c1772397f9 am ff8dcd4a: am c933493a: Merge "Fix our missing abs/labs/llabs/imaxabs (and imaxdiv) symbols."
* commit 'ff8dcd4a1056257b454da71e1ea1371bb73d3a79':
  Fix our missing abs/labs/llabs/imaxabs (and imaxdiv) symbols.
2013-08-12 14:28:52 -07:00
Elliott Hughes
aec2ffbc5a Fix our missing abs/labs/llabs/imaxabs (and imaxdiv) symbols.
Change-Id: I94c411c22634e43184445c82e7388e51fc46a8cc
2013-08-12 12:07:05 -07:00
Elliott Hughes
840a114eb1 Add futimens.
(cherry picked from commit d0be7c8f9a)

Bug: 10239370
Change-Id: I0087e85a94d83b6ce68ec6a0768c44cbe4bd0132
2013-08-08 17:52:06 -07:00
Elliott Hughes
d0be7c8f9a Add futimens.
Bug: 10239370
Change-Id: I518340084103dc339ef8a065d4837d6258a1381d
2013-08-08 17:13:33 -07:00
Elliott Hughes
e66ffef900 am cd927519: Merge "Fix stdint.h intptr_t/uintptr_t for x86_64/x32"
* commit 'cd927519a94939f2ebc307544f827baade529bc9':
  Fix stdint.h intptr_t/uintptr_t for x86_64/x32
2013-08-05 15:51:54 -07:00
Elliott Hughes
28e0ec8d61 am a0473d77: Merge "syslog needs a valid socket path for _PATH_LOG"
* commit 'a0473d77b2d3a6f26e29cc8c2fdaeb2a4b3ab8f8':
  syslog needs a valid socket path for _PATH_LOG
2013-08-05 15:51:53 -07:00
Elliott Hughes
cd927519a9 Merge "Fix stdint.h intptr_t/uintptr_t for x86_64/x32" 2013-08-05 20:55:24 +00:00
Elliott Hughes
a0473d77b2 Merge "syslog needs a valid socket path for _PATH_LOG" 2013-08-05 20:41:50 +00:00
Pavel Chupin
0a9c615a89 Fix stdint.h intptr_t/uintptr_t for x86_64/x32
Patch is required in NDK headers as well to be able to build multilib
GCC with libgomp support.
It's here: https://android-review.googlesource.com/#/c/62982

Change-Id: I2bec25d8cbca0e5ef1a0857008ececd92f4911be
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-08-02 19:23:37 +04:00
Elliott Hughes
abf3638317 am 101b5e1f: Merge "Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way."
* commit '101b5e1f6cc4e24635760928b3d2c1e51c1e5774':
  Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way.
2013-07-29 17:35:49 -07:00
Elliott Hughes
c03e1e7439 Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way.
Also make sysconf use PTHREAD_STACK_MIN rather than redefining its
own, different, constant.

Bug: 9997352
Change-Id: I9a8e7d2b18e691439abfb45533e82c36eee9e81d
2013-07-29 17:09:36 -07:00
Elliott Hughes
47c7e33ccb am ff20b911: am 8a363692: Merge "Add TCP_INFO state enum values."
* commit 'ff20b9110659e67433ce641a6224cdc9ccc01301':
  Add TCP_INFO state enum values.
2013-07-11 18:57:42 -07:00
Nick Kralevich
4fa5d6a5db am ef49e99d: am d30877ae: Merge "syslog.h: add __printflike to syslog functions"
* commit 'ef49e99d92597a4e9fddbba0e1e3feddc06fee53':
  syslog.h: add __printflike to syslog functions
2013-07-11 18:57:41 -07:00
Elliott Hughes
ff20b91106 am 8a363692: Merge "Add TCP_INFO state enum values."
* commit '8a363692be45ed1b36e1f1f21707b6f35f5519c8':
  Add TCP_INFO state enum values.
2013-07-11 18:52:22 -07:00
Nick Kralevich
ef49e99d92 am d30877ae: Merge "syslog.h: add __printflike to syslog functions"
* commit 'd30877ae28f3c308edf142c091b3a8acc4467c6d':
  syslog.h: add __printflike to syslog functions
2013-07-11 18:52:01 -07:00
Elliott Hughes
0dff43cab4 Add TCP_INFO state enum values.
Bug: https://code.google.com/p/android/issues/detail?id=38881
Change-Id: Ie22816c666474e6441e0ec3afd2a6eb04d64a673
2013-07-11 16:21:32 -07:00
Geremy Condra
bb17967761 Merge "Add marking of DNS sockets for mark based routing" 2013-07-11 22:10:31 +00:00
Nick Kralevich
6b1dd1797e syslog.h: add __printflike to syslog functions
Allow the compiler to detect formating bugs.

Change-Id: I6a4af6cae59dc3adf14b075431a41885213a649a
2013-07-10 07:37:11 -07:00
Elliott Hughes
731f7c2d0e am 9d476716: Merge "Add <sys/statvfs.h>."
* commit '9d476716c2bd7bc5a018a71e121257c35e965058':
  Add <sys/statvfs.h>.
2013-07-09 13:44:57 -07:00
Elliott Hughes
06040fd75c Add <sys/statvfs.h>.
Bug: 2512019
Change-Id: I6e7fd3fa281977cc4bc270481a95416b5b2dc351
2013-07-09 13:25:03 -07:00
Chad Brubaker
c39214e0ac Add marking of DNS sockets for mark based routing
Adds an extra mark parameter to android_getaddrinfoforiface,
android_gethostbyaddrforiface and android_gethostbynameforiface that if set
will cause all packets sent by DNS requests to have that mark

Change-Id: I6f72390e4ce5bfc3cc73183f9b2fb3705a11685f
2013-07-09 13:16:22 -07:00
Elliott Hughes
f3f72e7f27 am 4fc8a0c1: Merge "Remove <netinet/icmp6.h> ni_* macros."
* commit '4fc8a0c1165537b693c900ac3e2c61470bd7e484':
  Remove <netinet/icmp6.h> ni_* macros.
2013-07-08 15:09:07 -07:00
Elliott Hughes
c2cd33efc4 Remove <netinet/icmp6.h> ni_* macros.
glibc doesn't have these, and they prevent ping from building out of
the box because it assumes it can define them.

Bug: 9671560
Change-Id: I815f2a9c4fd96a0ea2952eb5a71ddf51e0763660
2013-07-08 15:07:41 -07:00
Elliott Hughes
233050b15e am e31c45c9: Merge "Make bionic\'s <netinet/icmp6.h> standalone, like glibc\'s."
* commit 'e31c45c9fa5e0d2853941282e619b753550b82ae':
  Make bionic's <netinet/icmp6.h> standalone, like glibc's.
2013-07-08 11:21:53 -07:00
Elliott Hughes
3a040d8379 Make bionic's <netinet/icmp6.h> standalone, like glibc's.
This removes the need for a bionic-specific hack in external/iproute2.

Bug: 9671560
Change-Id: I9f15be0711d26bca863bd66be9a39606500fb948
2013-07-08 11:16:24 -07:00
Elliott Hughes
62bdd03120 am 6b33f31b: Merge "Fix IPv6 filtering definitions in netinet/icmp6.h."
* commit '6b33f31b0994b8132bed8936685522e2e01754d8':
  Fix IPv6 filtering definitions in netinet/icmp6.h.
2013-07-08 10:34:41 -07:00
Lorenzo Colitti
bfc6a59556 Fix IPv6 filtering definitions in netinet/icmp6.h.
Linux and *BSD kernels use opposite values to indicate pass/block
in ICMPv6 filters, and assign a different value to the
ICMP6_FILTER sockopt.

Bug: 9671560
Bug: 9469682
Change-Id: Ic0f1fcd48891add992acf97632f60aebd172c1d7
2013-07-08 10:31:29 -07:00
Elliott Hughes
24400ac1e3 am e63ea6ac: Merge "Clean up <sys/mount.h>/<linux/fs.h> duplication."
* commit 'e63ea6aca7d01ba9219b877ed5fab6de5c6037fb':
  Clean up <sys/mount.h>/<linux/fs.h> duplication.
2013-07-08 10:12:32 -07:00
Elliott Hughes
e42e51d563 Clean up <sys/mount.h>/<linux/fs.h> duplication.
Roll on uapi...

Bug: 6340120
Change-Id: Ic9521905683946e836574e4d768e34853ea777fa
2013-07-03 14:58:04 -07:00
Elliott Hughes
a8b954c51e am de2781d9: Merge changes I01345c23,I3b57517c
* commit 'de2781d906f27be4df3e03a8e5041dcc1aeb281d':
  Include linux/termios.h from sys/ioctl.h.
  Update linux/types.h to linux 2.6.20.
2013-07-03 13:39:16 -07:00
Lorenzo Colitti
f936ef1a9f Include linux/termios.h from sys/ioctl.h.
On NetBSD and glibc, including sys/ioctl.h provides some
terminal ioctl data structures such as struct winsize. For
compatibility, provide these via sys/ioctl.h in bionic as well.
bionic does not have its own definitions for these structures, so
get them from the Linux kernel definitions.

Change-Id: I01345c23c0bebd60b0a80fc33668e7c0ad7356c3
2013-07-03 13:35:18 -07:00
Elliott Hughes
833dc584d4 am 87b4286f: Merge "Expose dn_comp and dn_expand to system C code."
* commit '87b4286f092094a2e8069a06e20ef5036a258172':
  Expose dn_comp and dn_expand to system C code.
2013-07-02 16:02:30 -07:00
Lorenzo Colitti
b8e435c1d5 Expose dn_comp and dn_expand to system C code.
This is needed to compile open-source code that wants to
expand/compress domain names itself, such as ping6.

Bug: 9469682
Change-Id: I339c6538936d05c031bc6fb0a8793aaf1429dea4
2013-07-02 15:57:57 -07:00
Elliott Hughes
7c808b29d5 am feec97a7: Merge "Fix inttypes.h PRI?PTR and SCN?PTR macros."
* commit 'feec97a7c7fbd032174fb4870a02422c2acd891a':
  Fix inttypes.h PRI?PTR and SCN?PTR macros.
2013-07-02 15:44:48 -07:00
Elliott Hughes
74f0833df6 Fix inttypes.h PRI?PTR and SCN?PTR macros.
Our intptr_t and uintptr_t aren't "long". Add a compilation test so we remember
to fix this to cope with 32- and 64-bit later.

Bug: http://code.google.com/p/android/issues/detail?id=57218
Change-Id: I2f816d339edb4f7d57e4418b818fb4c602093f38
2013-07-02 15:35:27 -07:00
Elliott Hughes
dcd237a897 am 1ba3a2c2: Merge "Update icmp6.h to current NetBSD."
* commit '1ba3a2c26937c68a4a0bd4fdffe95f5162077997':
  Update icmp6.h to current NetBSD.
2013-07-02 12:34:36 -07:00
Lorenzo Colitti
ce7c404dc7 Update icmp6.h to current NetBSD.
This adds a few bits we need such as RFC 6106 support and the
definition of MLD_LISTENER_REDUCTION.

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet/icmp6.h?rev=1.47

Bug: 9469682
Change-Id: I97a4c2f0893012ce315334367c055097d0f8bb10
2013-07-02 09:38:59 -07:00
Nick Kralevich
28d298a673 am 413eef71: Merge "More FORTIFY_SOURCE functions under clang"
* commit '413eef716f822d5eb4f57618f6780c6af5036460':
  More FORTIFY_SOURCE functions under clang
2013-07-01 10:00:09 -07:00
Nick Kralevich
a6cde39276 More FORTIFY_SOURCE functions under clang
* bzero
* umask
* strlcat

Change-Id: I65065208e0b8b37e10f6a266d5305de8fa9e59fc
2013-06-29 08:16:22 -07:00
Nick Kralevich
f9ef0106da am 78a7bf99: Merge "stdio.h: enable vs?printf clang FORTIFY_SOURCE"
* commit '78a7bf998d2d29592504984fcf419cd2701c6c54':
  stdio.h: enable vs?printf clang FORTIFY_SOURCE
2013-06-27 10:15:31 -07:00
Nick Kralevich
c8ae8bd941 stdio.h: enable vs?printf clang FORTIFY_SOURCE
Enable FORTIFY_SOURCE protections under clang for the following
functions:

  * vsprintf
  * vsnprintf

and add unittests.

Change-Id: I90f8a27f7b202c78b5dd8ebf53050bf9e33496f7
2013-06-27 09:17:48 -07:00
Colin Cross
146d79c22a am fbec57d4: Merge changes Ib496e818,I074204e9
* commit 'fbec57d46c42460b2381484d1610ff21922d162e':
  bionic: add compatibility mode for properties
  bionic: use the size of the file to determine property area size
2013-06-25 17:08:48 -07:00