- lseek(fc, (long)nl[SPROC].n_value, 0);
- read(fc, proc, sizeof(proc));
- lseek(fc, (long)nl[SWAPMAP].n_value, 0);
- read(fc, swapmap, sizeof(swapmap));
- lseek(fc, (long)nl[SNSWAP].n_value, 0);
- read(fc, &nswap, sizeof(nswap));
+ nproc = getw(nl[SNPROC].n_value);
+ proc = (struct proc *)calloc(nproc, sizeof (struct proc));
+ lseek(fc, getw(nl[SPROC].n_value), 0);
+ read(fc, proc, nproc * sizeof (struct proc));
+ nswapmap = getw(nl[SNSWAPMAP].n_value);
+ swapmap = (struct map *)calloc(nswapmap, sizeof (struct map));
+ lseek(fc, getw(nl[SWAPMAP].n_value), 0);
+ read(fc, swapmap, nswapmap * sizeof (struct map));
+ nswap = getw(nl[SNSWAP].n_value);