diff options
author | Elliott Hughes <enh@google.com> | 2013-03-29 23:47:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-03-29 23:47:24 +0000 |
commit | 6bb17dfad36edda68da46c2bf68c4297a160ab8a (patch) | |
tree | c64519db5533b9324efe7e4a712ba327860bbb9d /libc | |
parent | 74b324ac09db35d29d16695e9b9c1f0601599812 (diff) | |
parent | cfa089df23ff50fcd5ed3854c54991d30be5fc7e (diff) | |
download | android_bionic-6bb17dfad36edda68da46c2bf68c4297a160ab8a.tar.gz android_bionic-6bb17dfad36edda68da46c2bf68c4297a160ab8a.tar.bz2 android_bionic-6bb17dfad36edda68da46c2bf68c4297a160ab8a.zip |
Merge "Extra logging in pthread_create."
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/pthread_create.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp index 15f18aa2f..70a9bf533 100644 --- a/libc/bionic/pthread_create.cpp +++ b/libc/bionic/pthread_create.cpp @@ -153,6 +153,7 @@ int pthread_create(pthread_t* thread_out, pthread_attr_t const* attr, pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(calloc(sizeof(*thread), 1)); if (thread == NULL) { + __libc_format_log(ANDROID_LOG_WARN, "libc", "pthread_create failed: couldn't allocate thread"); return EAGAIN; } thread->allocated_on_heap = true; @@ -172,6 +173,7 @@ int pthread_create(pthread_t* thread_out, pthread_attr_t const* attr, thread->attr.stack_base = __create_thread_stack(stack_size, thread->attr.guard_size); if (thread->attr.stack_base == NULL) { free(thread); + __libc_format_log(ANDROID_LOG_WARN, "libc", "pthread_create failed: couldn't allocate %zd-byte stack", stack_size); return EAGAIN; } } else { @@ -203,6 +205,7 @@ int pthread_create(pthread_t* thread_out, pthread_attr_t const* attr, munmap(thread->attr.stack_base, stack_size); } free(thread); + __libc_format_log(ANDROID_LOG_WARN, "libc", "pthread_create failed: clone failed: %s", strerror(errno)); return clone_errno; } |