in _psinfo structure, which variable can tel me if that process returned by
qnx_psinfo() is frozen…?
I need to determine wether photon or any of the photon app is frozen or
not…pl help
ran zhang <rzhang@vamcointernational.com> wrote:
: in _psinfo structure, which variable can tel me if that process returned by
: qnx_psinfo() is frozen…?
: I need to determine wether photon or any of the photon app is frozen or
: not…pl help
Here’s the section on the psinfo structure that I added to the docs when
it looked like we’d release a new version. I hope it helps you.
The _psinfo structure
The _psinfo structure contains information for virtual circuits (VCs),
proxies, or processes, as well as information common to all. To
determine which type (union member) to use, look at the flags field of
the _psinfo structure:
if (_psinfo.flags & _PPF_VID) {
/* is a VC – use un.vproc /
} else if (_psinfo.flags & _PPF_MID) {
/ is a PROXY – use un.mproc /
} else {
/ is a PROCESS – use un.proc */
}
The following fields from _psinfo are used no matter what type of
information is returned:
pid
the process ID
blocked_on
if the state is SEND, RECV, REPLY, or SIGNAL, on whom it is
waiting
pid_group
the process group
flags
See qnx_pflags().
rgid, ruid
the real group and user IDs
egid, euid
the effective group and user IDs
sp_reg, ss_reg
the stack pointer
magic_off, magic_sel
the address of _magic structure. See <sys/magic.h>
ldt
the Local Descriptor Table entry
umask
the file-creation mask
signal_ignore, signal_pending, signal_mask
the current signal bits
signal_off, signal_sel
the address of signal action table
state
the current execution state. See <sys/kernel.h>
priority
the current priority
max_priority
the maximum priority (SCHED_OTHER boost prio)
sched_algorithm
the current scheduling algorithm. See <sys/sched.h>
sid
the session ID
sid_nid
the node that owns this session
The following fields in the proc union member are used for processes:
father, son, brother
the family tree. Processes created by a common pid are linked
as brothers.
debugger
If the process is currently being debugged, this is by whom.
mpass_pid, mpass_sel, mpass_flags
access rights from qnx_segment_arm(). Note that in later
versions, you only require compatible user IDs to
qnx_segment_get() and qnx_segment_put(). The arming is only
needed between unique non-root user IDs.
name[100]
the name of the program image
links
the number of processes running this image
file_time
the file time of this image
nselectors
the number of selectors in this process
start_time
at what time the program started
struct tms times
user accounting information {utime,stime} for this and
children.
mxcount
the number of bytes transferred last time this process
received.
Note: The mxcount field is only 16 bits long.
The following fields in the vproc union member apply to virtual
circuits:
local_pid
the process that owns this VC.
remote_pid
the process that’s connected to this VC on the remote node.
remote_vid
the Virtual Circuit ID corresponding to this VC on the remote
node.
remote_nid
which node the VC points to.
vidseg
the segment that contains the VC buffer.
links
the reference count for the VC.
substate
the internal state for VC. See <sys/kernel.h>
The following field in the mproc union member applies to proxies: