Fix (well kludge around) FreeBSD's `Invalid address' errors.
This commit is contained in:
parent
9cbe067afa
commit
719f308f9e
|
@ -73,6 +73,18 @@ BOOL DEBUG_checkmap_bad( const char *addr, size_t size, int rwflag)
|
|||
)
|
||||
return FALSE;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/*
|
||||
* *FOO* read(2) less than length of /proc/.../map fails with EFBIG
|
||||
*
|
||||
* $ dd bs=256 </proc/curproc/map
|
||||
* dd: stdin: File too large
|
||||
* 0+0 records in
|
||||
* 0+0 records out
|
||||
* 0 bytes transferred in 0.001595 secs (0 bytes/sec)
|
||||
*/
|
||||
setvbuf(fp, (char *)NULL, _IOFBF, 0x4000);
|
||||
#endif
|
||||
while (fgets( buf, sizeof(buf)-1, fp)) {
|
||||
#ifdef linux
|
||||
sscanf(buf, "%x-%x %3s", (int *) &start, (int *) &end, prot);
|
||||
|
|
Loading…
Reference in New Issue