cvs diff: Diffing . cvs diff: Diffing bin cvs diff: Diffing bin/finger cvs diff: Diffing bin/finger.working cvs diff: Diffing book cvs diff: Diffing book/chapter7_example1 cvs diff: Diffing config cvs diff: Diffing datalib cvs diff: Diffing dce_compat cvs diff: Diffing doc cvs diff: Diffing gen =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/gen/isatty.c,v retrieving revision 1.4 diff -r1.4 isatty.c 38a39,41 > #ifdef hpux > #define _INCLUDE_TERMIO > #endif cvs diff: Diffing include =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/include/signal.h,v retrieving revision 1.1 diff -r1.1 signal.h 64a65 > #ifndef hpux 68a70 > #endif cvs diff: Diffing include/arpa cvs diff: Diffing include/pthread =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/include/pthread/debug_out.h,v retrieving revision 1.1 diff -r1.1 debug_out.h 2c2,4 < to printf() and gang are ill-advised. */ --- > to printf() and gang are ill-advised. may produce > very ugly output if interwoven with calls to buffered > I/O primitives. */ 5,24c7,38 < #define PTHREAD_DEBUG_WriteStr(S) (void)machdep_sys_write(2,S,strlen(S)) < #define PTHREAD_DEBUG_WriteInt32Hex(X) \ < { char _xbuf[8]; int _temp = (int)(X), _temp2; \ < _temp2 = ((_temp>>28)&0xf); \ < _xbuf[0] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < _temp2 = ((_temp>>24)&0xf); \ < _xbuf[1] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < _temp2 = ((_temp>>20)&0xf); \ < _xbuf[2] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < _temp2 = ((_temp>>16)&0xf); \ < _xbuf[3] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < _temp2 = ((_temp>>12)&0xf); \ < _xbuf[4] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < _temp2 = ((_temp>>8)&0xf); \ < _xbuf[5] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < _temp2 = ((_temp>>4)&0xf); \ < _xbuf[6] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < _temp2 = (_temp&0xf); \ < _xbuf[7] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ < (void)machdep_sys_write(2,_xbuf,8); \ --- > > #define PTHREAD_DEBUG_WriteBytes(B,Z) \ > { int _count=(Z); char *_buf=((char*)(B)); \ > while (_count > 0) { \ > int _n = -1; \ > while (_n < 0) _n=machdep_sys_write(2,_buf,_count); \ > _count -= _n; \ > _buf += _n; \ > } \ > } > > #define PTHREAD_DEBUG_WriteStr(S) PTHREAD_DEBUG_WriteBytes(S,strlen(S)) > > #define PTHREAD_DEBUG_WriteInt32Hex(X) \ > { char _xbuf[8]; int _temp = (int)(X), _temp2; \ > _temp2 = ((_temp>>28)&0xf); \ > _xbuf[0] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > _temp2 = ((_temp>>24)&0xf); \ > _xbuf[1] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > _temp2 = ((_temp>>20)&0xf); \ > _xbuf[2] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > _temp2 = ((_temp>>16)&0xf); \ > _xbuf[3] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > _temp2 = ((_temp>>12)&0xf); \ > _xbuf[4] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > _temp2 = ((_temp>>8)&0xf); \ > _xbuf[5] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > _temp2 = ((_temp>>4)&0xf); \ > _xbuf[6] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > _temp2 = (_temp&0xf); \ > _xbuf[7] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \ > PTHREAD_DEBUG_WriteBytes(_xbuf,8); \ 25a40,102 > > #define PTHREAD_DEBUG_WriteInt16Dec(X) \ > { char _dbuf[32]; short _temp = (short)(X), _temp2, _temp3,_temp4; \ > _temp4 = (_temp<0)? 1: 0; \ > if (_temp4) _temp=-_temp; \ > _temp2 = sizeof(_dbuf); \ > _temp3 = 0; \ > do { \ > _dbuf[--_temp2] = (_temp%10) + '0'; \ > _temp /= 10; \ > _temp3++; \ > } while (_temp && (_temp2>=0)); \ > if (_temp4 && (_temp2>=0)) { \ > _dbuf[--_temp2]='-'; \ > _temp3++; \ > } \ > PTHREAD_DEBUG_WriteBytes(&_dbuf[_temp2],_temp3); \ > } > > #define PTHREAD_DEBUG_WriteUInt16Dec(X) \ > { char _dbuf[32]; unsigned short _temp = (unsigned short)(X); \ > short _temp2, _temp3; \ > _temp2 = sizeof(_dbuf); \ > _temp3 = 0; \ > do { \ > _dbuf[--_temp2] = (_temp%10) + '0'; \ > _temp /= 10; \ > _temp3++; \ > } while (_temp && (_temp2>=0)); \ > PTHREAD_DEBUG_WriteBytes(&_dbuf[_temp2],_temp3); \ > } > > #define PTHREAD_DEBUG_WriteInt32Dec(X) \ > { char _dbuf[64]; int _temp = (int)(X), _temp2, _temp3,_temp4; \ > _temp4 = (_temp<0)? 1: 0; \ > if (_temp4) _temp=-_temp; \ > _temp2 = sizeof(_dbuf); \ > _temp3 = 0; \ > do { \ > _dbuf[--_temp2] = (_temp%10) + '0'; \ > _temp /= 10; \ > _temp3++; \ > } while (_temp && (_temp2>=0)); \ > if (_temp4 && (_temp2>=0)) { \ > _dbuf[--_temp2]='-'; \ > _temp3++; \ > } \ > PTHREAD_DEBUG_WriteBytes(&_dbuf[_temp2],_temp3); \ > } > > #define PTHREAD_DEBUG_WriteUInt32Dec(X) \ > { char _dbuf[64]; unsigned _temp = (unsigned)(X); \ > int _temp2, _temp3; \ > _temp2 = sizeof(_dbuf); \ > _temp3 = 0; \ > do { \ > _dbuf[--_temp2] = (_temp%10) + '0'; \ > _temp /= 10; \ > _temp3++; \ > } while (_temp && (_temp2>=0)); \ > PTHREAD_DEBUG_WriteBytes(&_dbuf[_temp2],_temp3); \ > } > 27,32c104,128 < #define PTHREAD_DEBUG_WriteInt64Hex(X) \ < { long _tempX = (long)(X),_tempY; \ < _tempY=((_tempX>>32)&0xffffffff); \ < PTHREAD_DEBUG_WriteInt32Hex(_tempY); \ < _tempY=(_tempX&0xffffffff); \ < PTHREAD_DEBUG_WriteInt32Hex(_tempY); \ --- > > #define PTHREAD_DEBUG_WriteInt64Hex(X) \ > { long _tempX = (long)(X),_tempY; \ > _tempY=((_tempX>>32)&0xffffffff); \ > PTHREAD_DEBUG_WriteInt32Hex(_tempY); \ > _tempY=(_tempX&0xffffffff); \ > PTHREAD_DEBUG_WriteInt32Hex(_tempY); \ > } > > #define PTHREAD_DEBUG_WriteInt64Dec(X) \ > { char _dbuf[128]; long _temp = (long)(X), _temp2, _temp3,_temp4; \ > _temp4 = (_temp<0)? 1: 0; \ > if (_temp4) _temp=-_temp; \ > _temp2 = sizeof(_dbuf); \ > _temp3 = 0; \ > do { \ > _dbuf[--_temp2] = (_temp%10) + '0'; \ > _temp /= 10; \ > _temp3++; \ > } while (_temp && (_temp2>=0)); \ > if (_temp4 && (_temp2>=0)) { \ > _dbuf[--_temp2]='-'; \ > _temp3++; \ > } \ > PTHREAD_DEBUG_WriteBytes(&_dbuf[_temp2],_temp3); \ 33a130,143 > > #define PTHREAD_DEBUG_WriteUInt64Dec(X) \ > { char _dbuf[128]; unsigned long _temp = (unsigned long)(X); \ > long _temp2, _temp3; \ > _temp2 = sizeof(_dbuf); \ > _temp3 = 0; \ > do { \ > _dbuf[--_temp2] = (_temp%10) + '0'; \ > _temp /= 10; \ > _temp3++; \ > } while (_temp && (_temp2>=0)); \ > PTHREAD_DEBUG_WriteBytes(&_dbuf[_temp2],_temp3); \ > } > 35,37c145,152 < #else < #define PTHREAD_DEBUG_WriteInt64Hex(X) PTHREAD_DEBUG_WriteInt32Hex(X) < #define PTHREAD_DEBUG_WritePointer(X) PTHREAD_DEBUG_WriteInt32Hex(X) --- > > #else /* ! __alpha */ > > #define PTHREAD_DEBUG_WriteInt64Hex(X) PTHREAD_DEBUG_WriteInt32Hex(X) > #define PTHREAD_DEBUG_WriteInt64Dec(X) PTHREAD_DEBUG_WriteInt32Dec(X) > #define PTHREAD_DEBUG_WriteUInt64Dec(X) PTHREAD_DEBUG_WriteUInt32Dec(X) > #define PTHREAD_DEBUG_WritePointer(X) PTHREAD_DEBUG_WriteInt32Hex(X) > 38a154 > 39a156 > 40a158,159 > #define PTHREAD_DEBUG_WriteInt16Dec(X) > #define PTHREAD_DEBUG_WriteUInt16Dec(X) 42a162,165 > #define PTHREAD_DEBUG_WriteInt32Dec(X) > #define PTHREAD_DEBUG_WriteUInt32Dec(X) > #define PTHREAD_DEBUG_WriteInt64Dec(X) > #define PTHREAD_DEBUG_WriteUInt64Dec(X) 43a167 > cvs diff: Diffing lib cvs diff: Diffing lib/libc cvs diff: Diffing lib/libc/net cvs diff: Diffing lib/libc/stdio cvs diff: Diffing lib/libc/stdlib cvs diff: Diffing machdep =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/machdep/engine-hppa-hpux-9.03.h,v retrieving revision 1.51 diff -r1.51 engine-hppa-hpux-9.03.h 85d84 < sigset_t *sig_addr = &sig; \ 90c89 < if (sigismember(sig_addr, i)) { \ --- > if (sigismember(&sig, i)) { \ 106c105 < long machdep_state[_JBLEN]; --- > int machdep_state[_JBLEN]; =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/machdep/syscall-hppa-hpux-9.03.S,v retrieving revision 1.52 diff -r1.52 syscall-hppa-hpux-9.03.S 671a672,687 > > machdep_sys_getsockname > > .PROC > .CALLINFO NO_CALLS,FRAME=0 > > ldil -0x80000,%r1 > ble 4(%sr7,%r1) > ldi 279 ,%r22 > or,= %r0,%r22,%r0 > b,n machdep_error > bv,n %r0(%r2) > > .PROCEND > .EXPORT machdep_sys_getsockname,ENTRY > 824a841,872 > > machdep_sys_sigsuspend > > .PROC > .CALLINFO NO_CALLS,FRAME=0 > > ldil -0x80000,%r1 > ble 4(%sr7,%r1) > ldi 187,%r22 > or,= %r0,%r22,%r0 > b,n machdep_error > bv,n %r0(%r2) > > .PROCEND > .EXPORT machdep_sys_sigsuspend,ENTRY > > > machdep_sys_ftruncate > > .PROC > .CALLINFO NO_CALLS,FRAME=0 > > ldil -0x80000,%r1 > ble 4(%sr7,%r1) > ldi 130,%r22 > or,= %r0,%r22,%r0 > b,n machdep_error > bv,n %r0(%r2) > > .PROCEND > .EXPORT machdep_sys_ftruncate,ENTRY > cvs diff: Diffing machdep/alpha-osf1 cvs diff: Diffing machdep/bsdi-1.1 cvs diff: Diffing machdep/freebsd-1.1 cvs diff: Diffing machdep/hpux-9.03 =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/machdep/hpux-9.03/stdtypes.h,v retrieving revision 1.1 diff -r1.1 stdtypes.h 14,15c14,15 < #ifndef _SIGSET_T_ < #define _SIGSET_T_ --- > #ifndef _SIGSET_T > #define _SIGSET_T 19,20c19,20 < #ifndef _SPEED_T_ < #define _SPEED_T_ --- > #ifndef _SPEED_T > #define _SPEED_T 24,25c24,25 < #ifndef _TCFLAG_T_ < #define _TCFLAG_T_ --- > #ifndef _TCFLAG_T > #define _TCFLAG_T 29,30c29,30 < #ifndef _CC_T_ < #define _CC_T_ --- > #ifndef _CC_T > #define _CC_T 34,35c34,35 < #ifndef _PID_T_ < #define _PID_T_ --- > #ifndef _PID_T > #define _PID_T 39,40c39,40 < #ifndef _MODE_T_ < #define _MODE_T_ --- > #ifndef _MODE_T > #define _MODE_T 44,45c44,45 < #ifndef _NLINK_T_ < #define _NLINK_T_ --- > #ifndef _NLINK_T > #define _NLINK_T 49,50c49,50 < #ifndef _CLOCK_T_ < #define _CLOCK_T_ --- > #ifndef _CLOCK_T > #define _CLOCK_T 54,55c54,55 < #ifndef _TIME_T_ < #define _TIME_T_ --- > #ifndef _TIME_T > #define _TIME_T 59,60c59,60 < #ifndef _SIZE_T_ < #define _SIZE_T_ --- > #ifndef _SIZE_T > #define _SIZE_T 64,65c64,65 < #ifndef _PTRDIFF_T_ < #define _PTRDIFF_T_ --- > #ifndef _PTRDIFF_T > #define _PTRDIFF_T 69,70c69,70 < #ifndef _WCHAR_T_ < #define _WCHAR_T_ --- > #ifndef _WCHAR_T > #define _WCHAR_T =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/machdep/hpux-9.03/wait.h,v retrieving revision 1.50 diff -r1.50 wait.h 87c87 < pid_t wait3 __P((int *, int, struct rusage *)); --- > pid_t wait3 __P((int *, int, void *)); cvs diff: Diffing machdep/linux-1.0 cvs diff: Diffing machdep/netbsd-0.9 cvs diff: Diffing machdep/netbsd-1.0 cvs diff: Diffing machdep/sunos-4.1.3 cvs diff: Diffing machdep/sunos-5.3 cvs diff: Diffing machdep/ultrix-4.2 cvs diff: Diffing net cvs diff: Diffing pthreads =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/pthreads/fd_kern.c,v retrieving revision 1.80 diff -r1.80 fd_kern.c 1749a1750,1768 > #if defined (HAVE_SYSCALL_GETSOCKNAME) || defined (HAVE_SYSCALL_SOCKETCALL) > /* ========================================================================== > * getsockopt() > */ > int getsockname(int fd, struct sockaddr * name, int *namelen) > { > int ret; > > if ((ret = fd_lock(fd, FD_RDWR)) == OK) { > if ((ret = machdep_sys_getsockname(fd_table[fd]->fd.i, > name, namelen) < OK)) { > SET_ERRNO(-ret); > } > fd_unlock(fd, FD_RDWR); > } > return ret; > } > #endif > =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/pthreads/malloc.c,v retrieving revision 1.55 diff -r1.55 malloc.c 45a46,47 > * 1.10 94/10/01 snl > * -Added #ifdef'ed debugging capabilities 49c51 < static const char rcsid[] = "$Id: malloc.c,v 1.55 1995/03/10 04:06:43 snl Exp $"; --- > static const char rcsid[] = "$Id: malloc.c,v 1.50 1994/08/08 03:45:09 proven Exp $"; 51a54,58 > #if defined(DEBUG_MALLOC_HEAVY) && !defined(PTHREAD_DEBUGGING) > #define PTHREAD_DEBUGGING /* to get the safe output macros */ > #define PTHREAD_DEBUG_MALLOC > #endif > 55a63,68 > #if defined(DEBUG_MALLOC_HEAVY) && !defined(DEBUG_MALLOC) > #define DEBUG_MALLOC > #endif /* DEBUG_MALLOC_HEAVY && !DEBUG_MALLOC */ > #if defined(DEBUG_MALLOC_HEAVY) && !defined(RCHECK) > #define RCHECK > #endif /* DEBUG_MALLOC_HEAVY && !RCHECK */ 80,81c93,100 < size_t ovu_size; /* actual block size */ < #endif --- > u_int ovu_size; /* actual block size */ > #ifdef DEBUG_MALLOC_HEAVY > u_short ovu_freebucket; /* bucket# when free */ > u_short ovu_rmagic2; > u_short ovu_freebucket2;/* should==freebucket */ > u_short ovu_rmagic3; > #endif /* DEBUG_MALLOC_HEAVY */ > #endif /* RCHECK */ 86a106,111 > #ifdef DEBUG_MALLOC_HEAVY > #define ov_freebucket ovu.ovu_freebucket > #define ov_freebucket2 ovu.ovu_freebucket2 > #define ov_rmagic2 ovu.ovu_rmagic2 > #define ov_rmagic3 ovu.ovu_rmagic3 > #endif /* DEBUG_MALLOC_HEAVY */ 91a117,118 > #define FILLPAT 0x54 > 99,100c126,127 < * nextf[i] is the pointer to the next free block of size 2^(i+3). The < * smallest allocatable block is 8 bytes. The overhead information --- > * nextf[i] is the pointer to the next free block of size 2^(i+SMALLESTB). The > * smallest allocatable block is either 8 or 16 bytes. The overhead information 103a131,138 > > #if defined(DEBUG_MALLOC_HEAVY) > #define SMALLESTB 4 > #else > #define SMALLESTB 3 > #endif /* DEBUG_MALLOC_HEAVY */ > #define SMALLSIZE (1< 105d139 < #ifndef hpux 107d140 < #endif 109c142 < static size_t pagesz; /* page size */ --- > static int pagesz; /* page size */ 111c144,175 < static pthread_mutex_t malloc_mutex = PTHREAD_MUTEX_INITIALIZER; --- > static pthread_mutex_t malloc_mutex = PTHREAD_MUTEX_INITIALIZER; > #ifdef DEBUG_MALLOC > static union overhead *_malloc_base_ptr; > static unsigned long _malloc_heap_size; > static long _malloc_bux_used[NBUCKETS]; /* count #buckets of given size used */ > static long _malloc_bux_alloc[NBUCKETS];/* count #buckets allocated */ > static long _malloc_realloc_calls[NBUCKETS]; > static long _malloc_realloc_hits[NBUCKETS]; > #ifdef DEBUG_MALLOC_HEAVY > > /* In addition to the levels defined for checking a single pointer > [zero through 9], the following levels apply globally: > 10 validate free lists on every entry to malloc,free,realloc > 11 validate whole heap on entry to ... > 12 validate free lists before exiting ... > 13 validte whole heap before exiting ... */ > > static int _malloc_check_level = 0; > static int _malloc_debug_write_errno = 0; > > /* forwards */ > > int malloc_set_debugging(int); > void malloc_validate_pointer(char*); > int malloc_check_pointer(char*,int); > void malloc_validate_free_lists(void); > char **malloc_find_pointer(char**,char*); > char *malloc_find_byte_pattern(char*,char*,int); > union overhead *malloc_scan_heap_for_header(union overhead*); > union overhead *malloc_find_start_of_used_block(char*,int); > void malloc_validate_heap(int); > void malloc_dump_heap(void); 113,114c177,181 < #if defined(DEBUG) || defined(RCHECK) < #define ASSERT(p) if (!(p)) botch("p") --- > #endif /* DEBUG_MALLOC_HEAVY */ > #endif /* DEBUG_MALLOC */ > > #if defined(DEBUG_MALLOC) || defined(RCHECK) > #define ASSERT(p) if (!(p)) botch(#p) 116c183 < static --- > static void 120,122c187,193 < fprintf(stderr, "\r\nassertion botched: %s\r\n", s); < (void) fflush(stderr); /* just in case user buffered it */ < abort(); --- > int s_length = s? strlen(s): 0; > > if (!s_length) {s="NULL"; s_length = 4;} > PTHREAD_DEBUG_WriteStr("\n**** botch: "); > PTHREAD_DEBUG_WriteBytes(s,s_length); > PTHREAD_DEBUG_WriteBytes("\n",1); > abort (); 136,138c207,209 < register size_t sz; /* size of desired block */ < size_t amt; /* amount to allocate */ < size_t nblks; /* how many blocks we get */ --- > register int sz; /* size of desired block */ > int amt; /* amount to allocate */ > int nblks; /* how many blocks we get */ 144,145c215,216 < sz = 1L << (bucket + 3); < #ifdef DEBUG --- > sz = 1 << (bucket + SMALLESTB); > #ifdef DEBUG_MALLOC 153c224 < nblks = amt / sz; --- > /*nblks = amt / sz;*/ 155,156c226,227 < amt = sz + pagesz; < nblks = 1; --- > amt = sz; > /*nblks = 1;*/ 157a229 > nblks = amt / sz; 160,161c232,238 < if (op == (union overhead *) -1) < return; --- > if ((long)op == -1) > return; > #ifdef DEBUG_MALLOC > if (!_malloc_base_ptr) > _malloc_base_ptr = op; > _malloc_heap_size += amt; > #endif 167,168c244,257 < while (--nblks > 0) { < op->ov_next = (union overhead *)((caddr_t)op + sz); --- > #ifdef DEBUG_MALLOC > _malloc_bux_alloc[bucket] += nblks; > #endif > while (nblks-- > 0) { > if (nblks) > op->ov_next = (union overhead *)((caddr_t)op + sz); > else > op->ov_next = 0; > #ifdef DEBUG_MALLOC_HEAVY > op->ov_freebucket = bucket; > op->ov_freebucket2 = bucket; > op->ov_rmagic2 = RMAGIC; > op->ov_rmagic3 = RMAGIC; > #endif /* DEBUG_MALLOC_HEAVY */ 178d266 < pthread_mutex_t *mutex; 180,181c268,270 < size_t amt; < size_t bucket, n; --- > unsigned int amt; > long bucket, n; > pthread_mutex_t *mutex; 190c279,280 < size_t x; --- > size_t x; > 193c283 < x = sizeof (*op) - ((long)op & (n - 1)); --- > x = sizeof (*op) - ((long)op & (n - 1)); 197c287 < n = n - x; --- > n = n - x; 199c289,293 < if (sbrk(n) == (char *)-1) --- > char *sbrk_result; > > sbrk_result = (char *)sbrk(n); > if (sbrk_result == (char *)-1) { > pthread_mutex_unlock(mutex); 200a295 > } 203c298 < amt = 8; --- > amt = SMALLSIZE; 209a305,310 > #ifdef DEBUG_MALLOC_HEAVY > if (_malloc_check_level > 9) > malloc_validate_free_lists(); > if (_malloc_check_level > 10) > malloc_validate_heap(1); > #endif /* DEBUG_MALLOC_HEAVY */ 215,217c316,318 < if (nbytes <= (n = pagesz - sizeof (*op) - RSLOP)) { < #ifndef RCHECK < amt = 8; /* size of first bucket */ --- > n = pagesz - sizeof (*op) - RSLOP; > if (nbytes <= n) { > amt = SMALLSIZE; /* size of first bucket */ 219,223d319 < #else < amt = 16; /* size of first bucket */ < bucket = 1; < #endif < n = -(sizeof (*op) + RSLOP); 228c324 < while (nbytes > amt + n) { --- > while ((nbytes + sizeof(*op) + RSLOP) > amt) { 231c327 < pthread_mutex_unlock(mutex); --- > pthread_mutex_unlock(mutex); 236d331 < ASSERT (bucket < NBUCKETS); 244c339 < pthread_mutex_unlock(mutex); --- > pthread_mutex_unlock(mutex); 260c355,363 < #endif --- > #ifdef DEBUG_MALLOC_HEAVY > _malloc_bux_used[bucket]++; > /*memset((void *)(op + 1), (unsigned int)FILLPAT, op->ov_size);*/ > if (_malloc_check_level > 11) > malloc_validate_free_lists(); > if (_malloc_check_level > 12) > malloc_validate_heap(1); > #endif /* DEBUG_MALLOC_HEAVY */ > #endif /* RCHECK */ 270d372 < pthread_mutex_t *mutex; 272c374,375 < int size; --- > pthread_mutex_t *mutex; > int size; 273a377,382 > #ifdef DEBUG_MALLOC_HEAVY > if (_malloc_check_level > 9) > malloc_validate_free_lists(); > if (_malloc_check_level > 10) > malloc_validate_heap(1); > #endif /* DEBUG_MALLOC_HEAVY */ 277c386 < pthread_mutex_unlock(mutex); --- > pthread_mutex_unlock(mutex); 279a389,391 > #ifdef DEBUG_MALLOC_HEAVY > ASSERT(malloc_check_pointer(cp,_malloc_check_level)); > #endif /* DEBUG_MALLOC_HEAVY */ 281c393 < #ifdef DEBUG --- > #ifdef DEBUG_MALLOC 285c397 < pthread_mutex_unlock(mutex); --- > pthread_mutex_unlock(mutex); 288a401,402 > size = op->ov_index; > ASSERT(size < NBUCKETS); 292,294c406,413 < #endif < size = op->ov_index; < ASSERT(size < NBUCKETS); --- > #ifdef DEBUG_MALLOC_HEAVY > ASSERT(op->ov_rmagic2 == RMAGIC); > ASSERT(op->ov_rmagic3 == RMAGIC); > ASSERT(op->ov_freebucket == op->ov_index); > ASSERT(op->ov_freebucket2 == op->ov_index); > /*memset((caddr_t)(op + 1), (unsigned int)FILLPAT, op->ov_size);*/ > #endif /* DEBUG_MALLOC_HEAVY */ > #endif /* RCHECK */ 297c416,422 < --- > #ifdef DEBUG_MALLOC_HEAVY > _malloc_bux_used[size]--; > if (_malloc_check_level > 11) > malloc_validate_free_lists(); > if (_malloc_check_level > 12) > malloc_validate_heap(1); > #endif 307a433,434 > u_int onb; > int i; 309,310d435 < size_t onb; < size_t i; 315a441,447 > #ifdef DEBUG_MALLOC_HEAVY > if (_malloc_check_level > 9) > malloc_validate_free_lists(); > if (_malloc_check_level > 10) > malloc_validate_heap(1); > ASSERT(malloc_check_pointer(cp,_malloc_check_level)); > #endif /* DEBUG_MALLOC_HEAVY */ 332,336c464,465 < onb = 1L << (i + 3); < if (onb < pagesz) < onb -= sizeof (*op) + RSLOP; < else < onb += pagesz - sizeof (*op) - RSLOP; --- > onb = 1 << (i + SMALLESTB); > onb -= sizeof (*op) + RSLOP; 337a467,469 > #ifdef DEBUG_MALLOC_HEAVY > _malloc_realloc_calls[op->ov_index]++; > #endif 340,344c472,473 < i = 1L << (i + 2); < if (i < pagesz) < i -= sizeof (*op) + RSLOP; < else < i += pagesz - sizeof (*op) - RSLOP; --- > i = 1 << (i + (SMALLESTB-1)); > i -= sizeof (*op) + RSLOP; 349c478,485 < op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); --- > int new_size; > > new_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); > #ifdef DEBUG_MALLOC_HEAVY > /*memset(((caddr_t)(op+1)) + op->ov_size, > (unsigned int)FILLPAT, new_size - op->ov_size);*/ > #endif /* DEBUG_MALLOC_HEAVY */ > op->ov_size = new_size; 351c487,488 < #endif --- > _malloc_realloc_hits[op->ov_index]++; > #endif /* RCHECK */ 352a490,495 > #ifdef DEBUG_MALLOC_HEAVY > if (_malloc_check_level > 11) > malloc_validate_free_lists(); > if (_malloc_check_level > 12) > malloc_validate_heap(1); > #endif /* DEBUG_MALLOC_HEAVY */ 358a502,507 > #ifdef DEBUG_MALLOC_HEAVY > if (_malloc_check_level > 11) > malloc_validate_free_lists(); > if (_malloc_check_level > 12) > malloc_validate_heap(1); > #endif /* DEBUG_MALLOC_HEAVY */ 362c511 < memcpy(res, cp, (nbytes < onb) ? nbytes : onb); --- > bcopy(cp, res, (nbytes < onb) ? nbytes : onb); 364c513,518 < --- > #ifdef DEBUG_MALLOC_HEAVY > if (_malloc_check_level > 11) > malloc_validate_free_lists(); > if (_malloc_check_level > 12) > malloc_validate_heap(1); > #endif /* DEBUG_MALLOC_HEAVY */ 366a521,1088 > > #ifdef DEBUG_MALLOC_HEAVY > > /* all of the xxx_validate_xxx functions use ASSERT(), which calls > abort() to dump core if an assertion is violated. on some > platforms, notably the alpha, if you call abort, your stack can > get toasted, which makes it less than useful. therefore, the > proper thing to do is put a breakpoint in either botch() [above] > or abort() to stop before you get messed up. > > all of the non-validate functions are there primarily as extensions > to the debugger, to call interactively from the debugger command line > after you've botched an assertion somewhere to try and figure out what > in the world is going on. */ > > /* space for some random stuff. incredibly useful when in gdb */ > > static char _malloc_patch_chars[512]; > static int _malloc_patch_ints[256]; > static long _malloc_patch_longs[64]; > static char *_malloc_patch_ptrs[64]; > > /* The following routines are by Sean Levy . They are > blatantly non-thread-aware mainly because I wrote them to chase > down horrible heap-smashing bugs related to threads. Use them at > your risk. I plan on eventually making some other mallocator > thread-aware, like the one from CSRI, Toronto, by Mark Moraes. > The CSRI one is my favorite for debugging, and has all sorts of > goodies for finding difficult heap-smashes. For now, this will > do. -- SNL */ > > /* malloc_pointer_in_heap -- > is the given pointer in the heap area at all? */ > > int > malloc_pointer_in_heap(char *ptr) > { > return ((ptr >= (char*)_malloc_base_ptr) && > (ptr < ((char*)_malloc_base_ptr + _malloc_heap_size))); > } > > /* malloc_set_debugging -- > set the malloc debug check level, used by every call to > free and realloc to validate their arguments. */ > > int > malloc_set_debugging(int new_level) > { > int result = _malloc_check_level; > > _malloc_check_level = new_level; > return result; > } > > /* malloc_validate_pointer -- > was ptr returned from malloc or realloc? */ > > void > malloc_validate_pointer(char *ptr) > { > union overhead *op; > > ASSERT(ptr); > op = (union overhead *)(ptr - sizeof(union overhead)); > ASSERT(op->ov_magic == MAGIC); > ASSERT(op->ov_rmagic == RMAGIC); > ASSERT(op->ov_index < NBUCKETS); > ASSERT(op->ov_freebucket == op->ov_index); > ASSERT(op->ov_freebucket2 == op->ov_index); > ASSERT(op->ov_rmagic2 == RMAGIC); > ASSERT(op->ov_rmagic3 == RMAGIC); > ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); > } > > int > malloc_check_pointer(ptr, check_level) > char *ptr; > int check_level; > { > int result; > > result = 0; > if (_malloc_base_ptr && ptr) { > union overhead *op, *malloc_scan_heap_for_header(); > > op = (union overhead *)(((char *)ptr) - sizeof(union overhead)); > if (op >= _malloc_base_ptr) { > int level; > > level = 0; > if (op->ov_magic == MAGIC) { > if (++level >= check_level) > result = 1; > else if (op->ov_rmagic == RMAGIC) { > if (++level >= check_level) > result = 1; > else if (op->ov_rmagic2 == RMAGIC) { > if (++level >= check_level) > result = 1; > else if (op->ov_rmagic3 == RMAGIC) { > if (++level >= check_level) > result = 1; > else if (op->ov_index < NBUCKETS) { > if (++level >= check_level) > result = 1; > else if (op->ov_freebucket == op->ov_index) { > if (++level >= check_level) > result = 1; > else if (op->ov_freebucket2 == op->ov_index) { > if (++level >= check_level) > result = 1; > else if (*(u_short*)((caddr_t)(op+1)+op->ov_size)==RMAGIC){ > if (++level >= check_level) > result = 1; > else if (malloc_scan_heap_for_header(op) == op) > result = 1; > } > } > } > } > } > } > } > } > } > } > return result; > } > > /* malloc_validate_free_lists -- > check free lists for consistency */ > > void > malloc_validate_free_lists(void) > { > unsigned b; > union overhead *fp; > > for (b = 0; b < NBUCKETS; b++) { > fp = nextf[b]; > while (fp) { > ASSERT(fp->ov_freebucket < NBUCKETS); > ASSERT(fp->ov_freebucket == fp->ov_freebucket2); > ASSERT(fp->ov_freebucket == b); > ASSERT(fp->ov_rmagic2 == RMAGIC); > ASSERT(fp->ov_rmagic3 == RMAGIC); > fp = fp->ov_next; > } > } > } > > /* malloc_find_pointer -- > search the heap for a specific pointer. this is really a special > case of find_byte_pattern that is faster since it walks the heap > in pointer-sized chunks with proper alignment. */ > > char ** > malloc_find_pointer(start, val) > char **start; > char *val; > { > char **result; > > result = 0; > if (_malloc_base_ptr) { > char **end_of_heap; > > if (!start) > start = (char**)_malloc_base_ptr; > start += sizeof(char**); > start = (char **)(((unsigned long)start) & ~sizeof(char**)); > end_of_heap = (char**)(((char *)_malloc_base_ptr + _malloc_heap_size)); > end_of_heap += sizeof(char**); > end_of_heap = (char **)(((unsigned long)end_of_heap) & ~sizeof(char**)); > if (start >= (char**)_malloc_base_ptr && start < end_of_heap) { > char **ptr; > > for (ptr = start; ptr < end_of_heap; ptr++) > if (*ptr == val) { > result = ptr; > break; > } > } > } > return result; > } > > /* malloc_find_byte_pattern -- > scan the heap for a random byte pattern. why can't > any debuggers that i use do this? i could do this on > freaking pdp11's, '10s and vaxen, ferchrissake. double feh. */ > > char * > malloc_find_byte_pattern(start, pattern, pattern_length) > char *start; > char *pattern; > int pattern_length; > { > char *result; > > result = 0; > if (_malloc_base_ptr) { > char *end_of_heap; > > if (!start) > start = (char*)_malloc_base_ptr; > start += sizeof(char*); > start = (char *)(((unsigned long)start) & ~sizeof(char*)); > end_of_heap = (((char *)_malloc_base_ptr + _malloc_heap_size)); > end_of_heap -= pattern_length; > if (start >= (char *)_malloc_base_ptr && start < end_of_heap) { > char *ptr; > > for (ptr = start; ptr < end_of_heap; ptr++) > if (!memcmp((void *)ptr, (void *)pattern, pattern_length)) { > result = ptr; > break; > } > } > } > return result; > } > > /* malloc_scan_heap_for_header -- > scan the heap until we find a given header or run out. if we > find two headers which straddle the given pointer, we return > the lowest one. this tells us one of two things: the heap > is corrupted, or the argument really doesn't point at a > header. if we return null, that means the the argument > points BELOW the heap, which definitely aint kosher. */ > > union overhead * > malloc_scan_heap_for_header(maybe_op) > union overhead *maybe_op; > { > union overhead *op, *last_op, *result, *end_of_heap; > > result = 0; > last_op = 0; > end_of_heap = (union overhead *)((char *)_malloc_base_ptr + _malloc_heap_size); > for (op = (union overhead *)_malloc_base_ptr; > op < end_of_heap; > op = (union overhead *)(((char *)op) + (1 << (op->ov_freebucket + SMALLESTB)))) { > if (op == maybe_op) { /* found it */ > result = maybe_op; > break; > } > if (op > maybe_op) { /* went past it; return last header found */ > result = last_op; > break; > } > last_op = op; /* remember previous header for straddle check */ > } > return result; > } > > /* malloc_find_start_of_used_block -- > given a random pointer into the heap, assume that > it is a valid pointer and try to find its header. > > the check_level says how confident we want to be > that it is really the header. the levels are > additive; that is, level 1 = level 0 + some additional > constraint. > level meaning > 0 magic# is right > 1 1st range check# is right > 2 2nd range check# is right > 3 3rd range check# is right > 4 bucket index is valid > 5 1st redundant bucket index is valid > 6 2nd redundant bucket index is valid > 7 range check at end is valid > 8 and > search of heap find header > if a header passes level 7, the chances are very, very good > it is actually a valid block. level 8 is really paranoid: > after doing all the internal consistency checks we can, > we then scan forward from the start of the heap until we > either hit this header or run off the end. if a header passes > level 7 but not level 8 you have either [a] a very rare > circumstance on your hands [just the right bit patterns at > just the right places but still no valid block] or [b] a > corrupted header somewhere. */ > > static long passed_level_7_but_not_8; /* see big, bitter comment, below */ > > union overhead * > malloc_find_start_of_used_block(ptr, check_level) > char *ptr; > int check_level; > { > union overhead *result; > > result = 0; > if (_malloc_base_ptr && ptr) { > union overhead *op; > > op = (union overhead *)(((unsigned long)ptr) & ~sizeof(char*)); > passed_level_7_but_not_8 = 0; /* see big comment below */ > while (op >= _malloc_base_ptr) { > int level; > > level = 0; > if (op->ov_magic == MAGIC) { > /* level 0 */ > if (++level >= check_level) { > result = op; > break; > } > if (op->ov_rmagic == RMAGIC) { > /* level 1 */ > if (++level >= check_level) { > result = op; > break; > } > if (op->ov_rmagic2 == RMAGIC) { > /* level 2 */ > if (++level >= check_level) { > result = op; > break; > } > if (op->ov_rmagic3 == RMAGIC) { > /* level 3 */ > if (++level >= check_level) { > result = op; > break; > } > if (op->ov_index < NBUCKETS) { > /* level 4 */ > if (++level >= check_level) { > result = op; > break; > } > if (op->ov_freebucket == op->ov_index) { > /* level 5 */ > if (++level >= check_level) { > result = op; > break; > } > if (op->ov_freebucket2 == op->ov_index) { > /* level 6 */ > if (++level >= check_level) { > result = op; > break; > } > if (*(u_short *)((caddr_t)(op+1)+op->ov_size) == RMAGIC) { > /* level 7 */ > if (++level >= check_level) { > result = op; > break; > } > /* level 8 is tricker -- need help */ > if (malloc_scan_heap_for_header(op) == op) { > result = op; > break; > } > /* this is a funky case. we have a chunk of memory > that passed level 7 but did not come up as a valid > header when we searched for it. we might want > to warn the caller about this or something... for > now, we'll increment some counter. > > note that i view all of these stupid malloc > debugging routines as being basically extensions > of the debugger, to be called when trying to track > down problems because "modern" debuggers are too > smart to have good old search-for-a-pattern > commands anymore. feh. */ > passed_level_7_but_not_8++; > } > } > } > } > } > } > } > } > /* still here -- op not a valid header. back one chunk and > try again. */ > op--; > } > } > return result; > } > > /* malloc_dump_heap_stats -- > dump out statistics on heap usage */ > > void > malloc_dump_heap_stats(char *msg) > { > union overhead *end_of_heap; > int i; > > PTHREAD_DEBUG_WriteStr("Heap Statistics:"); > if (msg) > PTHREAD_DEBUG_WriteStr(msg); > PTHREAD_DEBUG_WriteStr("\n base: "); > PTHREAD_DEBUG_WritePointer(_malloc_base_ptr); > PTHREAD_DEBUG_WriteStr("\n size: "); > PTHREAD_DEBUG_WriteUInt64Dec(_malloc_heap_size); > PTHREAD_DEBUG_WriteStr("\n"); > if (!_malloc_base_ptr) { > PTHREAD_DEBUG_WriteStr("No heap to dump.\n"); > return; > } > end_of_heap = (union overhead *)((char *)_malloc_base_ptr + _malloc_heap_size); > PTHREAD_DEBUG_WriteStr(" end: "); > PTHREAD_DEBUG_WritePointer(end_of_heap); > PTHREAD_DEBUG_WriteStr("\n Buckets Stats --\n\tB#\tsize\tused\talloc\trcalls\trhits\n"); > > for (i = 0; i < NBUCKETS; i++) { > unsigned long sz = 1 << (i + SMALLESTB); > > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteInt32Dec(i); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteUInt64Dec(sz); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteInt64Dec(_malloc_bux_used[i]); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteInt64Dec(_malloc_bux_alloc[i]); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteInt64Dec(_malloc_realloc_calls[i]); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteInt64Dec(_malloc_realloc_hits[i]); > PTHREAD_DEBUG_WriteStr("\n"); > } > } > > /* These are static because I've been running into bugs in gdb > that refuses to let me look at them if I declare them in > validate_heap. I've stopped wondering why these things happen. */ > > static unsigned long n_free_blocks, n_used_blocks, n_used_bytes, n_free_bytes, > n_alloc_bytes; > static int _validating_heap; > > /* malloc_validate_heap -- > check the entire heap for consistency */ > > void > malloc_validate_heap(int quiet) > { > union overhead *op, *end_of_heap, *last_op; > > ASSERT(!_validating_heap); > if (!_malloc_base_ptr) { > if (!quiet) { > PTHREAD_DEBUG_WriteStr("No heap to validate.\n"); > } > return; > } > if (!quiet) > malloc_dump_heap_stats("before validating"); > _validating_heap = 1; > n_free_blocks = 0; > n_used_blocks = 0; > n_used_bytes = 0; > n_free_bytes = 0; > n_alloc_bytes = 0; > op = _malloc_base_ptr; > end_of_heap = (union overhead *)((char *)_malloc_base_ptr + _malloc_heap_size); > last_op = 0; > while (op < end_of_heap) { > if (op->ov_magic == MAGIC) {/* in use, or so the theory goes */ > unsigned int incr = op->ov_size; > > n_used_bytes += incr; > n_alloc_bytes += (1 << (op->ov_index + SMALLESTB)); > n_used_blocks++; > malloc_validate_pointer((char *)(op + 1)); > } else { /* free */ > unsigned bucket = op->ov_freebucket, sz; > > ASSERT(bucket < NBUCKETS); > ASSERT(op->ov_freebucket2 == bucket); > ASSERT(op->ov_rmagic2 == RMAGIC); > ASSERT(op->ov_rmagic3 == RMAGIC); > sz = 1 << (bucket + SMALLESTB); > n_free_bytes += sz; > n_free_blocks++; > } > last_op = op; > op = (union overhead *)(((char *)op) + (1 << (op->ov_freebucket + SMALLESTB))); > } > if (!quiet) { > PTHREAD_DEBUG_WriteStr("Heap validated.\n free: "); > PTHREAD_DEBUG_WriteUInt64Dec(n_free_blocks); > PTHREAD_DEBUG_WriteStr(" blocks, "); > PTHREAD_DEBUG_WriteUInt64Dec(n_free_bytes); > PTHREAD_DEBUG_WriteStr(" bytes.\n used: "); > PTHREAD_DEBUG_WriteUInt64Dec(n_used_blocks); > PTHREAD_DEBUG_WriteStr(" blocks, "); > PTHREAD_DEBUG_WriteUInt64Dec(n_used_bytes); > PTHREAD_DEBUG_WriteStr(" / "); > PTHREAD_DEBUG_WriteUInt64Dec(n_alloc_bytes); > PTHREAD_DEBUG_WriteStr(" bytes.\n"); > } > _validating_heap = 0; > } > > /* malloc_dump_heap -- > dump out a map of the heap to stderr. useful to see what is > actually going on in there, but better have some fresh coffee > and listings handy. */ > > void > malloc_dump_heap() > { > union overhead *op, *end_of_heap, *last_op; > int i; > > malloc_dump_heap_stats(0); > PTHREAD_DEBUG_WriteStr("\n---------------------------------------------------------------------------\n"); > n_free_blocks = 0; > n_used_blocks = 0; > n_used_bytes = 0; > n_free_bytes = 0; > n_alloc_bytes = 0; > op = _malloc_base_ptr; > end_of_heap = (union overhead *)((char *)_malloc_base_ptr + _malloc_heap_size); > last_op = 0; > while (op < end_of_heap) { > if (op->ov_magic == MAGIC) {/* in use, or so the theory goes */ > unsigned int incr = op->ov_size; > > n_used_bytes += incr; > n_alloc_bytes += (1 << (op->ov_index + SMALLESTB)); > n_used_blocks++; > PTHREAD_DEBUG_WriteStr("USED "); > PTHREAD_DEBUG_WritePointer(op); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteUInt32Dec(incr); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteUInt16Dec(op->ov_index); > PTHREAD_DEBUG_WriteStr("\n"); > } else { /* free */ > unsigned bucket = op->ov_freebucket, sz; > > sz = 1 << (bucket + SMALLESTB); > PTHREAD_DEBUG_WriteStr("FREE "); > PTHREAD_DEBUG_WritePointer(op); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteUInt32Dec(sz); > PTHREAD_DEBUG_WriteStr("\t"); > PTHREAD_DEBUG_WriteUInt16Dec(bucket); > PTHREAD_DEBUG_WriteStr("\n"); > n_free_bytes += sz; > n_free_blocks++; > } > last_op = op; > op = (union overhead *)(((char *)op) + (1 << (op->ov_freebucket + SMALLESTB))); > } > PTHREAD_DEBUG_WriteStr("---------------------------------------------------------------------------\n"); > PTHREAD_DEBUG_WriteStr(" free: "); > PTHREAD_DEBUG_WriteUInt64Dec(n_free_blocks); > PTHREAD_DEBUG_WriteStr(" blocks, "); > PTHREAD_DEBUG_WriteUInt64Dec(n_free_bytes); > PTHREAD_DEBUG_WriteStr(" bytes.\n used: "); > PTHREAD_DEBUG_WriteUInt64Dec(n_used_blocks); > PTHREAD_DEBUG_WriteStr(" blocks, "); > PTHREAD_DEBUG_WriteUInt64Dec(n_used_bytes); > PTHREAD_DEBUG_WriteStr(" / "); > PTHREAD_DEBUG_WriteUInt64Dec(n_alloc_bytes); > PTHREAD_DEBUG_WriteStr(" bytes.\n"); > } > #endif /* DEBUG_MALLOC_HEAVY */ =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/pthreads/pthread.c,v retrieving revision 1.65 diff -r1.65 pthread.c 158c158 < new_thread->sigpending = __SIGEMPTYSET; --- > sigemptyset(&new_thread->sigpending); =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/pthreads/pthread_init.c,v retrieving revision 1.9 diff -r1.9 pthread_init.c 100,101c100,101 < pthread_initial->sigmask = __SIGEMPTYSET; < pthread_initial->sigpending = __SIGEMPTYSET; --- > sigemptyset(&pthread_initial->sigmask); > sigemptyset(&pthread_initial->sigpending); =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/pthreads/select.c,v retrieving revision 1.61 diff -r1.61 select.c 184a185 > pthread_sched_resume(); =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/pthreads/sig.c,v retrieving revision 1.62 diff -r1.62 sig.c 337c337 < --- > #ifndef hpux 348a349,361 > #else > int sigemptyset(sigset_t *set) > { > set->sigset[0] = __SIGEMPTYSET; > return (0); > } > > int sigfillset(sigset_t * set) > { > set->sigset[0] = __SIGFILLSET; > return (0); > } > #endif =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/pthreads/signal.c,v retrieving revision 1.67 diff -r1.67 signal.c 531a532 > pthread_signal(sig_init[i], SIG_IGN); cvs diff: Diffing scripts cvs diff: Diffing stdio cvs diff: Diffing stdlib cvs diff: Diffing syslog cvs diff: Diffing tests =================================================================== RCS file: /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/tests/test_pthread_cond_timedwait.c,v retrieving revision 1.2 diff -r1.2 test_pthread_cond_timedwait.c 41a42 > setbuf(stdout, NULL); 54a56 > printf("woke up from first timedwait\n"); 60a63 > printf("forked thread_1\n"); 61a65,67 > pthread_yield(); > > printf("initial thread waiting on condition\n"); 74a81 > printf("forked thread_2\n"); 77a85 > printf("initial thread waiting on condition\n"); cvs diff: Diffing tests/benchmarks cvs diff: Diffing tests/benchmarks/bench-4.1 cvs diff: Diffing tests/benchmarks/inet cvs diff: Diffing tests/fstests