Commit graph

279 commits

Author SHA1 Message Date
Fabrice Di Meglio
8641833b62 Revert "bionic: pthread: use private futexes by default for mutexes and condvars"
This reverts commit ba9c6f0989.
2010-03-11 14:47:47 -08:00
David 'Digit' Turner
ba9c6f0989 bionic: pthread: use private futexes by default for mutexes and condvars
Private futexes are a recent kernel addition: faster futexes that cannot be
shared between processes. This patch uses them by default, unless the PROCESS_SHARED
attribute flag is used when creating a mutex and/or conditional variable.

Also introduces pthread_condattr_init/destroy/setpshared/getpshared.

Change-Id: I3a0e2116f467072b046524cb5babc00e41057a53
2010-03-11 11:48:38 -08:00
Colin Cross
1cfbda826c Merge "Only use NEON memcpy if __ARM_NEON__ is defined" 2010-03-10 18:14:25 -08:00
Colin Cross
ecede40222 Only use NEON memcpy if __ARM_NEON__ is defined
Change-Id: I32e6b9385d46efeec15dee8e395a82eef24ba3ea
2010-03-09 16:23:51 -08:00
David 'Digit' Turner
d378c68d74 Fix spurious DNS lookups in the C library.
The problem was that the 'defdname' field of res_state structure
was not properly initialized in __res_vinit(). This field is used
to store the default domain name, which is normally build from
calling gethostname() (see line 549 of res_init.c).

Unfortunately, in the typical Android case, gethostname() returns
an error (the hostname is configured) and a random stack string is
used later to build the DNS search list (see lines 556+ in res_init.c)

For the sake of illustration, let's say the search list is set to
a random value like 'xWLK'.

The end result is that when trying to result an unknown domain name
(e.g. 'www.ptn'), the query fails then the resolver tries to make a
new query with the DNS search list path(s) appended (e.g. 'www.ptn.xWLK').

The patch simply initializes 'defdname' to an empty string to avoid
this when the net.dns.search system property is not set.

Also contains whitespace/formatting fixes
2010-03-08 15:22:13 -08:00
David 'Digit' Turner
d7ed1ae982 Fix timezone management in the C library
Define 'timezone' and 'daylight' global variables that are already
defined in <time.h>

Properly update the 'tm_gmtoff' field in 'struct tm' values.
2010-03-05 14:17:35 -08:00
Gloria Wang
f199d2d503 QUalcomm H.264 encoder support. 2010-03-03 17:16:48 -08:00
Mike Chan
9f6915631b bonic: libc: cpuacct support for setuid functions
Any of the setuid functions now updates /acct/uid/ with its own tid
before changing users. This is so we can properly account for cpu time
per uid.

Change-Id: I34186cf4d5228cac8439e582a9e26c01ef3011e4
Signed-off-by: Mike Chan <mike@android.com>
2010-03-02 18:18:04 -08:00
Dima Zavin
bd9a90c443 libc: kernel: update pmem header with cache flush ioctl
Change-Id: Ied08844035d4526175dcdcb7f219f9f90c4679d2
Signed-off-by: Dima Zavin <dima@android.com>
2010-03-02 16:10:34 -08:00
Andrei Popescu
eb9d5ed347 add sigaltstack syscall 2010-03-02 11:43:24 +00:00
David 'Digit' Turner
8f8b5310d2 Fix pthread_sigmask() to return correct error values.
Before that, it returned -1 on error and set errno (not Posix)
After the patch, it returns the error code and leaves errno untouched.
2010-03-01 11:30:40 -08:00
David Turner
1f6f493963 Merge "Implement support for RFC 3484 (address selection/sorting) in bionic. (The Java changes required not to mess up the ordering from bionic will arrive in a later commit.) In particular, this will give us more correct behavior when on a 6to4 network, in that IPv4 will usually be preferred over 6to4." 2010-02-24 10:04:09 -08:00
Steinar H. Gunderson
9ab75d4cc8 Implement support for RFC 3484 (address selection/sorting) in bionic. (The
Java changes required not to mess up the ordering from bionic will arrive in a
later commit.) In particular, this will give us more correct behavior when on a
6to4 network, in that IPv4 will usually be preferred over 6to4.

Most of RFC 3484 is implemented -- what's not is rule 3 (avoid deprecated
addresses), 4 (prefer home addresses) and 7 (prefer native transport) as they
require low-level access to the kernel routing table via netlink. (glibc also
started out this way, and these rules are primarily useful in pretty obscure
circumstances, so we should be fine for the time being.)

Also, rule 9 (use longest matching prefix) has been modified so it does not try
to sort IPv4 addresses; given current IPv4 addressing practice these rules are
pretty much meaningless. Finally, I've added support for Teredo as a separate
label, with slightly lower preference than 6to4. (Vista puts the preference
below IPv4 by default. glibc puts the preference together with non-tunneled
IPv6.)

