rem: read(fd,buff,BUFFSIZE-1); sscanf( buff, "%*d %*s %c " "%*d %*d %*d %*d %*d %*u %*u" " %*u %*u %*u %*d %*d %*d %*d %*d %*d %*u %*u %*d %*u %u"  , &c, &size );
add: memset(tbuf, '\0', sizeof tbuf); read(fd, tbuf, sizeof tbuf - 1);
context: static void getrunners(unsigned int *restrict running, unsigned int *restrict blocked) {  struct direct *ent;  DIR *proc;  *running=0;  *blocked=0;  if((proc=opendir("/proc"))==NULL) crash("/proc");  while(( ent=readdir(proc) )) {    unsigned size;    int fd;    char filename[80];    char c;    if (!isdigit(ent->d_name[0])) continue;    sprintf(filename, "/proc/%s/stat", ent->d_name);    fd = open(filename, O_RDONLY, 0);    if (fd == -1) continue;    read(fd,buff,BUFFSIZE-1);    sscanf(      buff,      "%*d %*s %c "      "%*d %*d %*d %*d %*d %*u %*u"      " %*u %*u %*u %*d %*d %*d %*d %*d %*d %*u %*u %*d %*u %u"      /*  " %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u\n"  */ ,      &c,      &size    );    close(fd);    if (c=='R') {      (*running)++;      continue;    }    if (c=='D') {      (*blocked)++;      continue;    }  }  closedir(proc);}