Commit graph

19 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
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
Colin Cross
8c59d96e24 Add killpg function
Change-Id:	I9bc347d264fe38faf2d0f9935d2ebb43a353196e
2010-01-15 16:27:04 -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
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
Jean-Baptiste Queru
83362689f5 merge from open-source master 2009-11-09 08:04:48 -08:00
Thorsten Glaser
92b10af793 Add the BSD sys_signame array.
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
2009-11-05 15:50:05 -08:00
Andy McFadden
b63e4e88b0 am 5f32207a: Wrap ARM abort() to improve stack trace.
Merge commit '5f32207a3db0bea3ca1c7f4b2b563c11b895f276' into eclair-mr2-plus-aosp

* commit '5f32207a3db0bea3ca1c7f4b2b563c11b895f276':
  Wrap ARM abort() to improve stack trace.
2009-10-16 07:28:34 -07:00
Andy McFadden
5f32207a3d Wrap ARM abort() to improve stack trace.
The code generated for Thumb and Thumb2 targets has different handling
for abort().  Because abort() is "noreturn", it doesn't need to preserve
the callee-save registers.  The Thumb2 version trashes LR and makes it
impossible to figure out who called abort().

This inserts a trivial stub function; net effect is stack traces are
reasonable after an abort().

For bug 2191452.
2009-10-15 16:29:22 -07:00
Jean-Baptiste Queru
73981476a3 merge from open-source master 2009-10-14 08:18:23 -07:00
Mathias Agopian
e36502673d fix [2170898] abort() doesn't print a stack tarce
the issue here is that abort() can be called from anywhere, in particular
from malloc or free. When we try to use the debug_log functions, these
can end up calling into some code (like malloc/free) that called abort()
in the first place and end up in an infinite recursion loop.
2009-10-06 16:02:12 -07:00
Tony Sim
336efb5267 added syscalls for SuperH which automatically generate by gensyscalls.py 2009-07-01 15:35:27 +09:00
The Android Open Source Project
1dc9e472e1 auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
The Android Open Source Project
1767f908af auto import from //depot/cupcake/@135843 2009-03-03 18:28:13 -08:00
The Android Open Source Project
7d9dcdc82a auto import from //branches/cupcake/...@132569 2009-02-20 07:38:28 -08:00
The Android Open Source Project
d37527501c auto import from //branches/cupcake/...@127101 2009-01-20 14:03:55 -08:00
The Android Open Source Project
e5cc1f386b auto import from //branches/cupcake/...@126645 2009-01-15 16:12:07 -08:00
The Android Open Source Project
4e468ed2eb Code drop from //branches/cupcake/...@124589 2008-12-17 18:03:48 -08:00
The Android Open Source Project
a27d2baa0c Initial Contribution 2008-10-21 07:00:00 -07:00