blob: 169232141248b4b3c400a492685d9afe12fc696a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
*** get_load.c.orig Sat Jul 18 22:25:14 1998
--- get_load.c Sat Jul 18 22:30:55 1998
***************
*** 1,4 ****
! #ifdef linux
#include <stdio.h>
#include <fcntl.h>
--- 1,4 ----
! #if defined (linux) || defined (__FreeBSD__)
#include <stdio.h>
#include <fcntl.h>
***************
*** 45,51 ****
/* pas de verif ... */
}
! #else
/* SVR4 */
void GetLoad(float *small,float *medium,float *large)
{
--- 45,51 ----
/* pas de verif ... */
}
! #elif defined(SVR4)
/* SVR4 */
void GetLoad(float *small,float *medium,float *large)
{
***************
*** 65,68 ****
*large = (float)res.avenrun[2]/FSCALE;
}
! #endif
--- 65,80 ----
*large = (float)res.avenrun[2]/FSCALE;
}
! #else
! /* FreeBSD */
! void GetLoad(float *small,float *medium,float *large)
! {
! double avenrun[3];
! (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
!
! *small = (float)avenrun[0];
! *medium = (float)avenrun[1];
! *large = (float)avenrun[2];
! }
!
! #endif
|