xref: /dflybsd-src/contrib/gdb-7/gdb/common/linux-procfs.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
1a45ae5f8SJohn Marino /* Linux-specific PROCFS manipulation routines.
2*ef5ccd6cSJohn Marino    Copyright (C) 2011-2013 Free Software Foundation, Inc.
3a45ae5f8SJohn Marino 
4a45ae5f8SJohn Marino    This file is part of GDB.
5a45ae5f8SJohn Marino 
6a45ae5f8SJohn Marino    This program is free software; you can redistribute it and/or modify
7a45ae5f8SJohn Marino    it under the terms of the GNU General Public License as published by
8a45ae5f8SJohn Marino    the Free Software Foundation; either version 3 of the License, or
9a45ae5f8SJohn Marino    (at your option) any later version.
10a45ae5f8SJohn Marino 
11a45ae5f8SJohn Marino    This program is distributed in the hope that it will be useful,
12a45ae5f8SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
13a45ae5f8SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14a45ae5f8SJohn Marino    GNU General Public License for more details.
15a45ae5f8SJohn Marino 
16a45ae5f8SJohn Marino    You should have received a copy of the GNU General Public License
17a45ae5f8SJohn Marino    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18a45ae5f8SJohn Marino 
19a45ae5f8SJohn Marino #ifndef COMMON_LINUX_PROCFS_H
20a45ae5f8SJohn Marino #define COMMON_LINUX_PROCFS_H
21a45ae5f8SJohn Marino 
22a45ae5f8SJohn Marino #include <unistd.h>
23a45ae5f8SJohn Marino 
24a45ae5f8SJohn Marino /* Return the TGID of LWPID from /proc/pid/status.  Returns -1 if not
25a45ae5f8SJohn Marino    found.  */
26a45ae5f8SJohn Marino 
27*ef5ccd6cSJohn Marino extern int linux_proc_get_tgid (pid_t lwpid);
28*ef5ccd6cSJohn Marino 
29*ef5ccd6cSJohn Marino /* Return the TracerPid of LWPID from /proc/pid/status.  Returns -1 if not
30*ef5ccd6cSJohn Marino    found.  */
31*ef5ccd6cSJohn Marino 
32*ef5ccd6cSJohn Marino extern pid_t linux_proc_get_tracerpid (pid_t lwpid);
33*ef5ccd6cSJohn Marino 
34*ef5ccd6cSJohn Marino /* Detect `T (stopped)' in `/proc/PID/status'.
35*ef5ccd6cSJohn Marino    Other states including `T (tracing stop)' are reported as false.  */
36*ef5ccd6cSJohn Marino 
37*ef5ccd6cSJohn Marino extern int linux_proc_pid_is_stopped (pid_t pid);
38*ef5ccd6cSJohn Marino 
39*ef5ccd6cSJohn Marino /* Return non-zero if PID is a zombie.  */
40*ef5ccd6cSJohn Marino 
41*ef5ccd6cSJohn Marino extern int linux_proc_pid_is_zombie (pid_t pid);
42a45ae5f8SJohn Marino 
43a45ae5f8SJohn Marino #endif /* COMMON_LINUX_PROCFS_H */
44