summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eebf31f)
raw | patch | inline | side by side (parent: eebf31f)
author | Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com> | |
Sun, 31 May 2015 18:25:31 +0000 (20:25 +0200) | ||
committer | Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com> | |
Sun, 31 May 2015 18:25:31 +0000 (20:25 +0200) |
src/processes.c | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index de776a29de5db1a3f8de9fdef299b77ca2751a6a..8b7d75989aa6bfc7f71effe844183cd4475b2196 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
/* ------- additional functions for KERNEL_LINUX/HAVE_THREAD_INFO ------- */
#if KERNEL_LINUX
-static int ps_read_tasks (int pid)
-{
- char dirname[64];
- DIR *dh;
- struct dirent *ent;
- int count = 0;
-
- ssnprintf (dirname, sizeof (dirname), "/proc/%i/task", pid);
-
- if ((dh = opendir (dirname)) == NULL)
- {
- DEBUG ("Failed to open directory `%s'", dirname);
- return (-1);
- }
-
- while ((ent = readdir (dh)) != NULL)
- {
- if (!isdigit ((int) ent->d_name[0]))
- continue;
- else
- count++;
- }
- closedir (dh);
-
- return ((count >= 1) ? count : 1);
-} /* int *ps_read_tasks */
-
/* Read data from /proc/pid/status */
static procstat_t *ps_read_status (int pid, procstat_t *ps)
{
}
if ( ps->num_lwp <= 0)
{
- if ( (ps->num_lwp = ps_read_tasks (pid)) == -1 )
- {
- /* returns -1 => kernel 2.4 */
- ps->num_lwp = 1;
- }
+ ps->num_lwp = 1;
}
ps->num_proc = 1;
}