sigar-test 0.7.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/NOTICE +117 -0
  4. data/README +2 -0
  5. data/Rakefile +105 -0
  6. data/bindings/SigarBuild.pm +301 -0
  7. data/bindings/SigarWrapper.pm +3025 -0
  8. data/bindings/ruby/extconf.rb +131 -0
  9. data/bindings/ruby/rbsigar.c +888 -0
  10. data/include/sigar.h +984 -0
  11. data/include/sigar_fileinfo.h +157 -0
  12. data/include/sigar_format.h +65 -0
  13. data/include/sigar_getline.h +18 -0
  14. data/include/sigar_log.h +80 -0
  15. data/include/sigar_private.h +429 -0
  16. data/include/sigar_ptql.h +53 -0
  17. data/include/sigar_util.h +197 -0
  18. data/src/os/aix/aix_sigar.c +2168 -0
  19. data/src/os/aix/sigar_os.h +73 -0
  20. data/src/os/darwin/Info.plist.in +27 -0
  21. data/src/os/darwin/darwin_sigar.c +3718 -0
  22. data/src/os/darwin/sigar_os.h +80 -0
  23. data/src/os/hpux/hpux_sigar.c +1361 -0
  24. data/src/os/hpux/sigar_os.h +49 -0
  25. data/src/os/linux/linux_sigar.c +2810 -0
  26. data/src/os/linux/sigar_os.h +82 -0
  27. data/src/os/solaris/get_mib2.c +321 -0
  28. data/src/os/solaris/get_mib2.h +127 -0
  29. data/src/os/solaris/kstats.c +181 -0
  30. data/src/os/solaris/procfs.c +97 -0
  31. data/src/os/solaris/sigar_os.h +224 -0
  32. data/src/os/solaris/solaris_sigar.c +2732 -0
  33. data/src/os/win32/peb.c +212 -0
  34. data/src/os/win32/sigar.rc.in +40 -0
  35. data/src/os/win32/sigar_os.h +685 -0
  36. data/src/os/win32/sigar_pdh.h +47 -0
  37. data/src/os/win32/win32_sigar.c +4109 -0
  38. data/src/sigar.c +2444 -0
  39. data/src/sigar_cache.c +253 -0
  40. data/src/sigar_fileinfo.c +815 -0
  41. data/src/sigar_format.c +696 -0
  42. data/src/sigar_getline.c +1849 -0
  43. data/src/sigar_ptql.c +1976 -0
  44. data/src/sigar_signal.c +216 -0
  45. data/src/sigar_util.c +1060 -0
  46. data/src/sigar_version.c.in +22 -0
  47. data/src/sigar_version_autoconf.c.in +22 -0
  48. data/version.properties +11 -0
  49. metadata +91 -0
@@ -0,0 +1,80 @@
1
+ /*
2
+ * Copyright (c) 2004-2006, 2008 Hyperic, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #ifndef SIGAR_OS_H
18
+ #define SIGAR_OS_H
19
+
20
+ #ifdef DARWIN
21
+ #include <mach/port.h>
22
+ #include <mach/host_info.h>
23
+ #ifdef DARWIN_HAS_LIBPROC_H
24
+ #include <mach-o/dyld.h>
25
+ #include <libproc.h>
26
+ typedef int (*proc_pidinfo_func_t)(int, int, uint64_t, void *, int);
27
+ typedef int (*proc_pidfdinfo_func_t)(int, int, int, void *, int);
28
+ #endif
29
+ #else
30
+ #include <kvm.h>
31
+ #endif
32
+
33
+ #ifdef __NetBSD__
34
+ #include <sys/param.h>
35
+ #endif
36
+ #include <sys/sysctl.h>
37
+
38
+ enum {
39
+ KOFFSET_CPUINFO,
40
+ KOFFSET_VMMETER,
41
+ #if defined(__OpenBSD__) || defined(__NetBSD__)
42
+ KOFFSET_TCPSTAT,
43
+ KOFFSET_TCBTABLE,
44
+ #endif
45
+ KOFFSET_MAX
46
+ };
47
+
48
+ #if defined(__OpenBSD__) || defined(__NetBSD__)
49
+ typedef struct kinfo_proc2 bsd_pinfo_t;
50
+ #else
51
+ typedef struct kinfo_proc bsd_pinfo_t;
52
+ #endif
53
+
54
+ struct sigar_t {
55
+ SIGAR_T_BASE;
56
+ int pagesize;
57
+ time_t last_getprocs;
58
+ sigar_pid_t last_pid;
59
+ bsd_pinfo_t *pinfo;
60
+ int lcpu;
61
+ size_t argmax;
62
+ #ifdef DARWIN
63
+ mach_port_t mach_port;
64
+ # ifdef DARWIN_HAS_LIBPROC_H
65
+ void *libproc;
66
+ proc_pidinfo_func_t proc_pidinfo;
67
+ proc_pidfdinfo_func_t proc_pidfdinfo;
68
+ # endif
69
+ #else
70
+ kvm_t *kmem;
71
+ /* offsets for seeking on kmem */
72
+ unsigned long koffsets[KOFFSET_MAX];
73
+ int proc_mounted;
74
+ #endif
75
+ };
76
+
77
+ #define SIGAR_EPERM_KMEM (SIGAR_OS_START_ERROR+EACCES)
78
+ #define SIGAR_EPROC_NOENT (SIGAR_OS_START_ERROR+2)
79
+
80
+ #endif /* SIGAR_OS_H */