Compare commits

...

83 Commits

Author SHA1 Message Date
Elliott Hughes
5ae762a393 Merge "Pull bionic's time zone data from the new single 'tzdata' file." 2012-10-18 10:48:11 -07:00
Elliott Hughes
9ffaabcc49 Merge "Remove obsolete CHANGES.TXT and ISSUES.TXT." 2012-10-18 10:09:47 -07:00
Elliott Hughes
d23af23268 Pull bionic's time zone data from the new single 'tzdata' file.
Bug: 7012465
Change-Id: Iec71e448bf7a40af30ca89150b3c336e67a44a43
2012-10-17 16:30:47 -07:00
Elliott Hughes
32ea9fe578 Merge "Put all the tzdata in one file." 2012-10-17 15:52:09 -07:00
Elliott Hughes
fb018a2dde Put all the tzdata in one file.
I'll come back and remove the separate files (and change the regular 'generate'
script) when the separate files are obsolete, but in the interim period, it's
easier to have both old and new files available.

Bug: 7012465
Change-Id: I36e2fd49c08ff79ded6eca1c5bc4c08837cc490a
2012-10-17 14:24:50 -07:00
Elliott Hughes
ead7819f51 Remove obsolete CHANGES.TXT and ISSUES.TXT.
These haven't been updated in a long time, and "git log" is the source of truth.

Change-Id: I99036f6111e53425f32df510b7b717deb77513a5
2012-10-17 11:33:59 -07:00
Elliott Hughes
a2f596b650 Merge "Make dlerror(3) thread-safe." 2012-10-17 10:50:48 -07:00
David 'Digit' Turner
42ac0e5030 Merge "Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>"" 2012-10-17 10:11:23 -07:00
David 'Digit' Turner
c1b44ecc53 Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>"
This creates build issues in the internal Android tree.
Will investigate later.

Original patch: https://android-review.googlesource.com/#/c/38875/

Change-Id: I12c5995ebf172890051af42a5d3b31014c9c5117
2012-10-17 19:10:11 +02:00
David 'Digit' Turner
4136c3a2b7 Merge "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>" 2012-10-17 07:20:54 -07:00
David 'Digit' Turner
c124baaf29 libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>
This patch updates the C library headers to provide ucontext_t
definitions for three architectures.

+ Fix <signal.h> to always define 'struct sigcontext'.

The new declarations are announced with new macros defined in
<sys/cdefs.h> in order to make it easier to adapt client code
that already defines its own, incompatible, versions of the
structures seen here.

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

Change-Id: Ie78c48690a4ce61c50593f6c39639be7fead3596
2012-10-17 15:59:23 +02:00
Elliott Hughes
5419b94747 Make dlerror(3) thread-safe.
I gave up trying to use the usual thread-local buffer idiom; calls to
calloc(3) and free(3) from any of the "dl" functions -- which live in
the dynamic linker -- end up resolving to the dynamic linker's stubs.
I tried to work around that, but was just making things more complicated.
This alternative costs us a well-known TLS slot (instead of the
dynamically-allocated TLS slot we'd have used otherwise, so no difference
there), plus an extra buffer inside every pthread_internal_t.

Bug: 5404023
Change-Id: Ie9614edd05b6d1eeaf7bf9172792d616c6361767
2012-10-16 17:58:17 -07:00
Elliott Hughes
a9944cfe9e Merge "LONG_LONG_MIN/MAX: Move declarations to <limits.h>" 2012-10-15 17:34:13 -07:00
David 'Digit' Turner
f8a2c51bf3 LONG_LONG_MIN/MAX: Move declarations to <limits.h>
LONG_LONG_MIN, LONG_LONG_MAX and ULONG_LONG_MAX are
GLibc-specific macros that are better defined in <limits.h>
instead of the current exotic location (<pthread.h>).

Note that GCC's <limits.h> only defines these macros
when __GNU_LIBRARY__ is also defined. This is only the
case when building against GLibc, so manually redefine
the macros here.

Note that using LLONG_MIN/LLONG_MAX/ULLONG_MAX is the
C99-compliant way to get these values, but it's easier
to define these compatibility macros for the sake of
porting existing code.

Change-Id: I8023918d73b4685238054932f94a4006c1ca7d03
2012-10-15 18:52:55 +02:00
Elliott Hughes
fcf901d5c0 Merge "Fix realloc(3) when chk_malloc debugging is on." 2012-10-12 17:09:03 -07:00
Elliott Hughes
e7e274b13a Fix realloc(3) when chk_malloc debugging is on.
The tests for a NULL pointer and size 0 were the wrong way round.

From Intel's patch 9cae4f2ffc4778ed82be04711d8775a84092d4e2.

Change-Id: I118aff3358aa5f34126d74bfaa43f6e2f1a89055
2012-10-12 17:05:05 -07:00
Elliott Hughes
9434e8febc Merge "Make the dlfcn mutex static." 2012-10-12 10:59:59 -07:00
Elliott Hughes
22d629211d Make the dlfcn mutex static.
More style fixes too, and removal of yet another lingering SH reference!

Change-Id: Iebc34a46475dd11845ad172b9108bb6ddd7585bb
2012-10-12 10:50:21 -07:00
Elliott Hughes
db4fdf1aaf Merge "Fix dlerror(3)." 2012-10-12 10:27:44 -07:00
Elliott Hughes
3b297c4079 Fix dlerror(3).
Add unit tests for dlerror(3) in various situations. I think We're at least
as good as glibc now.

Also factor out the ScopedPthreadMutexLock and use it here too.

