summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy M. Broome <thrirhrafnir@gmail.com>2018-03-28 16:04:49 -0400
committerHisham Muhammad <hisham@gobolinux.org>2018-04-06 11:14:09 -0300
commit86771628365cd8c5dd48af2ba4cf1864c0267d6b (patch)
tree2219ef08f28246f07e46d1190bfe1a484dbddde8
parent475798e8ab674260f964a92393a8472f5e58cb2c (diff)
Solaris: add warning about proc_walk_f callback function
-rw-r--r--solaris/SolarisProcessList.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c
index d33e1c9f..cd6c3528 100644
--- a/solaris/SolarisProcessList.c
+++ b/solaris/SolarisProcessList.c
@@ -236,6 +236,12 @@ void ProcessList_delete(ProcessList* this) {
free(this);
}
+/* NOTE: the following is a callback function of type proc_walk_f
+ * and MUST conform to the appropriate definition in order
+ * to work. See libproc(3LIB) on a Solaris or Illumos
+ * system for more info.
+ */
+
int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void *listptr) {
struct timeval tv;
struct tm date;
@@ -320,7 +326,7 @@ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void *
// See note above (in common section) about this BINARY FRACTION
proc->percent_cpu = ((uint16_t)_psinfo->pr_pctcpu/(double)32768)*(double)100.0;
proc->time = _psinfo->pr_time.tv_sec;
- if(!preExisting) { // Tasks done only for NEW processes
+ if(!preExistingP) { // Tasks done only for NEW processes
sproc->is_lwp = false;
proc->starttime_ctime = _psinfo->pr_start.tv_sec;
}
@@ -343,7 +349,7 @@ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void *
} else { // We are not in the master LWP, so jump to the LWP handling code
lwp->percent_cpu = ((uint16_t)_lwpsinfo->pr_pctcpu/(double)32768)*(double)100.0;
lwp->time = _lwpsinfo->pr_time.tv_sec;
- if (!preExisting) { // Tasks done only for NEW LWPs
+ if (!preExistingL) { // Tasks done only for NEW LWPs
slwp->is_lwp = true;
lwp->basenameOffset = -1;
lwp->ppid = proc->pid;

© 2014-2024 Faster IT GmbH | imprint | privacy policy