DCMD_PROC_THREADCTL
QNX SDP8.0Programmer's GuideDeveloper
Perform a ThreadCtl() on another process/thread.
#include <sys/procfs.h>
#define DCMD_PROC_THREADCTL __DIOTF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 27, procfs_threadctl)
The arguments to devctl() are:
Argument | Value |
---|---|
filedes | A file descriptor for the process. |
dcmd | DCMD_PROC_THREADCTL |
dev_data_ptr | A pointer to a procfs_threadctl structure |
n_bytes | sizeof(procfs_threadctl) |
dev_info_ptr | NULL |
The argument is a pointer to a procfs_threadctl structure. For example:
procfs_threadctl tctl;
tctl.tid = tid;
tctl.cmd = _NTO_TCTL_NAME;
tn = (struct _thread_name *)(&tctl.data);
tn->name_buf_len = sizeof(tctl.data) - sizeof(*tn);
//We can only communicate a maximum buffer size via devctl
if( newname_len > tn->name_buf_len || prevname_len >
tn->name_buf_len) {
return E2BIG;
}
tn->new_name_len = newname_len;
if(newname_len > 0) {
memcpy(tn->name_buf, newname, newname_len);
}
devctl(fd, DCMD_PROC_THREADCTL, &tctl, sizeof(tctl), NULL);
The path manager rejects all thread-control commands made through the /proc filesystem, except for the following:
- _NTO_TCTL_NAME
- _NTO_TCTL_RUNMASK
- _NTO_TCTL_RUNMASK_GET_AND_SET
- _NTO_TCTL_RUNMASK_GET_AND_SET_INHERIT
- _NTO_TCTL_ONE_THREAD_CONT
- _NTO_TCTL_ONE_THREAD_HOLD
- _NTO_TCTL_THREADS_CONT
- _NTO_TCTL_THREADS_HOLD
These commands may require process manager abilities, as described in the entry for ThreadCtl() in the C Library Reference.
Page updated: