| 118 | |
| 119 | Maintenant que vous disposer de tous les éléments pour contrôler l'afficheur LCD. Nous allons monitorer le système grâce au fichier /proc/loadavg dont le contenu est décrit comme: |
| 120 | {{{ |
| 121 | The first three fields in this file are load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 1, 5, |
| 122 | and 15 minutes. They are the same as the load average numbers given by uptime(1) and other programs. The fourth field consists of two numbers separated by a slash (/). |
| 123 | The first of these is the number of currently runnable kernel scheduling entities (processes, threads). The value after the slash is the number of kernel scheduling |
| 124 | entities that currently exist on the system. The fifth field is the PID of the process that was most recently created on the system. |
| 125 | }}} |
| 126 | |
| 127 | Question: |
| 128 | * Ecrivez un programme qui lit le contenu du fichier /proc/loadavg et qui affiche son contenu sur l'afficheur avec une fréquence d'actualisation de 1 seconde. |
| 129 | |
| 130 | Bonus: |
| 131 | * Parser le contenu du fichier /proc/loadavg pour afficher des valeurs plus facilement compréhensibles. |