Commit graph

177 commits

Author SHA1 Message Date
David 'Digit' Turner
4aa321538a am 2cae7967: Merge "libc: Fix prctl() declaration."
* commit '2cae7967e6049e45eaef71207481b6f8b2456025':
  libc: Fix prctl() declaration.
2011-06-06 12:27:10 -07:00
David 'Digit' Turner
b083bb57f5 libc: Fix prctl() declaration.
This change fixes the prctl() declaration to match GLibc, and allow us
to build gcc-4.6 for Android (among other things). Note that this does
not change the source and binary interfaces.

Change-Id: I3900c957f0da8b3548cbe9da8c41d50099dc19d6
2011-05-26 02:46:41 +02:00
David 'Digit' Turner
bfe04ea0e6 am 8c6b848e: am 0e47a919: Merge "libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++"
* commit '8c6b848e435b86db58179763da30008ac7d4c24a':
  libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++
2011-03-30 08:20:28 -07:00
Ken Sumrall
b130f00493 am ae2d5ba3: Add support for the utimensat(2) syscall to bionic.
* commit 'ae2d5ba31412c4f382ef405000baa866f35dd736':
  Add support for the utimensat(2) syscall to bionic.
2011-03-24 22:31:40 -07:00
Ken Sumrall
ae2d5ba314 Add support for the utimensat(2) syscall to bionic.
The kernel has supported this syscall for quite some time now,
but bionic did not.  Now that there is a need for it, let's
add it to bionic.

Change-Id: Ifcef3e46f1438d79435b600c4e6063857ab16903
2011-03-24 18:18:48 -07:00
David 'Digit' Turner
8eda21baa5 libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++
See http://code.google.com/p/android/issues/detail?id=14627 for context.

Change-Id: Idb10b675667d0d6e64dcb1d382be11e45aa6f4c4
2011-03-22 14:22:32 +01:00
satok
0b3c5c50f7 do not merge. Move property setting from libcutils to bionic.
Backport I110b653a58f3

All the other property stuff is already here.  Property setting was
only in libcutils previously to leverage a utility function / constant
or two.

Unfortunately in the process of fixing a race condition we would've
had to do break abstraction boundaries and put some libc-internal
details into libcutils so instead of that we'll just move this
into bionic.

Along with Iee1ca9b7, this now passes:

$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
  com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner

  Bug: 3511230

Change-Id: I1b588db3344169621e1279ecc0b660cf4e1015d7
2011-03-15 23:06:58 -07:00
satok
ec7e8cc9dd do not merge. Move property setting from libcutils to bionic.
Backport I110b653a58f3

All the other property stuff is already here.  Property setting was
only in libcutils previously to leverage a utility function / constant
or two.

Unfortunately in the process of fixing a race condition we would've
had to do break abstraction boundaries and put some libc-internal
details into libcutils so instead of that we'll just move this
into bionic.

Along with Iee1ca9b7, this now passes:

$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
  com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner

  Bug: 3511230

Change-Id: I1b588db3344169621e1279ecc0b660cf4e1015d7
2011-03-15 11:02:26 +09:00
David 'Digit' Turner
8d1f2e6ffc am 638608b1: am da8ea213: Merge "libc: <stdint.h>: Don\'t make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined."
* commit '638608b11afbd255ddbd15e739f0f638791a4305':
  libc: <stdint.h>: Don't make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined.
2011-03-14 10:53:11 -07:00
David 'Digit' Turner
448a1b9f18 am b299039d: am e6e2ba1d: Merge "libc: <pthread.h>: Replace \'#if __cplusplus\' by \'#ifdef __cplusplus\'"
* commit 'b299039d060eb5f523c05e4f9b6934a6b897a54f':
  libc: <pthread.h>: Replace '#if __cplusplus' by '#ifdef __cplusplus'
