Purpose
DosQuerySysInfo returns values of static system variables.
Syntax
#define INCL DOSMISC #include os2.h
APIRET DosQuerySysInfo
Parameters
iStart ULONG) input
Returns
ulrc APIRET) returns
DosQuerySysInfo returns one of the following values
87
Remarks
DosQuerySysInfo returns a single system variable or a range of system variables to a user-allocated buffer. To request a single system variable, set iStart equal to iLast. To request a range of system variables, set iStart less than iLast.
Each system variable is a ULONG value. The following list gives the ordinal index, name, and description of the system variables.
Maximum length, in bytes, of a path name.
Maximum number of text sessions.
Maximum number of PM sessions.
Maximum number of DOS sessions.
Drive from which the system was started (1 means drive A, 2 means drive B, and so on).
Dynamic priority variation flag (0 means absolute priority, 1 means dynamic priority).
Maximum wait in seconds.
Minimum time slice in milliseconds.
Maximum time slice in milliseconds.
10
Memory page size in bytes. This value is 4096 for the 80386 processor.
Major version number (see note below).
Minor version number (see note below).
Revision number (see note below).
Value of a 32-bit, free-running millisecond counter. This value is zero when the system is started.
Low-order 32 bits of the time in seconds since January 1, 1970 at 0 00 00.
High-order 32 bits of the time in seconds since January 1, 1970 at 0 00 00.
Total number of bytes of physical memory in the system.
Total number of bytes of resident memory in the system.
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.
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.
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.
Timer interval in tenths of a millisecond.
Maximum length, in bytes, of one component in a path name.
Session ID of the current foreground full-screen session. Note that this only applies to full-screen sessions. The Presentation Manager session (which displays Vio-windowed, PM, and windowed DOS Sessions) is full-screen session ID 1.
Process ID of the current foreground process.
Number of processors in the machine
Maximum amount of free space in process's high private arena. Because system conditions change constantly, this number is advisory and is not guaranteed. In addition, this number does not indicate the largest single memory object you can allocate because the arena may be fragmented.
Maximum amount of free space in process's high shared arena. Because system conditions change constantly, this number is advisory and is not guaranteed. In addition, this number does not indicate the largest single memory object you can allocate because the arena may be fragmented.
Maximum number of concurrent processes supported.
Size of the user's address space in megabytes (that is, the value of the rounded VIRTUALADDRESSLIMIT)
Note: Major, minor and revision numbers for versions of OS/2 operating system are described below
Major Minor RevisionOS/2 2.0 20 00 0 OS/2 2.1 20 10 0 OS/2 2.11 20 11 0 OS/2 3.0 20 30 0 OS/2 4.0 20 40 0
An application can specify file objects managed by an installable file system that supports long file names. Because some installable file systems support longer names than others, the application should issue DosQuerySysInfo upon initialization.
DosQuerySysInfo returns the maximum path length (QSV_MAX_PATH_LENGTH) supported by the installed file system. The path length includes the drive specifier (d ), the leading backslash ( ), and the trailing null character. The value returned by DosQuerySysInfo can be used to allocate buffers for path names returned by other functions, for example, DosFindFirst and DosFindNext.
Related Functions
Example Code
This example queries and displays the maximum length for a path name and the total amount of physical memory in bytes.
#define INCL_DOSMISC /* DOS Miscellaneous values */#define INCL_DOSERRORS /* DOS Error values */ #include os2.h #include stdio.h int main(VOID) ULONG aulSysInfo QSV_MAX = 0 ; /* System Information Data Buffer */ APIRET rc = NO_ERROR; /* Return code */ rc = DosQuerySysInfo(1L, /* Request all available system */ QSV_MAX, /* information */ (PVOID)aulSysInfo, sizeof(ULONG)*QSV_MAX); if (rc != NO_ERROR) printf("DosQuerySysInfo error return code = %u\n", rc); return 1; else printf("Maximum length for a path name is %u characters.\n", aulSysInfo QSV_MAX_PATH_LENGTH-1 ); /* Max length of path name */ printf("Total physical memory is %u bytes.\n", aulSysInfo QSV_TOTPHYSMEM-1 ); /* Total physical memory */ /* endif */ return NO_ERROR;