get information about a node
#include <sys/osinfo.h>
int qnx_osinfo( nid_t nid,
struct _osinfo *osdata );
The qnx_osinfo() function returns information about node
nid, and places the information in buffer osdata.
If nid is zero, information about the local node is
returned. The _osinfo structure contains at least the following
members:
- short unsigned cpu_speed
- A PC is around 96.
- short unsigned num_procs
- Max number of processes.
- short unsigned tick_size
- Tick size, in microsecond units.
- short unsigned version
- Version number of QNX * 100.
- short unsigned timesel
- Segment in which the time is kept.
- short unsigned totmemk
- Total memory in the system.
- short unsigned freememk
- Free memory in the system.
- char release
- Release letter.
- long sflags
- System flags, as defined below.
- long nodename
- Logical node number of this cpu.
- long cpu
- Processor type 386, 486, 586, 686, ...
- long fpu
- Floating-point unit 287, 387, 487. 587, 687.
- char machine[16]
- Machine name.
- char bootsrc
- 'F' - floppy 'H' - hard disk
'N' - network
- short unsigned num_names
- Maximum number of names.
- short unsigned num_timers
- Maximum number of timers.
- short unsigned num_sessions
- Maximum number of sessions.
- short unsigned num_handlers
- Maximum number of interrupt handlers.
- short unsigned reserve64k
- Relocation offset (see -R option to Proc).
- short unsigned max_nodes
- Number of nodes you are licensed for.
- short unsigned num_fds[3]
- Number of file descriptors (see -f option to
Proc).
- short unsigned pidmask
- Process ID bit mask (to determine cyclic and indexing portions of pid).
|
For QNX4.0, the pidmask was zero. If your code uses the
pidmask, you should have the following test to ensure your
program will work on QNX4.0 as well as later versions of QNX:
if (pidmask == 0) pidmask = 0x00ff;
|
At least the following flag bits are defined in <sys/osinfo.h>:
- _PSF_PROTECTED
- Running in protected mode.
- _PSF_NDP_INSTALLED
- An 80x87 is installed.
- _PSF_EMULATOR_INSTALLED
- An 80x87 emulator is running.
- _PSF_EMU16_INSTALLED
- The 16-bit 80x87 emulator is running.
- _PSF_EMU32_INSTALLED
- The 32-bit 80x87 emulator is running.
- _PSF_APM_INSTALLED
- Advanced Power Management is installed.
- _PSF_32BIT_KERNEL
- The 32-bit kernel is being used.
- _PSF_PCI_BIOS
- A PCI BIOS is present.
- _PSF_32BIT
- Proc32 is running.
- _PSF_RESERVE_DOS32
- Lower 640K reserved for DOS.
- 0
- Success
- -1
- An error occurred. errno is set to indicate the error.
The qnx_osinfo() function may return any of the errors for
qnx_vc_attach().
#include <stdio.h>
#include <sys/osinfo.h>
struct _osinfo osdata;
void main()
{
if( qnx_osinfo( 0, &osdata ) != -1 )
printf( "Cpu speed is %d\n", osdata.cpu_speed );
}
QNX
Safety: | |
Interrupt handler |
No |
Signal handler |
Yes, but modifies errno |
Thread |
Yes |
errno,
qnx_osstat(),
qnx_psinfo()