comparison src/getloadavg.c @ 15281:dd275783c873

[WIN32]: No-op as for [MSDOS].
author Roland McGrath <roland@gnu.org>
date Wed, 22 May 1996 21:47:37 +0000
parents faef0869994d
children c814262c9263
comparison
equal deleted inserted replaced
15280:f39684fddaff 15281:dd275783c873
41 BSD Real BSD, not just BSD-like. 41 BSD Real BSD, not just BSD-like.
42 convex 42 convex
43 DGUX 43 DGUX
44 eunice UNIX emulator under VMS. 44 eunice UNIX emulator under VMS.
45 hpux 45 hpux
46 MSDOS No-op for MSDOS.
46 NeXT 47 NeXT
47 sgi 48 sgi
48 sequent Sequent Dynix 3.x.x (BSD) 49 sequent Sequent Dynix 3.x.x (BSD)
49 _SEQUENT_ Sequent DYNIX/ptx 1.x.x (SYSV) 50 _SEQUENT_ Sequent DYNIX/ptx 1.x.x (SYSV)
50 sony_news NEWS-OS (works at least for 4.1C) 51 sony_news NEWS-OS (works at least for 4.1C)
51 UMAX 52 UMAX
52 UMAX4_3 53 UMAX4_3
53 VMS 54 VMS
55 WIN32 No-op for Windows95/NT.
54 __linux__ Linux: assumes /proc filesystem mounted. 56 __linux__ Linux: assumes /proc filesystem mounted.
55 Support from Michael K. Johnson. 57 Support from Michael K. Johnson.
56 __NetBSD__ NetBSD: assumes /kern filesystem mounted. 58 __NetBSD__ NetBSD: assumes /kern filesystem mounted.
57 59
58 In addition, to avoid nesting many #ifdefs, we internally set 60 In addition, to avoid nesting many #ifdefs, we internally set
731 = (load_ave.tl_lscale == 0 733 = (load_ave.tl_lscale == 0
732 ? load_ave.tl_avenrun.d[0] 734 ? load_ave.tl_avenrun.d[0]
733 : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); 735 : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
734 #endif /* OSF_MIPS */ 736 #endif /* OSF_MIPS */
735 737
736 #if !defined (LDAV_DONE) && defined(MSDOS) 738 #if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32))
737 #define LDAV_DONE 739 #define LDAV_DONE
738 740
739 /* A faithful emulation is going to have to be saved for a rainy day. */ 741 /* A faithful emulation is going to have to be saved for a rainy day. */
740 for ( ; elem < nelem; elem++) 742 for ( ; elem < nelem; elem++)
741 { 743 {
742 loadavg[elem] = 0.0; 744 loadavg[elem] = 0.0;
743 } 745 }
744 #endif /* MSDOS */ 746 #endif /* MSDOS */
745 747
864 } 866 }
865 #else /* SUNOS_5 */ 867 #else /* SUNOS_5 */
866 /* We pass 0 for the kernel, corefile, and swapfile names 868 /* We pass 0 for the kernel, corefile, and swapfile names
867 to use the currently running kernel. */ 869 to use the currently running kernel. */
868 kd = kvm_open (0, 0, 0, O_RDONLY, 0); 870 kd = kvm_open (0, 0, 0, O_RDONLY, 0);
869 if (kd != 0) 871 if (kd != 0)
870 { 872 {
871 /* nlist the currently running kernel. */ 873 /* nlist the currently running kernel. */
872 kvm_nlist (kd, nl); 874 kvm_nlist (kd, nl);
873 offset = nl[0].n_value; 875 offset = nl[0].n_value;
874 getloadavg_initialized = 1; 876 getloadavg_initialized = 1;