Note that this patch removes support for the "sortlist" directive in
resolv.conf; I've never seen it in actual use, it's irrelevant for Android
(since we don't use resolv.conf anyway), and it's not clear how it would be
implemented alongside RFC 3484.
2010-02-24 11:49:17 +01:00
San Mehat
75c5e25ae3 bionic: syscalls: Add ioprio_set/ioprio_get syscall wrappers
Signed-off-by: San Mehat <san@google.com>
2010-02-23 15:55:29 -08:00
Vladimir Chtchetkine
b55462328f Merge "Merge memory checking functionality from sandbox" 2010-02-17 13:43:15 -08:00
Vladimir Chtchetkine
75fba6888a Merge memory checking functionality from sandbox
Change-Id: I304c789a752c9f4af4944ca14b9bf1e7644da15a
2010-02-16 11:43:18 -08:00
Niko Catania
f31fceaae6 Merge "Changed __get_h_errno linkage to "C"." 2010-02-12 13:46:31 -08:00
David 'Digit' Turner
4f920f685b Fix sem_post() behaviour to wake up multiple waiting threads. 2010-02-12 12:50:32 -08:00
David 'Digit' Turner
294dd0b86b Fix sem_trywait() implementation + update changelog. 2010-02-12 12:18:37 -08:00
Nicolas Catania
2e1a03c16f Changed __get_h_errno linkage to "C".
Bug:2441631
2010-02-12 11:37:25 -08:00
David 'Digit' Turner
1dcf07a84c Fix android_id_from_name to accept "app_0" as a valid ID.
This fixes getpwnam and getpwgrp which returned NULL for "app_0".
"app_0" corresponds to uid/gid 10000 and is perfectly valid.
2010-02-12 11:35:38 -08:00
David Turner
16f7d16f9f Merge "Fix <sys/epoll.h> and <sys/system_properties.h> to include proper C++ inclusion guards" 2010-02-09 14:50:57 -08:00
David 'Digit' Turner
49f0a8f23b Fix <sys/epoll.h> and <sys/system_properties.h> to include proper C++ inclusion guards 2010-02-09 14:05:43 -08:00
Iliyan Malchev
53691d7df2 am 58060c50: am ee424e23: bionic: update processed kernel header a1026.h
Merge commit '58060c50bc4228a7d0253338cae0437211759959'

* commit '58060c50bc4228a7d0253338cae0437211759959':
  bionic: update processed kernel header a1026.h
2010-02-09 09:32:25 -08:00
Iliyan Malchev
58060c50bc am ee424e23: bionic: update processed kernel header a1026.h
Merge commit 'ee424e23c10c051ee4760177c85f6003ff20108c' into eclair-plus-aosp

* commit 'ee424e23c10c051ee4760177c85f6003ff20108c':
  bionic: update processed kernel header a1026.h
2010-02-09 09:25:57 -08:00
Iliyan Malchev
ee424e23c1 bionic: update processed kernel header a1026.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-08 15:57:09 -08:00
Iliyan Malchev
2721fbd208 am c0472409: am d0996bb4: bionic: update processed kernel header tpa2018d1.h
Merge commit 'c0472409d14eebf797df962dd78fc31afbc4bd07'

* commit 'c0472409d14eebf797df962dd78fc31afbc4bd07':
  bionic: update processed kernel header tpa2018d1.h
2010-02-02 16:22:10 -08:00
Iliyan Malchev
34f411e5fd am 7ec87a19: am 276313ec: bionic: add processed kernel headers a1026.h and tpa2018d1.h
Merge commit '7ec87a1926250d3c1f74193bf36417707e691e10'

* commit '7ec87a1926250d3c1f74193bf36417707e691e10':
  bionic: add processed kernel headers a1026.h and tpa2018d1.h
2010-02-02 16:22:06 -08:00
Iliyan Malchev
c0472409d1 am d0996bb4: bionic: update processed kernel header tpa2018d1.h
Merge commit 'd0996bb4cd6b6d0fa7c643a809f01e33adc2638d' into eclair-plus-aosp

* commit 'd0996bb4cd6b6d0fa7c643a809f01e33adc2638d':
  bionic: update processed kernel header tpa2018d1.h
2010-02-02 14:21:05 -08:00
Iliyan Malchev
7ec87a1926 am 276313ec: bionic: add processed kernel headers a1026.h and tpa2018d1.h
Merge commit '276313ec18c18a07e867dffe568a377583cfd905' into eclair-plus-aosp

* commit '276313ec18c18a07e867dffe568a377583cfd905':
  bionic: add processed kernel headers a1026.h and tpa2018d1.h
2010-02-02 14:21:02 -08:00
Iliyan Malchev
d0996bb4cd bionic: update processed kernel header tpa2018d1.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-02 13:42:55 -08:00
Iliyan Malchev
276313ec18 bionic: add processed kernel headers a1026.h and tpa2018d1.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-02 11:56:29 -08:00
Iliyan Malchev
cdcc2648ba bionic: update processed kernel header msm_camera.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-01-31 17:22:25 -08:00
David 'Digit' Turner
97cf7f3394 Implement clone() C library function properly.
Only provide an implementation for ARM at the moment, since
it requires specific assembly fragments (the standard syscall
stubs cannot be used because the child returns in a different
stack).
2010-01-25 11:18:30 -08:00
David 'Digit' Turner
d6bf8f9229 Add Bionic Changelog in libc/docs/CHANGES.TXT 2010-01-21 16:25:38 -08:00
Colin Cross
fc10b24acc Add implementation of fdprintf, clearenv, and stubs for ttyname_r, *usershell
Change-Id:	I5fe7e8b6ee5edbb49e707c3b6737a58563781fa3
2010-01-15 16:52:35 -08:00
Colin Cross
8c59d96e24 Add killpg function
Change-Id:	I9bc347d264fe38faf2d0f9935d2ebb43a353196e
2010-01-15 16:27:04 -08:00
Colin Cross
64ceac3f49 Add fts, err, and sys/queue for grep
Change-Id:	Id47514a1812d828e95efa2fab0e9c15c5b682b58
2010-01-15 15:57:02 -08:00
Colin Cross
c29731a491 mntent.h requires stdio.h
Change-Id:	If69f64cf088dedb19602bf47627d03400abb9095
2010-01-15 15:57:02 -08:00
Colin Cross
e9d08ba523 Add definition of rlim_t
Change-Id:	Ie8c2451360cbcce9fc1587528a95aca09a03d0de
2010-01-15 15:57:02 -08:00
Colin Cross
2497f65fee Import change from ctype.h revision 1.20 from openbsd
Fixes builds with gcc >= 4.3 with -std=gnu99

Change-Id:	I8729b7f4237fd7a99a82b2fe60573a7afe66b435
2010-01-15 15:57:02 -08:00
Colin Cross
d1cfc947f9 Import include/arpa/telnet.h from BSD
Change-Id:	I684251bfb8ef04f0706866ea55dceebcd2a5b0e1
2010-01-15 15:15:52 -08:00
Colin Cross
4fa7b10564 Import regex from OpenBSD
Change-Id: I7ad7d907ef65e4e345f94777d730813b1270a612
2010-01-15 15:01:44 -08:00
Colin Cross
6458c49c96 Fix ptsname_r(3) return type to match glibc
The gHardy man pages specify the return type of ptsname_r to be char*, but the
return value to be 0 on success, negative on error and the gHardy stdlib.h
defines extern int ptsname_r(...).

Busybox telnetd fails to run successfully without this change.
2010-01-12 12:58:12 -08:00
Elliott Hughes
0b5db51ea6 Merge "Fix usleep(3) return type to be POSIX-compliant." 2010-01-07 15:54:35 -08:00
Ben Cheng
ee84231886 Add user-space ptrace data structure to dump VFP registers and status word. 2009-12-17 12:46:45 -08:00
Elliott Hughes
99d7907611 Fix usleep(3) return type to be POSIX-compliant.
POSIX usleep(3) returns 0 on successful completion, -1 otherwise:
  http://www.opengroup.org/onlinepubs/007908799/xsh/usleep.html

This was found by an external user porting native code:
  http://groups.google.com/group/android-porting/browse_thread/thread/674848f001db0292
2009-12-14 17:07:19 -08:00
Mathias Agopian
278d960aae am f197147a: am ca07064c: am 5f53a182: Revert "Add qsort_r() implementation to the C library."
Merge commit 'f197147a787d7415e6e0a1bad15566836c55befb'

* commit 'f197147a787d7415e6e0a1bad15566836c55befb':
  Revert "Add qsort_r() implementation to the C library."
2009-12-04 04:31:23 -08:00
David 'Digit' Turner
44358b9fed am be71c814: am 20b3097d: am 754c178a: Add qsort_r() implementation to the C library.
Merge commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e'

* commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e':
  Add qsort_r() implementation to the C library.
2009-12-04 04:29:36 -08:00
Dima Zavin
4cf30fb534 am a0783df1: am df55c642: am e1e68492: Merge change Ifa58a406 into eclair
Merge commit 'a0783df14eaf9b0d858dd42d4e8a64a738314900'

* commit 'a0783df14eaf9b0d858dd42d4e8a64a738314900':
  libc: kernel: Update msm_kgsl.h header
2009-12-03 17:21:46 -08:00