examine and modify the system flags control word of the process
#include <sys/psinfo.h> int qnx_pflags( long bits, long mask, long *old_bits, long *new_bits );
The qnx_pflags() function lets you examine and modify the system flags word of the currently running process. Some bits are maintained by the system and may not be changed using this function. They are marked as read-only (RO).
At least the following flag bits are defined:
Don't spawn processes while the _PPF_INFORM flag
is set - your
process and Proc will become Send-blocked.
It's best not to use this flag at all; use a I/O manager (or resource manager) and watch for _IO_CLOSE messages from the processes you're interested in. |
The mask argument selects which bits are changed, while the bits argument sets the new value. A 1-bit in mask changes that bit. If the pointers to old_bits and new_bits aren't NULL, they're used to store the values for the bits before and after the call.
The following C code illustrates how bits and mask are applied:
bitvalue = (bitvalue & ~mask) | (bits & mask);
#include <stdio.h> #include <sys/psinfo.h> void main() { long bits, old_bits; /* Read current value without changing */ qnx_pflags( 0, 0, &old_bits, 0 ); /* Jam load new value */ bits = old_bits; qnx_pflags( bits, bits, 0, 0 ); /* OR in some bits */ qnx_pflags( ~0, _PPF_PRIORITY_REC, 0, 0 ); /* AND off some bits */ qnx_pflags( 0, _PPF_PRIORITY_REC, 0, 0 ); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes, but modifies errno |
Thread | Yes |