Bug: http://code.google.com/p/android/issues/detail?id=38398
Change-Id: I040938b4366ab836e3df46d1d8055b92f4ea6ed8
2012-10-11 16:08:51 -07:00
Elliott Hughes
417fd2334a Merge "Fix perf_event_open syscall for x86 and mips" 2012-10-11 10:26:00 -07:00
Shuo Gao
4e75c4b2d7 Fix perf_event_open syscall for x86 and mips
perf_event_open syscall has a different syscall number for
the 3 supported architectures: arm, x86 and mips. Currenlty
only the arm syscall number is defined for all architectures.
Tracing tools like perf will not work on other architectures
than arm.

Add the different values for perf_event_open on x86 and mips
and run gensyscalls.py to update generated headers.

Change-Id: I2ed78bd42c0e5df8dbc51d784be49cccda5fab30
Author: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
2012-10-11 10:24:51 -07:00
Elliott Hughes
1ceb9824ab Merge "Fix a getcwd(3) bug and make our tests run correctly under valgrind." 2012-10-09 18:14:37 -07:00
Elliott Hughes
b83cad7983 Merge "Fix two comment typos." 2012-10-09 17:23:38 -07:00
Elliott Hughes
e5d5f7f0d8 Fix two comment typos.
Change-Id: Icb2d6f7fa97ef5a4409a7606875e416cfab0a4b3
2012-10-09 17:23:09 -07:00
Elliott Hughes
156da96621 Fix a getcwd(3) bug and make our tests run correctly under valgrind.
The getcwd(3) bug was found by valgrind.

Bug: 7291287
Change-Id: I59f3bff1c1392a408b905934eebcd5d894d37492
2012-10-09 17:17:24 -07:00
Elliott Hughes
9a7366e894 am fa7e2586: Merge "Test flags before using "info""
* commit 'fa7e2586176711896e6c0b94c7b811f7cbe29907':
  Test flags before using "info"
2012-10-03 17:41:08 -07:00
Elliott Hughes
fa7e258617 Merge "Test flags before using "info"" 2012-10-03 17:27:51 -07:00
Andy McFadden
1db6f2db49 Test flags before using "info"
Our debugger signal catcher expects to receive three args, but if
somebody cleared SA_SIGINFO we only get one, and bad things happen
when we try to use the second one.  Test to see if SA_SIGINFO is
still set before we try to use the argument.

(cherry-pick of f84bc8d6f6368f1c846124a8168761ee8cc589c0.)

Bug: 7272866
Change-Id: I69a65c25e833aea70acb78f9ba40ed93308583e6
2012-10-03 17:20:06 -07:00
Elliott Hughes
b95ad82f7d am 95a2a7f3: Merge "Fix MIPS build."
* commit '95a2a7f325330830d6227aa683948b325e38e653':
  Fix MIPS build.
2012-10-02 11:31:30 -07:00
Elliott Hughes
95a2a7f325 Merge "Fix MIPS build." 2012-10-02 11:22:33 -07:00
Elliott Hughes
857fed50cb Fix MIPS build.
ARM and x86 have custom memcpy implementations, but MIPS relies on the generic
one, which I recently moved.

Change-Id: I9e49243f63b27a4123f2c6623d6286ec82d333c7
2012-10-02 11:20:07 -07:00
Elliott Hughes
9017254186 am b98204a9: Merge "Move non-upstream code into the libc/bionic directory."
* commit 'b98204a9fb5c84478a9710163df395486443c7f6':
  Move non-upstream code into the libc/bionic directory.
2012-10-02 09:22:03 -07:00
Elliott Hughes
b98204a9fb Merge "Move non-upstream code into the libc/bionic directory." 2012-10-02 09:13:34 -07:00
Elliott Hughes
39d7c6072d am 75f43525: Merge "Always take GCC\'s definition of NULL."
* commit '75f43525550c5cad3980f7dd125cb838836790b8':
  Always take GCC's definition of NULL.
2012-10-01 18:18:06 -07:00
Elliott Hughes
75f4352555 Merge "Always take GCC's definition of NULL." 2012-10-01 18:11:20 -07:00
Elliott Hughes
7d56ccbfaa Always take GCC's definition of NULL.
There's a (bad) definition of NULL in <linux/stddef.h>, and this
definition of NULL, and the One True definition in the <stddef.h> provided
by the compiler. This change at least kills one of the bad duplicates.
Killing the <linux/stddef.h> one is harder, because it's in a generated
file.

Change-Id: Iea4ccb12d6758199f312ea9cd753b84322d5c471
2012-10-01 17:56:58 -07:00
Elliott Hughes
a89864a20b Move non-upstream code into the libc/bionic directory.
I'll need at least one more pass, because there's some upstream code
lurking in libc/bionic, but this is still a step in the right direction.

Change-Id: I55927315972da8327ae01c5240ed587db17e8462
2012-10-01 17:35:49 -07:00
Elliott Hughes
bb7dfcd3b8 am d3bf954e: Merge "Remove useless #defines and incorrect claims from header files."
* commit 'd3bf954e9ffbdee8d732ccb6ad6143dc31b605fc':
  Remove useless #defines and incorrect claims from header files.
2012-10-01 15:50:51 -07:00
Elliott Hughes
d3bf954e9f Merge "Remove useless #defines and incorrect claims from header files." 2012-10-01 15:37:18 -07:00
Elliott Hughes
0cc0d250fd Remove useless #defines and incorrect claims from header files.
The various __need_* macros were write-only.

