Manipulating a process or thread
QNX SDP8.0Programmer's GuideDeveloper
Once you have a file descriptor to a particular process's /proc/pid/ctl file, you can get information about and control that process and its associated threads.
All of these functions are performed using the
devctl()
call as described in the sections that follow.
To be able to use these devctl() calls, you'll need at least the following:
#include <devctl.h>
#include <sys/procfs.h>
You can use the devctl() commands (described in the sections that follow) to do the following:
- Select a thread for further operations. When you first perform the open() to a particular process, by default you're connected to the first thread (the thread that executed the main() function). If you wish to switch a different thread, use the DCMD_PROC_CURTHREAD command. To find out how many threads are available in the given process, see the DCMD_PROC_INFO command.
- Start and stop processes and threads:
You must have opened the file descriptor for writing.
- Set breakpoints:
You must have opened the file descriptor for writing.
- Examine process and thread attributes:
- DCMD_PROC_SYSINFO
- DCMD_PROC_INFO
- DCMD_PROC_MAPINFO
- DCMD_PROC_MAPDEBUG
- DCMD_PROC_MAPDEBUG_BASE
- DCMD_PROC_SIGNAL
- DCMD_PROC_STATUS
- DCMD_PROC_TIDSTATUS
- DCMD_PROC_GETGREG
- DCMD_PROC_SETGREG
- DCMD_PROC_GETFPREG
- DCMD_PROC_SETFPREG
- DCMD_PROC_GETREGSET
- DCMD_PROC_SETREGSET
- DCMD_PROC_EVENT
- DCMD_PROC_SET_FLAG
- DCMD_PROC_CLEAR_FLAG
- DCMD_PROC_PAGEDATA
- DCMD_PROC_PTINFO
- DCMD_PROC_GETALTREG
- DCMD_PROC_SETALTREG
- DCMD_PROC_TIMERS
- DCMD_PROC_IRQS
- DCMD_PROC_THREADCTL
- DCMD_PROC_CHANNELS
Page updated: