Jump to content

SpQuerySysInfo: Difference between revisions

From EDM2
Created page with "Returns values of static system variables. '''Syntax:''' value = spQuerySysInfo (valueID) '''Parameter:''' valueID – identifier of system variable to be queried. <PRE> va..."
 
Ak120 (talk | contribs)
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
'''Parameter:''' valueID – identifier of system variable to be queried.
'''Parameter:''' valueID – identifier of system variable to be queried.


<PRE>
{| class="wikitable"
valueID description
|+Table 2 Value IDs for spQuerySysInfo
QSV_MAX_PATH_LENGTH Maximum length, in bytes, of a path name.
!valueID !!description
QSV_MAX_TEXT_SESSIONS Maximum number of text sessions.
|-
QSV_MAX_PM_SESSIONS Maximum number of PM sessions.
|QSV_MAX_PATH_LENGTH|| Maximum length, in bytes, of a path name.
QSV_MAX_VDM_SESSIONS Maximum number of DOS sessions.
|-
QSV_BOOT_DRIVE Drive from which the system was started (1 means drive A,
|QSV_MAX_TEXT_SESSIONS|| Maximum number of text sessions.
2 means drive B, and so on).
|-
QSV_DYN_PRI_VARIATION Dynamic priority variation flag (0 means absolute priority, 1
|QSV_MAX_PM_SESSIONS|| Maximum number of PM sessions.
means dynamic priority).
|-
QSV_MAX_WAIT Maximum wait in seconds.
|QSV_MAX_VDM_SESSIONS|| Maximum number of DOS sessions.
QSV_MIN_SLICE Minimum time slice in milliseconds.
|-
QSV_MAX_SLICE Maximum time slice in milliseconds.
|QSV_BOOT_DRIVE|| Drive from which the system was started (1 means drive A, 2 means drive B, and so on).
QSV_PAGE_SIZE Memory page size in bytes. This value is 4096 for the
|-
80386 processor.
|QSV_DYN_PRI_VARIATION|| Dynamic priority variation flag (0 means absolute priority, 1means dynamic priority).
QSV_VERSION_MAJOR Major version number.
|-
QSV_VERSION_MINOR Minor version number.
|QSV_MAX_WAIT|| Maximum wait in seconds.
QSV_VERSION_REVISION Revision number.
|-
QSV_MS_COUNT Value of a 32-bit, free-running millisecond counter. This
|QSV_MIN_SLICE|| Minimum time slice in milliseconds.
value is zero when the system is started.
|-
QSV_TIME_LOW Low-order 32 bits of the time in seconds since January 1,
|QSV_MAX_SLICE|| Maximum time slice in milliseconds.
1970 at 0:00:00.
|-
QSV_TIME_HIGH High-order 32 bits of the time in seconds since January 1,
|QSV_PAGE_SIZE|| Memory page size in bytes. This value is 4096 for the 80386 processor.
1970 at 0:00:00.
|-
QSV_TOTPHYSMEM Total number of bytes of physical memory in the system.
|QSV_VERSION_MAJOR|| Major version number.
QSV_TOTRESMEM Total number of bytes of resident memory in the system.
|-
QSV_TOTAVAILMEM Maximum number of bytes of memory that can be
|QSV_VERSION_MINOR|| Minor version number.
allocated by all processes in the system. This number is
|-
advisory and is not guaranteed, since system conditions
|QSV_VERSION_REVISION|| Revision number.
change constantly.
|-
QSV_MAXPRMEM Maximum number of bytes of memory that this process can
|QSV_MS_COUNT|| Value of a 32-bit, free-running millisecond counter. This value is zero when the system is started.
allocate in its private arena. This number is advisory and is
|-
not guaranteed, since system conditions change constantly.
|QSV_TIME_LOW|| Low-order 32 bits of the time in seconds since January 1, 1970 at 0:00:00.
QSV_MAXSHMEM Maximum number of bytes of memory that a process can
|-
allocate in the shared arena. This number is advisory and is
|QSV_TIME_HIGH|| High-order 32 bits of the time in seconds since January 1, 1970 at 0:00:00.
not guaranteed, since system conditions change constantly.
|-
QSV_TIMER_INTERVAL Timer interval in tenths of a millisecond.
|QSV_TOTPHYSMEM|| Total number of bytes of physical memory in the system.
QSV_MAX_COMP_LENGTH Maximum length, in bytes, of one component in a path
|-
name.
|QSV_TOTRESMEM|| Total number of bytes of resident memory in the system.
QSV_FOREGROUND_FS_SESSION Session ID of the current foreground full-screen session.
|-
Note that this only applies to full-screen sessions. The
|QSV_TOTAVAILMEM|| Maximum number of bytes of memory that can be allocated by all processes in the system. This number is advisory and is not guaranteed, since system conditions change constantly.
Presentation Manager session (which displays Viowindowed,
|-
PM, and windowed DOS Sessions) is full-screen
|QSV_MAXPRMEM|| Maximum number of bytes of memory that this process can allocate in its private arena. This number is advisory and is not guaranteed, since system conditions change constantly.
session ID 1.
|-
QSV_FOREGROUND_PROCESS Process ID of the current foreground process.
|QSV_MAXSHMEM|| Maximum number of bytes of memory that a process can allocate in the shared arena. This number is advisory and is not guaranteed, since system conditions change constantly.
</PRE>
|-
Table 2 Value IDs for spQuerySysInfo
|QSV_TIMER_INTERVAL|| Timer interval in tenths of a millisecond.
|-
|QSV_MAX_COMP_LENGTH|| Maximum length, in bytes, of one component in a path name.
|-
|QSV_FOREGROUND_FS_SESSION|| Session ID of the current foreground full-screen session. Note that this only applies to full-screen sessions. The Presentation Manager session (which displays Viowindowed, PM, and windowed DOS Sessions) is full-screen session ID 1.
|-
|QSV_FOREGROUND_PROCESS|| Process ID of the current foreground process.
|}


