Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Getting time of system boot
Ref. No. QNX.000009870
Category(ies) Kernel, Development
Issue After attempt to use qnx_osinfo() to find the boot time, we discovered that the boot time is not stored in the osinfo structure.  Where can we get the time that the system was booted?

Solution To get the boot time, call qnx_psinfo() on PROC_PID and check out the start_time.

For more information, please check qnx_psinfo() in the "C Library Reference - N to Z".  Also, the qnx_psinfo() function can return other information as well.  See the
/usr/include/sys/psinfo.h header file for all the members of the psinfo structure.