diff options
author | Luis Machado <luisgpm@br.ibm.com> | 2011-08-24 12:07:28 +0000 |
---|---|---|
committer | Luis Machado <luisgpm@br.ibm.com> | 2011-08-24 12:07:28 +0000 |
commit | 13da1c9782f523debe697aa1415b7b4f96fe4f93 (patch) | |
tree | 0cc8eb2413196e9f8c4af3cb2e4e1d7f0524add3 /gdb/linux-nat.c | |
parent | f040079fa2855244f39a6a39d6f03a4e80128d6d (diff) | |
download | binutils-gdb-13da1c9782f523debe697aa1415b7b4f96fe4f93.tar.gz |
Move common linux procfs code to common/
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index c832902668b..b1468880245 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -31,6 +31,7 @@ #include <sys/ptrace.h> #include "linux-nat.h" #include "linux-ptrace.h" +#include "linux-procfs.h" #include "linux-fork.h" #include "gdbthread.h" #include "gdbcmd.h" @@ -1285,34 +1286,6 @@ exit_lwp (struct lwp_info *lp) delete_lwp (lp->ptid); } -/* Return an lwp's tgid, found in `/proc/PID/status'. */ - -int -linux_proc_get_tgid (int lwpid) -{ - FILE *status_file; - char buf[100]; - int tgid = -1; - - snprintf (buf, sizeof (buf), "/proc/%d/status", (int) lwpid); - status_file = fopen (buf, "r"); - if (status_file != NULL) - { - while (fgets (buf, sizeof (buf), status_file)) - { - if (strncmp (buf, "Tgid:", 5) == 0) - { - tgid = strtoul (buf + strlen ("Tgid:"), NULL, 10); - break; - } - } - - fclose (status_file); - } - - return tgid; -} - /* Detect `T (stopped)' in `/proc/PID/status'. Other states including `T (tracing stop)' are reported as false. */ |