Hold off the calling process until the process that's associated with the file descriptor reaches a point of interest.
#include <sys/procfs.h> #define DCMD_PROC_WAITSTOP32 (__DIOF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 6, procfs_status32)) #define DCMD_PROC_WAITSTOP64 (__DIOF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 6, procfs_status64)) #define DCMD_PROC_WAITSTOP (__DIOF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 6, procfs_status))
The arguments to devctl() are:
Argument | Value |
---|---|
filedes | A file descriptor for the process. |
dcmd | DCMD_PROC_WAITSTOP |
dev_data_ptr | A pointer to a procfs_status structure |
n_bytes | sizeof(procfs_status) |
dev_info_ptr | NULL |
You must have opened the file descriptor for writing. Use the DCMD_PROC_RUN command to set up the point of interest. If you don't want to block the calling process, use DCMD_PROC_EVENT instead of DCMD_PROC_WAITSTOP.
The argument is a pointer to a procfs_status structure (see debug_thread_t in <sys/debug.h>) that's filled with status information on return. For example:
procfs_status my_status; devctl( fd, DCMD_PROC_WAITSTOP, &my_status, sizeof my_status, NULL);
For more information about the contents of this structure, see Thread information, earlier in this chapter.