2011-03-14 10:53:09 -07:00
David 'Digit' Turner
3134b56bb0 am 0d6bbc7a: am dfe6eda5: Merge "libc: <stdint.h>: fix typo in INTMAX_C()/UINTMAX_C() definition"
* commit '0d6bbc7af091ee05dd032492ae594c263404e4aa':
  libc: <stdint.h>: fix typo in INTMAX_C()/UINTMAX_C() definition
2011-03-11 15:40:21 -08:00
David 'Digit' Turner
b868a32df6 am 0b73dac8: am d6722bdd: Merge "libc: <stdint.h>: Proper C++"
* commit '0b73dac8aa9546c0f532c7ea5e0bf72dd029f271':
  libc: <stdint.h>: Proper C++
2011-03-11 15:40:16 -08:00
David 'Digit' Turner
da8ea213ab Merge "libc: <stdint.h>: Don't make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined." 2011-03-11 09:32:33 -08:00
David 'Digit' Turner
847b183f63 libc: <pthread.h>: Replace '#if __cplusplus' by '#ifdef __cplusplus'
See http://code.google.com/p/android/issues/detail?id=15221

Change-Id: Ia7b6668c28737810d6c4941604c6adf232a27c61
2011-03-11 14:51:19 +01:00
David 'Digit' Turner
8b3cea6732 libc: <stdint.h>: Don't make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined.
Change-Id: I8b0ea266eab9c6f75d8407b704953ecaef948221
2011-03-11 14:39:05 +01:00
David 'Digit' Turner
0e5411b4ba libc: <stdint.h>: fix typo in INTMAX_C()/UINTMAX_C() definition
Change-Id: I3c74269901a288c448734dd7eb442a62b9348db8
2011-03-10 20:35:17 +01:00
David 'Digit' Turner
08ff1a6474 libc: <stdint.h>: Proper C++
This patch prevents the definition of various macros when <stdint.h> is
included from C++. The ISO C99 standard mentions that when this header
is included from a C++ source file, limit and constant related macros
should only be defined when asked explicitely by defining
__STDC_LIMIT_MACROS and __STD_CONSTANT_MACROS, respectively.

The <stdint.h> lacked the proper #ifdef .. #endif blocks for the
following macros:

    INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX
    INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX,
    INPTR_C, UINTPR_C, PTRDIFF_C, INTMAX_C, UINTMAX_C

This is intended to fix http://code.google.com/p/android/issues/detail?id=14380
after we copy this file to development/ndk/platforms/android-3/include/

Change-Id: Ia77e0822edfaaf568ea599d7de673b310eeeaa4a
2011-03-10 18:02:01 +01:00
David 'Digit' Turner
81d79f9fb3 am 962dcb22: am fed58049: Merge "libc: Fix PTHREAD_RWLOCK_INITIALIZER"
* commit '962dcb22218a1a6d4ebd05e4fc4a69875d037234':
  libc: Fix PTHREAD_RWLOCK_INITIALIZER
  Proxy getnameinfo through netd
  Updated gcc 4.4.3 IA toolchain doesn't require the .ctors list
  Convert cname lenght before use
2011-03-10 01:55:35 -08:00
David 'Digit' Turner
ca4462d76c libc: Fix PTHREAD_RWLOCK_INITIALIZER
The macro definition was incorrect and resulted in a compile error
when used.

Fixes http://code.google.com/p/android/issues/detail?id=15306

Change-Id: I8fa6047b63e7f56b53653774327099822c469cd1
2011-03-10 10:23:44 +01:00
Kenny Root
f582340a6a Fix the handle locking in stdio
Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required.  Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking.  A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization.  Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

Based on OpenBSD change by guenther@openbsd.org
http://www.mail-archive.com/source-changes@cvs.openbsd.org/msg01015.html

Bug: 3446659
Change-Id: Ie82116e358c541718d6709ec45ca6796be5a007b
2011-02-14 09:32:56 -08:00
David 'Digit' Turner
62e1f374d1 Merge "libc: Update auto-gen scripts" 2011-02-06 12:53:23 -08:00
David 'Digit' Turner
fc2693110e libc: Update auto-gen scripts
Make the scripts use external/kernel-headers/original by default.

