Deleted Added
full compact
libpthread_db.c (133802) libpthread_db.c (133805)
1/*
2 * Copyright (c) 2004 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2004 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libthread_db/libpthread_db.c 133802 2004-08-16 03:30:16Z davidxu $");
28__FBSDID("$FreeBSD: head/lib/libthread_db/libpthread_db.c 133805 2004-08-16 05:20:12Z davidxu $");
29
30#include <stddef.h>
31#include <stdlib.h>
32#include <string.h>
33#include <unistd.h>
34#include <pthread.h>
35#include <sys/types.h>
36#include <sys/kse.h>

--- 358 unchanged lines hidden (view full) ---

395
396 TDBG_FUNC();
397
398 keytable = malloc(ta->thread_max_keys * ta->thread_size_key);
399 if (keytable == NULL)
400 return (TD_MALLOC);
401 ret = ps_pread(ta->ph, (psaddr_t)ta->thread_keytable_addr, keytable,
402 ta->thread_max_keys * ta->thread_size_key);
29
30#include <stddef.h>
31#include <stdlib.h>
32#include <string.h>
33#include <unistd.h>
34#include <pthread.h>
35#include <sys/types.h>
36#include <sys/kse.h>

--- 358 unchanged lines hidden (view full) ---

395
396 TDBG_FUNC();
397
398 keytable = malloc(ta->thread_max_keys * ta->thread_size_key);
399 if (keytable == NULL)
400 return (TD_MALLOC);
401 ret = ps_pread(ta->ph, (psaddr_t)ta->thread_keytable_addr, keytable,
402 ta->thread_max_keys * ta->thread_size_key);
403 if (ret != 0)
403 if (ret != 0) {
404 free(keytable);
404 return (P2T(ret));
405 return (P2T(ret));
406 }
405 for (i = 0; i < ta->thread_max_keys; i++) {
406 allocated = *(int *)(keytable + i * ta->thread_size_key +
407 ta->thread_off_key_allocated);
408 destructor = *(void **)(keytable + i * ta->thread_size_key +
409 ta->thread_off_key_destructor);
410 if (allocated) {
411 ret = (ki)(i, destructor, arg);
412 if (ret != 0) {

--- 595 unchanged lines hidden ---
407 for (i = 0; i < ta->thread_max_keys; i++) {
408 allocated = *(int *)(keytable + i * ta->thread_size_key +
409 ta->thread_off_key_allocated);
410 destructor = *(void **)(keytable + i * ta->thread_size_key +
411 ta->thread_off_key_destructor);
412 if (allocated) {
413 ret = (ki)(i, destructor, arg);
414 if (ret != 0) {

--- 595 unchanged lines hidden ---