'''Returns:''' Value of system variable.
'''Returns:''' Value of system variable.
Line 67: Line 74:
   sec//60        || ' second(s)'  
   sec//60        || ' second(s)'  


[[Category:The OS/2 API Project]]
[[Category:SpUtils]]

Latest revision as of 23:28, 26 February 2017

Returns values of static system variables.

Syntax: value = spQuerySysInfo (valueID)

Parameter: valueID – identifier of system variable to be queried.

Table 2 Value IDs for spQuerySysInfo
valueID description
QSV_MAX_PATH_LENGTH Maximum length, in bytes, of a path name.
QSV_MAX_TEXT_SESSIONS Maximum number of text sessions.
QSV_MAX_PM_SESSIONS Maximum number of PM sessions.
QSV_MAX_VDM_SESSIONS Maximum number of DOS sessions.
QSV_BOOT_DRIVE Drive from which the system was started (1 means drive A, 2 means drive B, and so on).
QSV_DYN_PRI_VARIATION Dynamic priority variation flag (0 means absolute priority, 1means dynamic priority).
QSV_MAX_WAIT Maximum wait in seconds.
QSV_MIN_SLICE Minimum time slice in milliseconds.
QSV_MAX_SLICE Maximum time slice in milliseconds.
QSV_PAGE_SIZE Memory page size in bytes. This value is 4096 for the 80386 processor.
QSV_VERSION_MAJOR Major version number.
QSV_VERSION_MINOR Minor version number.
QSV_VERSION_REVISION Revision number.
QSV_MS_COUNT Value of a 32-bit, free-running millisecond counter. This value is zero when the system is started.
QSV_TIME_LOW Low-order 32 bits of the time in seconds since January 1, 1970 at 0:00:00.
QSV_TIME_HIGH High-order 32 bits of the time in seconds since January 1, 1970 at 0:00:00.
QSV_TOTPHYSMEM Total number of bytes of physical memory in the system.
QSV_TOTRESMEM Total number of bytes of resident memory in the system.
QSV_TOTAVAILMEM Maximum number of bytes of memory that can be allocated by all processes in the system. This number is advisory and is not guaranteed, since system conditions change constantly.
QSV_MAXPRMEM Maximum number of bytes of memory that this process can allocate in its private arena. This number is advisory and is not guaranteed, since system conditions change constantly.
QSV_MAXSHMEM Maximum number of bytes of memory that a process can allocate in the shared arena. This number is advisory and is not guaranteed, since system conditions change constantly.
QSV_TIMER_INTERVAL Timer interval in tenths of a millisecond.
QSV_MAX_COMP_LENGTH Maximum length, in bytes, of one component in a path name.
QSV_FOREGROUND_FS_SESSION Session ID of the current foreground full-screen session. Note that this only applies to full-screen sessions. The Presentation Manager session (which displays Viowindowed, PM, and windowed DOS Sessions) is full-screen session ID 1.
QSV_FOREGROUND_PROCESS Process ID of the current foreground process.

Returns: Value of system variable.

Example Code:

/* uptime.cmd (spUtils Example Code) */
/* writes the time since last IPL to stdout */
CALL RXFUNCADD 'spLoadFuncs','spUtils','spLoadFuncs'
CALL spLoadFuncs

sec=spQuerySysInfo('QSV_MS_COUNT')%1000
SAY sec%86400    || ' day(s) ' ||,
  (sec%3600)//24 || ' hour(s) ' ||,
  (sec%60)//60   || ' minute(s) ' ||,
  sec//60        || ' second(s)'