Fix a hard-to-find bugaboo in the struct file list sysctl. The code was
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 2 Feb 2005 20:36:09 +0000 (20:36 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 2 Feb 2005 20:36:09 +0000 (20:36 +0000)
commit6d132b4dea210982ffd758b0698851d444815cec
treedfd1084e0f27cf1cdf3ccd1aa0fae89055c92d10
parenta003570b7eb14119d3f74f89972c3b9720df25e7
Fix a hard-to-find bugaboo in the struct file list sysctl.  The code was
not properly calculating the required buffer size because it was ignoring
the fact that descriptor tables are shared between threaded processes.  Simply
adding fp->f_count for the fp's in the filehead list doesn't do the job if
a system is running threaded processes.

Reported-by: "Erik P. Skaalerud" <erik@pentadon.com>
sys/kern/kern_descrip.c