14.7 Environment and Runtime Information
(system-type [mode]) → (or/c symbol? string? bytes?) |
mode : (or/c 'os 'gc 'link 'so-suffix 'machine) = 'os |
In 'os mode, the possible symbol results are:
In 'gc mode, the possible symbol results are:
In 'link mode, the possible symbol results are:
Future ports of Racket may expand the list of 'os, 'gc, and 'link results.
In 'so-suffix mode, then the result is a byte string that represents the file extension used for shared objects on the current platform. The byte string starts with a period, so it is suitable as a second argument to path-replace-suffix.
In 'machine mode, then the result is a string, which contains further details about the current machine in a platform-specific format.
On Unix and Mac OS X, the string is five characters: two lowercase ASCII letters for the language, an underscore, and two uppercase ASCII letters for the country. On Windows, the string can be arbitrarily long, but the language and country are in English (all ASCII letters or spaces) separated by an underscore.
On Unix, the result is determined by checking the LC_ALL, LC_TYPE, and LANG environment variables, in that order (and the result is used if the environment variable’s value starts with two lowercase ASCII letters, an underscore, and two uppercase ASCII letters, followed by either nothing or a period). On Windows and Mac OS X, the result is determined by system calls.
(system-library-subpath [mode]) → path? |
mode : (or/c 'cgc '3m #f) = (system-type 'gc) |
The optional mode argument specifies the relevant garbage-collection variant, which one of the possible results of (system-type 'gc): 'cgc or '3m. It can also be #f, in which case the result is independent of the garbage-collection variant.
(version) → (and/c string? immutable?) |
(banner) → (and/c string? immutable?) |
(current-command-line-arguments) |
→ (vectorof (and/c string? immutable?)) |
(current-command-line-arguments argv) → void? |
argv : (vectorof (and/c string? immutable?)) |
(current-thread-initial-stack-size) → exact-positive-integer? |
(current-thread-initial-stack-size size) → void? |
size : exact-positive-integer? |
(vector-set-performance-stats! results [thd]) → void? | ||||||||
| ||||||||
thd : (or/c thread? #f) = #f |
For global statistics, up to 11 elements are set in the vector, starting from the beginning. If results has n elements where n < 11, then the n elements are set to the first n performance-statistics values. The reported statistics values are as follows, in the order that they are set within results:
0: The same value as returned by current-process-milliseconds.
1: The same value as returned by current-milliseconds.
2: The same value as returned by current-gc-milliseconds.
3: The number of garbage collections performed since start-up.
4: The number of thread context switches performed since start-up.
5: The number of internal stack overflows handled since start-up.
6: The number of threads currently scheduled for execution (i.e., threads that are running, not suspended, and not unscheduled due to a synchronization).
7: The number of syntax objects read from compiled code since start-up.
8: The number of hash-table searches performed. When this counter reaches the maximum value of a fixnum, it overflows to the most negative fixnum.
9: The number of additional hash slots searched to complete hash searches (using double hashing). When this counter reaches the maximum value of a fixnum, it overflows to the most negative fixnum.
10: The number of bytes allocated for machine code that is not reported by current-memory-use.
For thread-specific statistics, up to 4 elements are set in the vector:
0: #t if the thread is running, #f otherwise (same result as thread-running?).
1: #t if the thread has terminated, #f otherwise (same result as thread-dead?).
2: #t if the thread is currently blocked on a synchronizable event (or sleeping for some number of milliseconds), #f otherwise.
3: The number of bytes currently in use for the thread’s continuation.