Change-Id: Id3cca34188e0801fdf93a038b22f2817226ad9c2
2012-10-01 15:12:40 -07:00
Elliott Hughes
a428bc1288 am fe712e6c: Merge "Upgrade seed48 too."
* commit 'fe712e6caedccbbba24bda8429cb0b8cc6057ff1':
  Upgrade seed48 too.
2012-10-01 14:46:46 -07:00
Elliott Hughes
fe712e6cae Merge "Upgrade seed48 too." 2012-10-01 14:38:09 -07:00
Elliott Hughes
31a1060a5a Upgrade seed48 too.
Missed this in 774c7f54ff.

Change-Id: Ic24fd67f003d0e2d192cfb08f96f63024ca817eb
2012-10-01 14:14:21 -07:00
Elliott Hughes
b650111a11 am cd195eba: Merge "Upgrade to the current NetBSD rand implementation."
* commit 'cd195eba1f9235b9b9d4dda70142d927b1b9802d':
  Upgrade to the current NetBSD rand implementation.
2012-10-01 14:13:16 -07:00
Elliott Hughes
cd195eba1f Merge "Upgrade to the current NetBSD rand implementation." 2012-10-01 14:05:09 -07:00
Elliott Hughes
774c7f54ff Upgrade to the current NetBSD rand implementation.
Also add basic unit tests.

Change-Id: I7fc7ef61d47c1e8fdf8b8eff67a635220c3afd56
2012-10-01 13:53:41 -07:00
Elliott Hughes
0fa6279f39 am 5b6346f6: Merge "bionic: linker: Need update the map->l_addr for execution."
* commit '5b6346f6d5dca4022fe0044dd2807c19ac596788':
  bionic: linker: Need update the map->l_addr for execution.
2012-10-01 09:21:08 -07:00
Elliott Hughes
5b6346f6d5 Merge "bionic: linker: Need update the map->l_addr for execution." 2012-10-01 09:09:17 -07:00
Elliott Hughes
bb892a1b63 am d03bfe68: Merge "Define ssize_t if necessary."
* commit 'd03bfe689a6e29aa010a927741f42c08f89ef04d':
  Define ssize_t if necessary.
2012-09-28 10:27:06 -07:00
Elliott Hughes
d03bfe689a Merge "Define ssize_t if necessary." 2012-09-28 10:16:58 -07:00
Elliott Hughes
422b6ef92c Define ssize_t if necessary.
Change-Id: I63801cc1f09be5e4ca20a6da7ec3366ba6441afd
2012-09-28 10:15:52 -07:00
Elliott Hughes
72b08af300 am f9163dd1: Merge "Add getdelim(3) and getline(3) to bionic"
* commit 'f9163dd1f0f6cbd7b8305fa1b2ce46754ed95278':
  Add getdelim(3) and getline(3) to bionic
2012-09-28 09:53:08 -07:00
Elliott Hughes
f9163dd1f0 Merge "Add getdelim(3) and getline(3) to bionic" 2012-09-28 09:44:24 -07:00
Irina Tirdea
eac9eb462e Add getdelim(3) and getline(3) to bionic
Some userspace programs (e.g. perf) need getline.

