source: trunk/third/libgtop/lib/sysdeps.c @ 20897

Revision 20897, 4.0 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20896, which included commits to RCS files with non-trunk default branches.
Line 
1/* Copyright (C) 1998-99 Martin Baulig
2   This file is part of LibGTop 1.0.
3
4   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
5
6   LibGTop is free software; you can redistribute it and/or modify it
7   under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2 of the License,
9   or (at your option) any later version.
10
11   LibGTop is distributed in the hope that it will be useful, but WITHOUT
12   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14   for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LibGTop; see the file COPYING. If not, write to the
18   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19   Boston, MA 02111-1307, USA.
20*/
21
22#include <glibtop.h>
23#include <glibtop/union.h>
24#include <glibtop/sysdeps.h>
25
26const unsigned long glibtop_server_features =
27GLIBTOP_SUID_CPU +
28GLIBTOP_SUID_MEM +
29GLIBTOP_SUID_SWAP +
30GLIBTOP_SUID_UPTIME +
31GLIBTOP_SUID_LOADAVG +
32GLIBTOP_SUID_SHM_LIMITS +
33GLIBTOP_SUID_MSG_LIMITS +
34GLIBTOP_SUID_SEM_LIMITS +
35GLIBTOP_SUID_PROCLIST +
36GLIBTOP_SUID_PROC_STATE +
37GLIBTOP_SUID_PROC_UID +
38GLIBTOP_SUID_PROC_MEM +
39GLIBTOP_SUID_PROC_TIME +
40GLIBTOP_SUID_PROC_SIGNAL +
41GLIBTOP_SUID_PROC_KERNEL +
42GLIBTOP_SUID_PROC_SEGMENT +
43GLIBTOP_SUID_PROC_ARGS +
44GLIBTOP_SUID_PROC_MAP +
45GLIBTOP_SUID_NETLOAD +
46GLIBTOP_SUID_PPP;
47
48glibtop_init_func_t _glibtop_init_hook_s [] = {
49#if !GLIBTOP_SUID_CPU
50        glibtop_init_cpu_s,
51#endif
52#if !GLIBTOP_SUID_MEM
53        glibtop_init_mem_s,
54#endif
55#if !GLIBTOP_SUID_SWAP
56        glibtop_init_swap_s,
57#endif
58#if !GLIBTOP_SUID_UPTIME
59        glibtop_init_uptime_s,
60#endif
61#if !GLIBTOP_SUID_LOADAVG
62        glibtop_init_loadavg_s,
63#endif
64#if !GLIBTOP_SUID_SHM_LIMITS
65        glibtop_init_shm_limits_s,
66#endif
67#if !GLIBTOP_SUID_MSG_LIMITS
68        glibtop_init_msg_limits_s,
69#endif
70#if !GLIBTOP_SUID_SEM_LIMITS
71        glibtop_init_sem_limits_s,
72#endif
73#if !GLIBTOP_SUID_PROCLIST
74        glibtop_init_proclist_s,
75#endif
76#if !GLIBTOP_SUID_PROC_STATE
77        glibtop_init_proc_state_s,
78#endif
79#if !GLIBTOP_SUID_PROC_UID
80        glibtop_init_proc_uid_s,
81#endif
82#if !GLIBTOP_SUID_PROC_MEM
83        glibtop_init_proc_mem_s,
84#endif
85#if !GLIBTOP_SUID_PROC_TIME
86        glibtop_init_proc_time_s,
87#endif
88#if !GLIBTOP_SUID_PROC_SIGNAL
89        glibtop_init_proc_signal_s,
90#endif
91#if !GLIBTOP_SUID_PROC_KERNEL
92        glibtop_init_proc_kernel_s,
93#endif
94#if !GLIBTOP_SUID_PROC_SEGMENT
95        glibtop_init_proc_segment_s,
96#endif
97#if !GLIBTOP_SUID_PROC_ARGS
98        glibtop_init_proc_args_s,
99#endif
100#if !GLIBTOP_SUID_PROC_MAP
101        glibtop_init_proc_map_s,
102#endif
103#if !GLIBTOP_SUID_NETLOAD
104        glibtop_init_netload_s,
105#endif
106#if !GLIBTOP_SUID_PPP
107        glibtop_init_ppp_s,
108#endif
109        NULL
110};
111
112glibtop_init_func_t _glibtop_init_hook_p [] = {
113#if GLIBTOP_SUID_CPU
114        glibtop_init_cpu_p,
115#endif
116#if GLIBTOP_SUID_MEM
117        glibtop_init_mem_p,
118#endif
119#if GLIBTOP_SUID_SWAP
120        glibtop_init_swap_p,
121#endif
122#if GLIBTOP_SUID_UPTIME
123        glibtop_init_uptime_p,
124#endif
125#if GLIBTOP_SUID_LOADAVG
126        glibtop_init_loadavg_p,
127#endif
128#if GLIBTOP_SUID_SHM_LIMITS
129        glibtop_init_shm_limits_p,
130#endif
131#if GLIBTOP_SUID_MSG_LIMITS
132        glibtop_init_msg_limits_p,
133#endif
134#if GLIBTOP_SUID_SEM_LIMITS
135        glibtop_init_sem_limits_p,
136#endif
137#if GLIBTOP_SUID_PROCLIST
138        glibtop_init_proclist_p,
139#endif
140#if GLIBTOP_SUID_PROC_STATE
141        glibtop_init_proc_state_p,
142#endif
143#if GLIBTOP_SUID_PROC_UID
144        glibtop_init_proc_uid_p,
145#endif
146#if GLIBTOP_SUID_PROC_MEM
147        glibtop_init_proc_mem_p,
148#endif
149#if GLIBTOP_SUID_PROC_TIME
150        glibtop_init_proc_time_p,
151#endif
152#if GLIBTOP_SUID_PROC_SIGNAL
153        glibtop_init_proc_signal_p,
154#endif
155#if GLIBTOP_SUID_PROC_KERNEL
156        glibtop_init_proc_kernel_p,
157#endif
158#if GLIBTOP_SUID_PROC_SEGMENT
159        glibtop_init_proc_segment_p,
160#endif
161#if GLIBTOP_SUID_PROC_ARGS
162        glibtop_init_proc_args_p,
163#endif
164#if GLIBTOP_SUID_PROC_MAP
165        glibtop_init_proc_map_p,
166#endif
167#if GLIBTOP_SUID_NETLOAD
168        glibtop_init_netload_p,
169#endif
170#if GLIBTOP_SUID_PPP
171        glibtop_init_ppp_p,
172#endif
173        NULL
174};
175
176/* Checks which features are implemented. */
177
178void
179glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf)
180{
181        *buf = server->sysdeps;
182}
Note: See TracBrowser for help on using the repository browser.