Commit graph

416 commits

Author SHA1 Message Date
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
cb58a8221c Merge "QUalcomm H.264 encoder support." 2010-03-03 18:02:33 -08:00
Gloria Wang
f199d2d503 QUalcomm H.264 encoder support. 2010-03-03 17:16:48 -08:00
Dan Bornstein
2e5491b8f2 am 71fbeecd: (-s ours) am fd5b1bb8: Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
Merge commit '71fbeecdbd7bcf2282e4b032ceb2f6ead13dc9cb'

* commit '71fbeecdbd7bcf2282e4b032ceb2f6ead13dc9cb':
  Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
2010-03-03 11:07:09 -08:00
Dan Bornstein
71fbeecdbd am fd5b1bb8: Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
Merge commit 'fd5b1bb85d0a971fd8469112a157380c4d3a146f' into eclair-mr2-plus-aosp

* commit 'fd5b1bb85d0a971fd8469112a157380c4d3a146f':
  Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
2010-03-03 10:51:34 -08:00
Dan Bornstein
fd5b1bb85d Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
As with the other wchar functions in Bionic, these are really
minimally functional stubs.
2010-03-03 10:25:29 -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 'Digit' Turner
5c734644ee Fix debug output in the dynamic linker.
This provides a mini-printf implementation that reduces the
size of the dynamic linker by 25 KB, by preventing the drag of
formatting-related routines from the C library.

Also allow traces to be sent to the log, instead of stdout.

NOTE: You now need to modify Android.mk to enable/disable debug
      output.
2010-02-11 10:46:48 -08:00
Iliyan Malchev
e100f52f4a bionic/linker: rename ba_prelink to ba_nonprelink
-- fixes b/2432550
-- ba_prelink is used to manage non-prelinked libraries, hence ba_nonprelink is
   a more appropriate name for it

Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-10 19:14:35 -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
The Android Open Source Project
34e6991c97 am 1db87472: am ba8bfedd: reconcile main tree with open-source eclair
Merge commit '1db874720a58ff7e3684116d59ad08bc73db26d9'

* commit '1db874720a58ff7e3684116d59ad08bc73db26d9':
  android-2.1_r1 snapshot
2010-02-05 14:14:46 -08:00
The Android Open Source Project
1db874720a am ba8bfedd: reconcile main tree with open-source eclair
Merge commit 'ba8bfedd04824eea944236ffc885f866c5e9c651' into eclair-plus-aosp

* commit 'ba8bfedd04824eea944236ffc885f866c5e9c651':
  android-2.1_r1 snapshot
2010-02-05 08:44:18 -08:00
The Android Open Source Project
ba8bfedd04 reconcile main tree with open-source eclair 2010-02-05 08:09:31 -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
The Android Open Source Project
e964f3a095 reconcile android-2.1_r1 snapshot 2010-01-29 14:07:31 -08:00
David Turner
f597049b40 Merge "Implement clone() C library function properly." 2010-01-25 14:30:17 -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
Doug Kwan
90f82e5868 Fix typo in a comment. 2010-01-25 11:09:31 -08:00
Doug Kwan
1a2917ca95 Align TEXT section to 4K boundary so that we can use both ld and gold. 2010-01-25 10:24:50 -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