I have a program that reads and prints /proc/loadavg once per second (look below). Note that the file is reopened for each read operation. I'm mainly interested in the fourth value, i.e., the number of processes in the run queue. Its initial value is one. After starting a cpu-intensive background process, the value should go up to two, however, the value actually becomes four. When the background process is terminated, the value won't go down to one, either, it stays at three. When the monitoring program is restarted, the correct value is displayed; the same applies for 'cat /proc/loadavg'. In summary, the strange behavior is observed only for processes opening and reading /proc/loadavg multiple times. The behavior occurs on stock 2.2.x kernels; on Redhat 2.2.16-22, the value printed while the background process is running toggles between two and four, when the background process is terminated, it toggles between one and three. 2.0.36 behaves as expected. - Urs #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> #include <fcntl.h> #define LINUX_LDAV_FILE "/proc/loadavg" int main() { FILE *file; int count; char ldavgbuf[41]; while(1) { file = fopen (LINUX_LDAV_FILE, "r"); if (!(file)) return -1; memset(ldavgbuf, 0, 41); count = fread (ldavgbuf, 1, 40, file); (void) fclose (file); if (count <= 0) return -1; ldavgbuf[count]='\0'; fprintf(stderr,"%s\n", ldavgbuf); sleep(1); } } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/