pmap: make 32-bit version work better on 64-bit kernels
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -120,11 +120,11 @@ void FAST_FUNC free_procps_scan(procps_status_t* sp)
|
||||
}
|
||||
|
||||
#if ENABLE_FEATURE_TOPMEM || ENABLE_PMAP
|
||||
static unsigned long fast_strtoul_16(char **endptr)
|
||||
static unsigned long long fast_strtoull_16(char **endptr)
|
||||
{
|
||||
unsigned char c;
|
||||
char *str = *endptr;
|
||||
unsigned long n = 0;
|
||||
unsigned long long n = 0;
|
||||
|
||||
/* Need to stop on both ' ' and '\n' */
|
||||
while ((c = *str++) > ' ') {
|
||||
@ -238,8 +238,8 @@ int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total,
|
||||
|
||||
*tp = ' ';
|
||||
tp = buf;
|
||||
currec.smap_start = fast_strtoul_16(&tp);
|
||||
currec.smap_size = (fast_strtoul_16(&tp) - currec.smap_start) >> 10;
|
||||
currec.smap_start = fast_strtoull_16(&tp);
|
||||
currec.smap_size = (fast_strtoull_16(&tp) - currec.smap_start) >> 10;
|
||||
|
||||
strncpy(currec.smap_mode, tp, sizeof(currec.smap_mode)-1);
|
||||
|
||||
|
Reference in New Issue
Block a user