Changes:
() add getdelim.c, getline.c from NetBSD (http://netbsd.org/) under the
NetBSD Foundation's (TNF) license ("2 clause" Berkeley-style license).
() add stub for reentrant.h header that is needed by getdelim.c
() add tests for getdelim(3) and getline(3).
() update NOTICE file.

Change-Id: I22ed82dd5904b9d7a3695535c04f502be3c27c5d
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
2012-09-27 11:38:57 -07:00
Elliott Hughes
fd6ca57f24 am e4030e0b: Merge "Fix several compiler warnings."
* commit 'e4030e0bfc427e755477bbea69afe60308a62d91':
  Fix several compiler warnings.
2012-09-26 16:04:51 -07:00
Elliott Hughes
e4030e0bfc Merge "Fix several compiler warnings." 2012-09-26 15:51:01 -07:00
Elliott Hughes
2c29bcf77f am 827a2604: Merge "Replace __unused in kernel headers with __linux_unused to avoid conflicts with __unused macro in sys/cdefs.h"
* commit '827a2604ee660df80feb231a1f8bcc96ea6e64ce':
  Replace __unused in kernel headers with __linux_unused to avoid conflicts with __unused macro in sys/cdefs.h
2012-09-26 15:17:07 -07:00
Elliott Hughes
827a2604ee Merge "Replace __unused in kernel headers with __linux_unused to avoid conflicts with __unused macro in sys/cdefs.h" 2012-09-26 14:58:11 -07:00
Elliott Hughes
ac184b2142 Fix several compiler warnings.
Change-Id: I55caa50a5937442734f4fcbdb4edf1c70f335bf8
2012-09-26 14:20:22 -07:00
Elliott Hughes
dd9fbc8646 am 8e630dac: Merge "Simple tests for dladdr(3)."
* commit '8e630dacf61307e4681f04fc6b5ee593f30d91d0':
  Simple tests for dladdr(3).
2012-09-26 12:18:14 -07:00
Elliott Hughes
a48d5e5f12 am 855dde44: Merge "Fix tmpfile(3)."
* commit '855dde44266e3c8384ea419f51f9a5c748253eda':
  Fix tmpfile(3).
2012-09-26 12:18:13 -07:00
Elliott Hughes
8e630dacf6 Merge "Simple tests for dladdr(3)." 2012-09-26 12:10:56 -07:00
Elliott Hughes
855dde4426 Merge "Fix tmpfile(3)." 2012-09-26 12:04:59 -07:00
Elliott Hughes
91875dcd6e Fix tmpfile(3).
This could be better, but at least now it works.

Change-Id: I88b7cf3f7ce8e5fa0b3fe678b7d1679a68ffffc9
2012-09-26 12:02:17 -07:00
Elliott Hughes
8e15b08ae2 Simple tests for dladdr(3).
Change-Id: I22160b7fc9b950ea19adb6da42af2f893f4fe5d5
2012-09-26 11:44:01 -07:00
Nick Kralevich
5989ed5cb8 am 25937d36: Merge "FORTIFY_SOURCE: add umask check"
* commit '25937d36a0639593520d2765c59736c40095f0ae':
  FORTIFY_SOURCE: add umask check
2012-09-26 11:12:34 -07:00
Nick Kralevich
25937d36a0 Merge "FORTIFY_SOURCE: add umask check" 2012-09-26 10:59:29 -07:00
Elliott Hughes
00f339771b am 3307bff0: Merge "Revert dl_fbase initialization to the address where the shared object is loaded."
* commit '3307bff0232a00f879053e94a5f37f1ca1256f7c':
  Revert dl_fbase initialization to the address where the shared object is loaded.
2012-09-26 10:43:00 -07:00
Elliott Hughes
3307bff023 Merge "Revert dl_fbase initialization to the address where the shared object is loaded." 2012-09-26 10:38:10 -07:00
Nick Kralevich
cd587701c8 FORTIFY_SOURCE: add umask check
Verify that the call to umask makes sense. While this wouldn't
have detected bug 7094213 (because the low order bits were all zero),
it might detect other similar bugs.

References: https://code.google.com/p/android-source-browsing/source/detail?r=acba45cc4b1f98f67fcdeda2f7c13ed57659b92a&repo=platform--libcore

Change-Id: I966a531d6b3cf8e1c5eacd69bd3cbec475b5fa58
2012-09-26 10:19:31 -07:00
Raghu Gandham
0e77287209 Replace __unused in kernel headers with __linux_unused to avoid
conflicts with __unused macro in sys/cdefs.h

Change-Id: Ice664397e0b7c7a90795012f30be5e43a9675525
2012-09-25 17:54:43 -07:00
Raghu Gandham
e6dc2a664e Revert dl_fbase initialization to the address where the shared object is loaded.
Change-Id: If868cab774a1ae5ff370208216cecda9b8c3b9fd
2012-09-25 15:58:01 -07:00
Elliott Hughes
0eb4f255d2 am 6e0e03c3: Merge "Add the cleaned kernel headers"
* commit '6e0e03c38bc0e864225b89b3fb273fb56ded8940':
  Add the cleaned kernel headers
2012-09-24 13:47:29 -07:00
Elliott Hughes
6e0e03c38b Merge "Add the cleaned kernel headers" 2012-09-24 13:39:33 -07:00
Elliott Hughes
c746bed889 am 7b0377ed: Merge "[MIPS] Removed the unused header"
* commit '7b0377eda03abc9db79faa244e28aea1ac7b64da':
  [MIPS] Removed the unused header
2012-09-24 12:41:20 -07:00
Raghu Gandham
bfeb8a98b6 Add the cleaned kernel headers
Change-Id: Ied4e3ca765672ebaebe9d4d0909b3278c2ff3cd8
2012-09-24 12:33:57 -07:00
Elliott Hughes
7b0377eda0 Merge "[MIPS] Removed the unused header" 2012-09-24 12:24:01 -07:00
Raghu Gandham
d769826b0d [MIPS] Removed the unused header
Change-Id: I8756a862669d4e5f283945496983f11a59dea30c
2012-09-24 11:52:00 -07:00
Elliott Hughes
d5c654c053 am 3b6914bf: Merge "Fix dlsym and dladdr to use load_bias instead of base"
* commit '3b6914bf04942f74e9dba43a75d5d5ae94161b95':
  Fix dlsym and dladdr to use load_bias instead of base
2012-09-24 10:21:23 -07:00
Elliott Hughes
3b6914bf04 Merge "Fix dlsym and dladdr to use load_bias instead of base" 2012-09-24 10:03:51 -07:00
Raghu Gandham
c1993cac40 Fix dlsym and dladdr to use load_bias instead of base
Change-Id: If0f9aa944ccb1f90451aa6674428e34494331d2d
2012-09-21 17:00:30 -07:00
Xiaokang Qin
9c3449ecd9 bionic: linker: Need update the map->l_addr for execution.
Currently, linker doesn't update the map->l_addr for execution.
Which could break the Unwind_Backtrace with PT_GNU_EH_FRAME enabled
in new toolchain.

Change-Id: Ifbd853134da64a962f7e4c4105e56a3f20def1b2
Author: Fengwei Yin <fengwei.yin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 57077
2012-09-13 18:09:20 +08:00
160 changed files with 1861 additions and 971 deletions

View File

@@ -8,68 +8,14 @@ libc_common_src_files := \
$(syscall_src) \
unistd/abort.c \
unistd/alarm.c \
unistd/brk.c \
unistd/daemon.c \
unistd/eventfd.c \
unistd/exec.c \
unistd/fcntl.c \
unistd/fnmatch.c \
unistd/fstatfs.c \
unistd/ftime.c \
unistd/ftok.c \
unistd/getdtablesize.c \
unistd/gethostname.c \
unistd/getopt_long.c \
unistd/getpgrp.c \
unistd/getpriority.c \
unistd/getpt.c \
unistd/initgroups.c \
unistd/isatty.c \
unistd/issetugid.c \
unistd/killpg.c \
unistd/lseek64.c \
unistd/mmap.c \
unistd/open.c \
unistd/openat.c \
unistd/opendir.c \
unistd/pathconf.c \
unistd/perror.c \
unistd/popen.c \
unistd/pread.c \
unistd/pselect.c \
unistd/ptsname.c \
unistd/ptsname_r.c \
unistd/pwrite.c \
unistd/raise.c \
unistd/reboot.c \
unistd/recv.c \
unistd/sbrk.c \
unistd/send.c \
unistd/setegid.c \
unistd/setuid.c \
unistd/seteuid.c \
unistd/setreuid.c \
unistd/setresuid.c \
unistd/setpgrp.c \
unistd/sigblock.c \
unistd/siginterrupt.c \
unistd/siglist.c \
unistd/signal.c \
unistd/signame.c \
unistd/sigsetmask.c \
unistd/sigsuspend.c \
unistd/sigwait.c \
unistd/sleep.c \
unistd/statfs.c \
unistd/syslog.c \
unistd/system.c \
unistd/tcgetpgrp.c \
unistd/tcsetpgrp.c \
unistd/time.c \
unistd/umount.c \
unistd/unlockpt.c \
unistd/usleep.c \
unistd/wait.c \
stdio/asprintf.c \
stdio/clrerr.c \
stdio/fclose.c \
@@ -84,7 +30,6 @@ libc_common_src_files := \
stdio/fileno.c \
stdio/findfp.c \
stdio/flags.c \
stdio/flockfile.c \
stdio/fopen.c \
stdio/fprintf.c \
stdio/fpurge.c \
@@ -123,7 +68,6 @@ libc_common_src_files := \
stdio/sscanf.c \
stdio/stdio.c \
stdio/tempnam.c \
stdio/tmpfile.c \
stdio/tmpnam.c \
stdio/ungetc.c \
stdio/vasprintf.c \
@@ -136,37 +80,19 @@ libc_common_src_files := \
stdio/vsscanf.c \
stdio/wbuf.c \
stdio/wsetup.c \
stdio/__fgets_chk.c \
stdio/__snprintf_chk.c \
stdio/__sprintf_chk.c \
stdio/__vsnprintf_chk.c \
stdio/__vsprintf_chk.c \
stdlib/_rand48.c \
stdlib/assert.c \
stdlib/atexit.c \
stdlib/atoi.c \
stdlib/atol.c \
stdlib/atoll.c \
stdlib/bsearch.c \
stdlib/ctype_.c \
stdlib/div.c \
stdlib/exit.c \
stdlib/getenv.c \
stdlib/jrand48.c \
stdlib/ldiv.c \
stdlib/lldiv.c \
stdlib/locale.c \
stdlib/lrand48.c \
stdlib/mrand48.c \
stdlib/nrand48.c \
stdlib/putenv.c \
stdlib/qsort.c \
stdlib/seed48.c \
stdlib/setenv.c \
stdlib/setjmperr.c \
stdlib/srand48.c \
stdlib/strntoimax.c \
stdlib/strntoumax.c \
stdlib/strtod.c \
stdlib/strtoimax.c \
stdlib/strtol.c \
@@ -176,50 +102,29 @@ libc_common_src_files := \
stdlib/strtoumax.c \
stdlib/tolower_.c \
stdlib/toupper_.c \
stdlib/wchar.c \
string/index.c \
string/memccpy.c \
string/memchr.c \
string/memmem.c \
string/memrchr.c \
string/memswap.c \
string/strcasecmp.c \
string/strcasestr.c \
string/strcat.c \
string/strchr.c \
string/strcoll.c \
string/strcspn.c \
string/strdup.c \
string/strlcat.c \
string/strlcpy.c \
string/strncat.c \
string/strncpy.c \
string/strndup.c \
string/strnlen.c \
string/strpbrk.c \
string/strrchr.c \
string/strsep.c \
string/strspn.c \
string/strstr.c \
string/strtok.c \
string/strtotimeval.c \
string/__memcpy_chk.c \
string/__memmove_chk.c \
string/__memset_chk.c \
string/__strcat_chk.c \
string/__strcpy_chk.c \
string/__strlcat_chk.c \
string/__strlcpy_chk.c \
string/__strlen_chk.c \
string/__strncat_chk.c \
string/__strncpy_chk.c \
wchar/wcpcpy.c \
wchar/wcpncpy.c \
wchar/wcscasecmp.c \
wchar/wcscat.c \
wchar/wcschr.c \
wchar/wcscmp.c \
wchar/wcscoll.c \
wchar/wcscpy.c \
wchar/wcscspn.c \
wchar/wcsdup.c \
@@ -243,61 +148,148 @@ libc_common_src_files := \
wchar/wmemcpy.c \
wchar/wmemmove.c \
wchar/wmemset.c \
inet/bindresvport.c \
inet/inet_addr.c \
inet/inet_aton.c \
inet/inet_ntoa.c \
inet/inet_ntop.c \
inet/inet_pton.c \
inet/ether_aton.c \
inet/ether_ntoa.c \
tzcode/asctime.c \
tzcode/difftime.c \
tzcode/localtime.c \
tzcode/strftime.c \
tzcode/strptime.c \
bionic/__set_errno.c \
bionic/bionic_clone.c \
bionic/cpuacct.c \
bionic/arc4random.c \
bionic/atoi.c \
bionic/atol.c \
bionic/atoll.c \
bionic/basename.c \
bionic/basename_r.c \
bionic/bindresvport.c \
bionic/bionic_clone.c \
bionic/brk.c \
bionic/clearenv.c \
bionic/cpuacct.c \
bionic/daemon.c \
bionic/dirname.c \
bionic/dirname_r.c \
bionic/drand48.c \
bionic/erand48.c \
bionic/err.c \
bionic/ether_aton.c \
bionic/ether_ntoa.c \
bionic/eventfd.c \
bionic/fcntl.c \
bionic/fdprintf.c \
bionic/__fgets_chk.c \
bionic/flockfile.c \
bionic/fork.c \
bionic/fstatfs.c \
bionic/ftime.c \
bionic/ftok.c \
bionic/fts.c \
bionic/getcwd.cpp \
bionic/if_nametoindex.c \
bionic/getdtablesize.c \
bionic/gethostname.c \
bionic/getpgrp.c \
bionic/getpriority.c \
bionic/getpt.c \
bionic/if_indextoname.c \
bionic/if_nametoindex.c \
bionic/initgroups.c \
bionic/ioctl.c \
bionic/isatty.c \
bionic/issetugid.c \
bionic/ldexp.c \
bionic/libc_init_common.c \
bionic/locale.c \
bionic/logd_write.c \
bionic/lseek64.c \
bionic/md5.c \
bionic/memccpy.c \
bionic/memchr.c \
bionic/__memcpy_chk.c \
bionic/memmem.c \
bionic/__memmove_chk.c \
bionic/memmove_words.c \
bionic/memrchr.c \
bionic/__memset_chk.c \
bionic/memswap.c \
bionic/mmap.c \
bionic/openat.c \
bionic/open.c \
bionic/opendir.c \
bionic/pathconf.c \
bionic/perror.c \
bionic/pread.c \
bionic/pselect.c \
bionic/ptsname.c \
bionic/ptsname_r.c \
bionic/pututline.c \
bionic/pwrite.c \
bionic/raise.c \
bionic/realpath.c \
bionic/sched_getaffinity.c \
bionic/sched_getcpu.c \
bionic/reboot.c \
bionic/recv.c \
bionic/sbrk.c \
bionic/sched_cpualloc.c \
bionic/sched_cpucount.c \
bionic/sched_getaffinity.c \
bionic/sched_getcpu.c \
bionic/semaphore.c \
bionic/send.c \
bionic/setegid.c \
bionic/__set_errno.c \
bionic/seteuid.c \
bionic/setpgrp.c \
bionic/setresuid.c \
bionic/setreuid.c \
bionic/setuid.c \
bionic/sha1.c \
bionic/sigblock.c \
bionic/siginterrupt.c \
bionic/siglist.c \
bionic/signal.c \
bionic/signame.c \
bionic/sigsetmask.c \
bionic/sigsuspend.c \
bionic/sigwait.c \
bionic/sleep.c \
bionic/__snprintf_chk.c \
bionic/__sprintf_chk.c \
bionic/statfs.c \
bionic/__strcat_chk.c \
bionic/strcoll.c \
bionic/__strcpy_chk.c \
bionic/strerror.cpp \
bionic/strerror_r.cpp \
bionic/__strlcat_chk.c \
bionic/__strlcpy_chk.c \
bionic/__strlen_chk.c \
bionic/__strncat_chk.c \
bionic/__strncpy_chk.c \
bionic/strndup.c \
bionic/strnlen.c \
bionic/strntoimax.c \
bionic/strntoumax.c \
bionic/strsignal.cpp \
bionic/strtotimeval.c \
bionic/stubs.cpp \
bionic/system_properties.c \
bionic/tcgetpgrp.c \
bionic/tcsetpgrp.c \
bionic/tdestroy.c \
bionic/time64.c \
bionic/thread_atexit.c \
bionic/time64.c \
bionic/tmpfile.cpp \
bionic/__umask_chk.c \
bionic/umount.c \
bionic/unlockpt.c \
bionic/usleep.c \
bionic/utime.c \
bionic/utmp.c \
bionic/__vsnprintf_chk.c \
bionic/__vsprintf_chk.c \
bionic/wait.c \
bionic/wchar.c \
bionic/wcscoll.c \
netbsd/gethnamaddr.c \
netbsd/isc/ev_timers.c \
netbsd/isc/ev_streams.c \
@@ -339,6 +331,17 @@ libc_upstream_netbsd_src_files := \
upstream-netbsd/libc/regex/regerror.c \
upstream-netbsd/libc/regex/regexec.c \
upstream-netbsd/libc/regex/regfree.c \
upstream-netbsd/libc/stdio/getdelim.c \
upstream-netbsd/libc/stdio/getline.c \
upstream-netbsd/libc/stdlib/drand48.c \
upstream-netbsd/libc/stdlib/erand48.c \
upstream-netbsd/libc/stdlib/jrand48.c \
upstream-netbsd/libc/stdlib/lrand48.c \
upstream-netbsd/libc/stdlib/mrand48.c \
upstream-netbsd/libc/stdlib/nrand48.c \
upstream-netbsd/libc/stdlib/_rand48.c \
upstream-netbsd/libc/stdlib/seed48.c \
upstream-netbsd/libc/stdlib/srand48.c \
upstream-netbsd/libc/stdlib/tdelete.c \
upstream-netbsd/libc/stdlib/tfind.c \
upstream-netbsd/libc/stdlib/tsearch.c \
@@ -358,40 +361,40 @@ libc_upstream_netbsd_src_files := \
# below.
#
libc_static_common_src_files := \
unistd/sysconf.c \
bionic/__errno.c \
bionic/sysconf.c \
# Architecture specific source files go here
# =========================================================
ifeq ($(TARGET_ARCH),arm)
libc_common_src_files += \
arch-arm/bionic/__get_sp.S \
arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/_setjmp.S \
arch-arm/bionic/abort_arm.S \
arch-arm/bionic/atomics_arm.c \
arch-arm/bionic/clone.S \
arch-arm/bionic/eabi.c \
arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/ffs.S \
arch-arm/bionic/futex_arm.S \
arch-arm/bionic/__get_sp.S \
arch-arm/bionic/kill.S \
arch-arm/bionic/libgcc_compat.c \
arch-arm/bionic/tkill.S \
arch-arm/bionic/tgkill.S \
arch-arm/bionic/memcmp.S \
arch-arm/bionic/memcmp16.S \
arch-arm/bionic/memcmp.S \
arch-arm/bionic/memcpy.S \
arch-arm/bionic/memset.S \
arch-arm/bionic/_setjmp.S \
arch-arm/bionic/setjmp.S \
arch-arm/bionic/sigsetjmp.S \
arch-arm/bionic/strlen.c.arm \
arch-arm/bionic/strcpy.S \
arch-arm/bionic/strcmp.S \
arch-arm/bionic/strcpy.S \
arch-arm/bionic/strlen.c.arm \
arch-arm/bionic/syscall.S \
string/memmove.c.arm \
arch-arm/bionic/tgkill.S \
arch-arm/bionic/tkill.S \
bionic/memmove.c.arm \
bionic/socketcalls.c \
string/bcopy.c \
string/strncmp.c \
unistd/socketcalls.c
# These files need to be arm so that gdbserver
# can set breakpoints in them without messing
@@ -476,8 +479,8 @@ libc_common_src_files += \
arch-mips/string/mips_strlen.c
libc_common_src_files += \
bionic/memcmp.c \
string/bcopy.c \
string/memcmp.c \
string/strcmp.c \
string/strcpy.c \
string/strncmp.c

View File

@@ -438,6 +438,40 @@ SUCH DAMAGE.
-------------------------------------------------------------------
Copyright (c) 1982, 1986, 1993
The Regents of the University of California. All rights reserved.
(c) UNIX System Laboratories, Inc.
All or some portions of this file are derived from material licensed
to the University of California by American Telephone and Telegraph
Co. or Unix System Laboratories, Inc. and are reproduced herein with
the permission of UNIX System Laboratories, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-------------------------------------------------------------------
Copyright (c) 1983, 1987, 1989
The Regents of the University of California. All rights reserved.
@@ -3833,6 +3867,33 @@ SUCH DAMAGE.
-------------------------------------------------------------------
Copyright (c) 2009 The NetBSD Foundation, Inc.
This code is derived from software contributed to The NetBSD Foundation
by Roy Marples.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------
Copyright (c) 2010 MIPS Technologies, Inc.
All rights reserved.

View File

@@ -288,7 +288,7 @@ int delete_module(const char*, unsigned int) 129
int klogctl:syslog(int, char *, int) 103
int sysinfo(struct sysinfo *) 116
int personality(unsigned long) 136
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364,336,333
# futex
int futex(void *, int, int, void *, void *, int) 240,240,238

53
libc/bionic/__umask_chk.c Normal file
View File

@@ -0,0 +1,53 @@
/*
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#undef _FORTIFY_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <private/logd.h>
#include <stdlib.h>
/*
* Runtime implementation of __umask_chk.
*
* Validate that umask is called with sane mode.
*
* This umask check is called if _FORTIFY_SOURCE is defined and
* greater than 0.
*/
mode_t __umask_chk(mode_t mode)
{
if ((mode & 0777) != mode) {
__libc_android_log_print(ANDROID_LOG_FATAL, "libc",
"*** FORTIFY_SOURCE: umask called with invalid mask ***\n");
abort();
}
return umask(mode);
}

View File

@@ -40,22 +40,23 @@ char* getcwd(char* buf, size_t size) {
// Allocate a buffer if necessary.
char* allocated_buf = NULL;
size_t allocated_size = size;
if (buf == NULL) {
size_t allocated_size = size;
if (size == 0) {
// The Linux kernel won't return more than a page, so translate size 0 to 4KiB.
// TODO: if we need to support paths longer than that, we'll have to walk the tree ourselves.
size = getpagesize();
allocated_size = getpagesize();
}
buf = allocated_buf = static_cast<char*>(malloc(allocated_size));
if (buf == NULL) {
// malloc set errno.
// malloc should set errno, but valgrind's malloc wrapper doesn't.
errno = ENOMEM;
return NULL;
}
}
// Ask the kernel to fill our buffer.
int rc = __getcwd(buf, size);
int rc = __getcwd(buf, allocated_size);
if (rc == -1) {
free(allocated_buf);
// __getcwd set errno.

View File

@@ -26,31 +26,30 @@
* SUCH DAMAGE.
*/
#include <errno.h>
#include <pthread.h>
#include <time.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <dlfcn.h>
#include <errno.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stddef.h>
#include <stdarg.h>
#include <fcntl.h>
#include <unwind.h>
#include <dlfcn.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/system_properties.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <unwind.h>
#include "dlmalloc.h"
#include "logd.h"
#include "malloc_debug_common.h"
#include "malloc_debug_check_mapinfo.h"
#include "malloc_debug_common.h"
#include "ScopedPthreadMutexLocker.h"
static mapinfo *milist;
@@ -407,14 +406,16 @@ extern "C" void chk_free(void *ptr) {
extern "C" void *chk_realloc(void *ptr, size_t size) {
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
if (!ptr) {
return chk_malloc(size);
}
#ifdef REALLOC_ZERO_BYTES_FREE
if (!size) {
chk_free(ptr);
return NULL;
}
if (!ptr) {
return chk_malloc(size);
}
#endif
hdr_t* hdr = meta(ptr);

View File

@@ -40,12 +40,15 @@
* or static (libc.a) linking.
*/
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include "dlmalloc.h"
#include "malloc_debug_common.h"
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include "dlmalloc.h"
#include "ScopedPthreadMutexLocker.h"
/*
* In a VM process, this is set to 1 after fork()ing out of zygote.
*/
@@ -376,7 +379,7 @@ static void malloc_init_impl() {
}
}
// Lets see which .so must be loaded for the requested debug level
// Choose the appropriate .so for the requested debug level.
switch (debug_level) {
case 1:
case 5:

View File

@@ -33,6 +33,8 @@
#ifndef MALLOC_DEBUG_COMMON_H
#define MALLOC_DEBUG_COMMON_H
#include <stdlib.h>
#define HASHTABLE_SIZE 1543
#define BACKTRACE_SIZE 32
/* flag definitions, currently sharing storage with "size" */
@@ -101,18 +103,4 @@ typedef void (*MallocDebugFini)();
#define info_log(format, ...) \
__libc_android_log_print(ANDROID_LOG_INFO, "malloc_leak_check", (format), ##__VA_ARGS__ )
class ScopedPthreadMutexLocker {
public:
explicit ScopedPthreadMutexLocker(pthread_mutex_t* mu) : mu_(mu) {
pthread_mutex_lock(mu_);
}
~ScopedPthreadMutexLocker() {
pthread_mutex_unlock(mu_);
}
private:
pthread_mutex_t* mu_;
};
#endif // MALLOC_DEBUG_COMMON_H

View File

@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
#include <arpa/inet.h>
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
@@ -36,19 +37,18 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <unwind.h>
#include <arpa/inet.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/system_properties.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#include <unwind.h>
#include "dlmalloc.h"
#include "logd.h"
#include "malloc_debug_common.h"
#include "ScopedPthreadMutexLocker.h"
// This file should be included into the build only when
// MALLOC_LEAK_CHECK, or MALLOC_QEMU_INSTRUMENT, or both
@@ -366,7 +366,7 @@ extern "C" void* leak_memalign(size_t alignment, size_t bytes) {
alignment = 1L << (31 - __builtin_clz(alignment));
}
// here, aligment is at least MALLOC_ALIGNMENT<<1 bytes
// here, alignment is at least MALLOC_ALIGNMENT<<1 bytes
// we will align by at least MALLOC_ALIGNMENT bytes
// and at most alignment-MALLOC_ALIGNMENT bytes
size_t size = (alignment-MALLOC_ALIGNMENT) + bytes;

View File

@@ -163,20 +163,20 @@ __get_stack_base(int *p_stack_size)
}
void __init_tls(void** tls, void* thread)
{
int nn;
void __init_tls(void** tls, void* thread) {
((pthread_internal_t*) thread)->tls = tls;
((pthread_internal_t*)thread)->tls = tls;
// Zero-initialize all the slots.
for (size_t i = 0; i < BIONIC_TLS_SLOTS; ++i) {
tls[i] = NULL;
}
// slot 0 must point to the tls area, this is required by the implementation
// of the x86 Linux kernel thread-local-storage
tls[TLS_SLOT_SELF] = (void*)tls;
tls[TLS_SLOT_THREAD_ID] = thread;
for (nn = TLS_SLOT_ERRNO; nn < BIONIC_TLS_SLOTS; nn++)
tls[nn] = 0;
// Slot 0 must point to the tls area, this is required by the implementation
// of the x86 Linux kernel thread-local-storage.
tls[TLS_SLOT_SELF] = (void*) tls;
tls[TLS_SLOT_THREAD_ID] = thread;
__set_tls( (void*)tls );
__set_tls((void*) tls);
}

View File

@@ -45,6 +45,13 @@ typedef struct pthread_internal_t
int internal_flags;
__pthread_cleanup_t* cleanup_stack;
void** tls; /* thread-local storage area */
/*
* The dynamic linker implements dlerror(3), which makes it hard for us to implement this
* per-thread buffer by simply using malloc(3) and free(3).
*/
#define __BIONIC_DLERROR_BUFFER_SIZE 512
char dlerror_buffer[__BIONIC_DLERROR_BUFFER_SIZE];
} pthread_internal_t;
int _init_thread(pthread_internal_t* thread, pid_t kernel_id, pthread_attr_t* attr,

View File

@@ -41,6 +41,6 @@ char* strerror(int error_number) {
}
LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, strerror, NL_TEXTMAX);
strerror_r(error_number, strerror_buffer, strerror_buffer_size);
return strerror_buffer;
strerror_r(error_number, strerror_tls_buffer, strerror_tls_buffer_size);
return strerror_tls_buffer;
}

View File

@@ -42,5 +42,5 @@ char* strsignal(int signal_number) {
}
LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, strsignal, NL_TEXTMAX);
return const_cast<char*>(__strsignal(signal_number, strsignal_buffer, strsignal_buffer_size));
return const_cast<char*>(__strsignal(signal_number, strsignal_tls_buffer, strsignal_tls_buffer_size));
}

Some files were not shown because too many files have changed in this diff Show More