get_tgid_list(n,) should lookup the next few valid pids after the nth task in the task list. The current implementation scans through the task list to find the nth task. What about the attached patch? filp->f_version is indented for readdir implementations to store the current position. The patch stores the next pid in that field. If filp->f_version is not 0 (i.e. no lseek/seekdir) and the task is still found by find_task_by_pid, then get_tgid_list starts immediately from that position. It's just a speed up, the worst case (fd=open("/proc");lseek(fd,1000000,SEEK_SET);readdir()) still walks through the whole task list. -- Manfred