always use `-I$(top_srcdir)/sysdeps/@sysdeps_dir@'; it's no longer

* configure.in (@machine_incs@): always use
`-I$(top_srcdir)/sysdeps/@sysdeps_dir@'; it's no
longer conditional.

* examples/Makefile.am: removed the '_linux' examples.

* src/server/main.c: we now use the '__p' functions,
but only if the appropriate 'GLIBTOP_SUID_<feature>'
has a non-zero value.
This commit is contained in:
Martin Baulig
1998-05-28 19:29:29 +00:00
parent 95b9d824ea
commit 68162783dc
5 changed files with 96 additions and 43 deletions

View File

@@ -146,50 +146,68 @@ int main(int argc, char *argv[])
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_CPU:
glibtop_get_cpu__r (&server, &data.cpu);
#if GLIBTOP_SUID_CPU
glibtop_get_cpu__p (&server, &data.cpu);
#endif
glibtop_output (sizeof (glibtop_cpu), &data.cpu);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_MEM:
glibtop_get_mem__r (&server, &data.mem);
#if GLIBTOP_SUID_MEM
glibtop_get_mem__p (&server, &data.mem);
#endif
glibtop_output (sizeof (glibtop_mem), &data.mem);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SWAP:
glibtop_get_swap__r (&server, &data.swap);
#if GLIBTOP_SUID_SWAP
glibtop_get_swap__p (&server, &data.swap);
#endif
glibtop_output (sizeof (glibtop_swap), &data.swap);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_UPTIME:
glibtop_get_uptime__r (&server, &data.uptime);
#if GLIBTOP_SUID_UPTIME
glibtop_get_uptime__p (&server, &data.uptime);
#endif
glibtop_output (sizeof (glibtop_uptime), &data.uptime);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_LOADAVG:
glibtop_get_loadavg__r (&server, &data.loadavg);
#if GLIBTOP_SUID_LOADAVG
glibtop_get_loadavg__p (&server, &data.loadavg);
#endif
glibtop_output (sizeof (glibtop_loadavg), &data.loadavg);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SHM_LIMITS:
glibtop_get_shm_limits__r (&server, &data.shm_limits);
#if GLIBTOP_SUID_SHM_LIMITS
glibtop_get_shm_limits__p (&server, &data.shm_limits);
#endif
glibtop_output (sizeof (glibtop_shm_limits),
&data.shm_limits);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_MSG_LIMITS:
glibtop_get_msg_limits__r (&server, &data.msg_limits);
#if GLIBTOP_SUID_MSG_LIMITS
glibtop_get_msg_limits__p (&server, &data.msg_limits);
#endif
glibtop_output (sizeof (glibtop_msg_limits),
&data.msg_limits);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SEM_LIMITS:
glibtop_get_sem_limits__r (&server, &data.sem_limits);
#if GLIBTOP_SUID_SEM_LIMITS
glibtop_get_sem_limits__p (&server, &data.sem_limits);
#endif
glibtop_output (sizeof (glibtop_sem_limits),
&data.sem_limits);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROCLIST:
ptr = glibtop_get_proclist__r (&server, &data.proclist);
#if GLIBTOP_SUID_PROCLIST
ptr = glibtop_get_proclist__p (&server, &data.proclist);
#endif
glibtop_output (sizeof (glibtop_proclist),
&data.proclist);
glibtop_output (data.proclist.total, ptr);
@@ -197,56 +215,70 @@ int main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROC_STATE:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_state__r
#if GLIBTOP_SUID_PROC_STATE
glibtop_get_proc_state__p
(&server, &data.proc_state, pid);
#endif
glibtop_output (sizeof (glibtop_proc_state),
&data.proc_state);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROC_UID:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_uid__r
#if GLIBTOP_SUID_PROC_UID
glibtop_get_proc_uid__p
(&server, &data.proc_uid, pid);
#endif
glibtop_output (sizeof (glibtop_proc_uid),
&data.proc_uid);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROC_MEM:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_mem__r
#if GLIBTOP_SUID_PROC_MEM
glibtop_get_proc_mem__p
(&server, &data.proc_mem, pid);
#endif
glibtop_output (sizeof (glibtop_proc_mem),
&data.proc_mem);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROC_TIME:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_time__r
#if GLIBTOP_SUID_PROC_TIME
glibtop_get_proc_time__p
(&server, &data.proc_time, pid);
#endif
glibtop_output (sizeof (glibtop_proc_time),
&data.proc_time);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROC_SIGNAL:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_signal__r
#if GLIBTOP_SUID_PROC_SIGNAL
glibtop_get_proc_signal__p
(&server, &data.proc_signal, pid);
#endif
glibtop_output (sizeof (glibtop_proc_signal),
&data.proc_signal);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROC_KERNEL:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_kernel__r
#if GLIBTOP_SUID_PROC_KERNEL
glibtop_get_proc_kernel__p
(&server, &data.proc_kernel, pid);
#endif
glibtop_output (sizeof (glibtop_proc_kernel),
&data.proc_kernel);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROC_SEGMENT:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_segment__r
#if GLIBTOP_SUID_PROC_SEGMENT
glibtop_get_proc_segment__p
(&server, &data.proc_segment, pid);
#endif
glibtop_output (sizeof (glibtop_proc_segment),
&data.proc_segment);
glibtop_output (0, NULL);