Merge branch 'collectd-4.5' into collectd-4.6
[collectd.git] / src / processes.c
index 553b195..3afd2f0 100644 (file)
@@ -1,8 +1,9 @@
 /**
  * collectd - src/processes.c
- * Copyright (C) 2005  Lyonel Vincent
- * Copyright (C) 2006-2008  Florian Forster (Mach code)
- * Copyright (C) 2008  Oleg King
+ * Copyright (C) 2005       Lyonel Vincent
+ * Copyright (C) 2006-2008  Florian octo Forster
+ * Copyright (C) 2008       Oleg King
+ * Copyright (C) 2009       Sebastian Harl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -821,7 +822,7 @@ static char *ps_get_cmdline (pid_t pid, char *name, char *buf, size_t buf_len)
        n = 0;
 
        while (42) {
-               size_t status;
+               ssize_t status;
 
                status = read (fd, (void *)buf_ptr, len);
 
@@ -1357,7 +1358,9 @@ static int ps_read (void)
                pse.num_proc = 1;
                pse.num_lwp  = procs[i].ki_numthreads;
 
+               pse.vmem_size = procs[i].ki_size;
                pse.vmem_rss = procs[i].ki_rssize * getpagesize();
+               pse.stack_size = procs[i].ki_ssize * getpagesize();
                pse.vmem_minflt = 0;
                pse.vmem_minflt_counter = procs[i].ki_rusage.ru_minflt;
                pse.vmem_majflt = 0;