clean_header.py:  Document -k<path>, add -d<path>
find_headers.py:  Make kernel config files optional
update_all.py:    Allow setting the path to kernel headers on the command-line
update_all.py:    Better formatting of output on ttys
update_all.py:    Automatically perform "git add/rm" on affected files.
SYSCALLS.TXT:     Fix typo in __socketcall definition.
checksyscalls.py: Add support for superH architecture in the checks.
gensyscalls.py:   Automatically perform "git add/rm" on affected files.
cpp.py:           Fixed a bug that prevented certain type definitions to
                  be kept in the generated clean header (e.g.
                  struct ethtool_drvinfo in <linux/ethtool.h>)

All scripts will use the content of external/kernel-headers/original by default now.

The generated code removes all empty lines and trailing whitespace. This is useful
to ensure a unified output even if we change the parser again in the future.

The top-level disclaimer has been edited with update instructions to regenerate
the headers when needed.

Also, a warning is now inserted every 8th line in the final output:

/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */

Changes under kernel/arch-arm and kernel/arch-x86 should correspond to whitespace
differences and additionnal struct definitions that were missed by the previous
parser implementation.

Change-Id: Icd1c056bacd766759f3e9b7bb5d63a246f3d656a

WARNING: If you run these script, do not submit the result to gerrit for now.
         It seems there are discrepancies between the content of original headers
         and those currently commited under bionic/libc/kernel/.

         (This problem is the main motivation to insert the warning repeatedly).

         Current list of issues:

           - Missing SuperH headers (i.e. external/kernel-headers/original/asm-sh)
2011-02-03 18:07:41 +01:00
Steinar H. Gunderson
6846a45882 Add icmp6.h and ip6.h files from current NetBSD libc.
Change-Id: I6b304dfbefaec74c5fb15b216f38d698a55f0642
2011-01-28 18:28:27 +01:00
Steinar H. Gunderson
bdca379412 Include the Linux ipv6.h header from netinet/in.h, to get things like in6_pktinfo.
Change-Id: I4a3c2035ff8e2846352345580756a1bdc2768ec4
2011-01-28 18:28:27 +01:00
Steinar H. Gunderson
3de0321690 Add IN6ADDR_LOOPBACK_INIT macro to <netinet/in6.h>, as the kernel headers do not provide it anymore.
Change-Id: I5af12b3f38097ed165e64a408253dc375aa605d7
2011-01-28 18:28:19 +01:00
Steinar H. Gunderson
64b6c43379 Add a new #define IN6_IS_ADDR_ULA, for testing for Universal Local IPv6 Unicast addresses (ULAs). These replace the old site-local IPv6 addresses.
Change-Id: I2656423764569d07b92b8eb8fe6dcad6eba5b0bb
2011-01-05 13:55:40 +01:00
David 'Digit' Turner
5c8c00a95a libc: Fix the definition of SIGRTMAX
After this change, SIGRTMAX will be set to 64 (instead of 32 currently).
Note that this doesn't change the fact that our sigset_t is still defined
as a 32-bit unsigned integer, so most functions that deal with this type
won't support real-time signals though.

Change-Id: Ie1e2f97d646f1664f05a0ac9cac4a43278c3cfa8
2010-12-20 15:58:06 +01:00
David 'Digit' Turner
d4a65d28d4 libc: Add missing declarations in <netinet/in.h>
Add missing declarations:
  INET_ADDRSTRLEN
  IN6_IS_ADDR_MC_NODELOCAL
  IN6_IS_ADDR_MC_GLOBAL

It has been reported that these prevent compilation of the Boost libraries
with the NDK. The corresponding patch has already been performed under
development/ndk/platforms/android-3/include.

Change-Id: I4ac514973daf3c06a8ef5538d7df79142a98e562
2010-12-16 20:53:03 +01:00
David 'Digit' Turner
95d751feac libc: Add ftruncate64 and improve 64-bit parameter syscall handling.
This patch improves the handling of 64-bit parameters in syscalls on ARM.
The ARM EABI mandates that 64-bit quantities be passed in even/odd register
pairs, which requires special treatment.

This allows us to simplify our implementations of pread() and pwrite()
and remove the C stubs for pread64() and pwrite64().

Also add ftruncate64() to <unistd.h>

Change-Id: I407e2fd223ba0093dd2d0b04c6152fadfc9ce3ef

Bug 3107933
2010-12-16 17:04:41 +01:00
David 'Digit' Turner
72e6fd4242 <sched.h>: Add sched_getcpu() and cpu_set_t
This adds the cpu_set_t type definition and related functions
and macros used to handle CPU thread affinity.

  sched_getcpu()
  sched_setaffinity()
  sched_getaffinity()

Change-Id: If382ecafde8926341a88478062b275553645065b
2010-12-06 13:42:54 +01:00
David 'Digit' Turner
6481b91520 <time.h>: Add timegm(), timelocal() and others.
Add timegm(), timelocal(), time2posix() and posix2time() to the
C library.

Change-Id: I34d5771ed83dd994870a5ca58a511d01898b1ffb
2010-12-06 12:25:52 +01:00
David 'Digit' Turner
23d24394e7 libc: Add <android/api-level.h>
Add a new header that defines __ANDROID_API__ as a constant integer
corresponding to the current native API level. This header is included
by <sys/cdefs.h>

Change-Id: Ib4774e247b395991266245815a24292afc919848
NOTE: This header is already provided by the NDK's platform headers.
      for levels 3 to 9.
2010-12-06 12:05:11 +01:00
Ed Heyl
9962cef7c6 Merge "Add mkdtemp() prototype to stdlib.h." 2010-12-02 13:20:15 -08:00
tedbo
ad1ff2fb26 Add mkdtemp() prototype to stdlib.h.
The mkdtemp() function is implemented in libc/stdio/mktemp.c but not
exposed in stdlib.h. This change adds the prototype to stdlib.h.

Change-Id: I5a98650c665d2e45b2cf6ed3382742f7bdc7c88a
2010-11-30 12:45:02 -08:00
tedbo
16e02c2e3b Add wcscasecmp() and wcsncasecmp() prototypes to wchar.h.
The above prototypes are missing from libc/include/wchar.h but
the functions are present (although with a limited implementation)
in libc.

Change-Id: I1b7c6accfc59ff0f56f3f41a9d3c075e935ac54a
2010-11-29 13:15:07 -08:00
Kenny Root
72e64e0869 Add support for pread64/pwrite64
64-bit pread() and pwrite() is needed for ZipFileRO to be able to read
ludicrously large ZIP files just in case someone is crazy enough to do
it.

Also fix a license header that was apparently mangled.

Change-Id: I6819ef8b36e46b63b40749c95717b1ecf9307033
2010-11-24 13:14:50 -08:00
David 'Digit' Turner
8d8034eae0 am 5c485373: am d3f0638a: libc: fix typo in waitid() declaration.
Merge commit '5c485373563c1183db2ba02ec2aca695d1c87cc8'

* commit '5c485373563c1183db2ba02ec2aca695d1c87cc8':
  libc: fix typo in waitid() declaration.
2010-10-15 00:05:36 -07:00
David 'Digit' Turner
5c48537356 am d3f0638a: libc: fix typo in waitid() declaration.
Merge commit 'd3f0638aeec0b1daf4d3347386a5e441d5a4bcc4' into gingerbread-plus-aosp

* commit 'd3f0638aeec0b1daf4d3347386a5e441d5a4bcc4':
  libc: fix typo in waitid() declaration.
2010-10-13 10:28:31 -07:00
David 'Digit' Turner
d3f0638aee libc: fix typo in waitid() declaration.
The implementation file uses the correct spelling.

Change-Id: I572e336f8695a9754267c8d2e0a67b1b69bacb06
2010-10-13 15:46:55 +02:00
Jean-Baptiste Queru
168f267723 am ff7d9453: am f67e5211: Merge "Hide the symbol of helper function __libc_android_abort"
Merge commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a'

* commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a':
  Hide the symbol of helper function __libc_android_abort
2010-10-12 01:45:31 -07:00
David 'Digit' Turner
364462ea2e am 1aeeeae1: am b8d2233e: Merge "libc: tag missing functions in system headers." into gingerbread
Merge commit '1aeeeae166920f871c1e4ecd960bb92dcaef0896'

* commit '1aeeeae166920f871c1e4ecd960bb92dcaef0896':
  libc: tag missing functions in system headers.
2010-10-11 18:59:30 -07:00
Jean-Baptiste Queru
ff7d94530d am f67e5211: Merge "Hide the symbol of helper function __libc_android_abort"
Merge commit 'f67e5211e045af1b12f646448a5a35f96ba5e8f1' into gingerbread-plus-aosp

* commit 'f67e5211e045af1b12f646448a5a35f96ba5e8f1':
  Hide the symbol of helper function __libc_android_abort
2010-10-11 07:27:01 -07:00
Jean-Baptiste Queru
f67e5211e0 Merge "Hide the symbol of helper function __libc_android_abort" 2010-10-11 07:13:10 -07:00
David 'Digit' Turner
1aeeeae166 am b8d2233e: Merge "libc: tag missing functions in system headers." into gingerbread
Merge commit 'b8d2233e8abc30f33be7d7acc7f3ef6e6aabebac' into gingerbread-plus-aosp

* commit 'b8d2233e8abc30f33be7d7acc7f3ef6e6aabebac':
  libc: tag missing functions in system headers.
2010-10-11 06:11:56 -07:00
David 'Digit' Turner
bb5581ad6e libc: tag missing functions in system headers.
This matches recent changes in the NDK header.
We enclose missing functions in #if 0 .. #endif blocks
with a clear "MISSING" in comments in order to locate
them later.

Change-Id: I87b3a62e777897e75c9243360fb0a82bcc53d9fb
2010-10-09 17:56:55 +02:00
repo sync
319de1758c am 686af0b3: resolved conflicts for merge of defd1622 to gingerbread-plus-aosp
Merge commit '686af0b3a5978356be3b1a97187c765d63f11623'

* commit '686af0b3a5978356be3b1a97187c765d63f11623':
  libc: add <sys/eventfd.h> and corresponding implementations.
2010-09-28 12:48:34 -07:00
David 'Digit' Turner
2336503264 am a511f245: am 9973a564: libc: Add missing waitid() implementation.
Merge commit 'a511f245614d8e6c7700df624e13a41a084ad7e4'

* commit 'a511f245614d8e6c7700df624e13a41a084ad7e4':
  libc: Add missing waitid() implementation.
2010-09-28 12:48:32 -07:00
David 'Digit' Turner
37c4305633 am 052fbd88: am a3ae60d3: libc: Add missing fdatasync() implementation
Merge commit '052fbd88080c88b7f568612dcac7579092c2e3d9'

* commit '052fbd88080c88b7f568612dcac7579092c2e3d9':
  libc: Add missing fdatasync() implementation
2010-09-28 12:48:28 -07:00
David 'Digit' Turner
1e95e58c91 am 5b5212b4: am 307aadb8: Merge "libc: Add missing C++ guards to <pathconf.h>" into gingerbread
Merge commit '5b5212b457f7308f9d7d4011c02af71ef1cad9c4'

* commit '5b5212b457f7308f9d7d4011c02af71ef1cad9c4':
  libc: Add missing C++ guards to <pathconf.h>
2010-09-28 12:48:25 -07:00
David 'Digit' Turner
4903487555 am 5d335a1c: am 032a7135: Merge "libc: add missing O_CLOEXEC from <fcntl.h>" into gingerbread
Merge commit '5d335a1c6552f74e7da2c5f2d97f65eea8cb8c72'

* commit '5d335a1c6552f74e7da2c5f2d97f65eea8cb8c72':
  libc: add missing O_CLOEXEC from <fcntl.h>
2010-09-28 12:48:19 -07:00