emacs.d/clones/lisp/docs.racket-lang.org/reference/runtime.html

113 lines
53 KiB
HTML
Raw Normal View History

2022-08-24 19:36:32 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=0.8"/><title>15.8&nbsp;Environment and Runtime Information</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9658;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">The Racket Reference</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="Macros.html" class="tocviewlink" data-pltdoc="x">Macros</a></td></tr><tr><td align="right">13&nbsp;</td><td><a href="input-and-output.html" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr><tr><td align="right">14&nbsp;</td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr><tr><td align="right">15&nbsp;</td><td><a href="os.html" class="tocviewselflink" data-pltdoc="x">Operating System</a></td></tr><tr><td align="right">16&nbsp;</td><td><a href="memory.html" class="tocviewlink" data-pltdoc="x">Memory Management</a></td></tr><tr><td align="right">17&nbsp;</td><td><a href="unsafe.html" class="tocviewlink" data-pltdoc="x">Unsafe Operations</a></td></tr><tr><td align="right">18&nbsp;</td><td><a href="ru
for a running Racket. (Installation tools should use <span class="RktSym"><a href="https://download.racket-lang.org/releases/8.6/doc/local-redirect/index.html?doc=raco&amp;rel=cross-system.html%23%2528def._%2528%2528lib._setup%252Fcross-system..rkt%2529._cross-system-type%2529%2529&amp;version=8.6" class="RktValLink Sq" data-pltdoc="x">cross-system-type</a></span>,
instead, to support cross-installation.)</div></p><p>In <a name="(idx._(gentag._414._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">os</span> mode,
the possible symbol results are:</p><ul><li><p><a name="(idx._(gentag._415._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">unix</span></p></li><li><p><a name="(idx._(gentag._416._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">windows</span></p></li><li><p><a name="(idx._(gentag._417._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">macosx</span></p></li></ul><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>Prior to the introduction of <span class="RktVal">'</span><span class="RktVal">os*</span> and
<span class="RktVal">'</span><span class="RktVal">arch</span> modes, <span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-library-subpath%29%29" class="RktValLink" data-pltdoc="x">system-library-subpath</a></span><span class="stt"> </span><span class="RktVal">#f</span><span class="RktPn">)</span> could be
used to obtain this information somewhat indirectly.</p></blockquote></blockquote></blockquote><p>In <a name="(idx._(gentag._418._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">os*</span> mode, the result is similar to <span class="RktVal">'</span><span class="RktVal">os</span>
mode, but refined to a specific operating system, such as
<span class="RktVal">'</span><span class="RktVal">linux</span> or <span class="RktVal">'</span><span class="RktVal">freebsd</span>, instead of a generic
<span class="RktVal">'</span><span class="RktVal">unix</span> classification.</p><p>In <a name="(idx._(gentag._419._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">arch</span> mode, the result is a symbol representing an
architecture. Possible results include <span class="RktVal">'</span><span class="RktVal">x86_64</span>, <span class="RktVal">'</span><span class="RktVal">i386</span>,
<span class="RktVal">'</span><span class="RktVal">aarch64</span>, <span class="RktVal">'</span><span class="RktVal">arm</span> (32-bit), and <span class="RktVal">'</span><span class="RktVal">ppc</span> (32-bit).</p><p>In <a name="(idx._(gentag._420._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">word</span> mode, the result is either <span class="RktVal">32</span> or
<span class="RktVal">64</span> to indicate whether Racket is running as a 32-bit program
or 64-bit program.</p><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>See <a href="https://download.racket-lang.org/releases/8.6/doc/local-redirect/index.html?doc=guide&amp;rel=performance.html%23%2528part._virtual-machines%2529&amp;version=8.6" class="Sq" data-pltdoc="x">Racket Virtual Machine Implementations</a> for more information
about the <span class="RktVal">'</span><span class="RktVal">vm</span> and <span class="RktVal">'</span><span class="RktVal">gc</span> mode results.</p></blockquote></blockquote></blockquote><p>In <a name="(idx._(gentag._421._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">vm</span> mode,
the possible symbol results are (see also <a href="implementations.html" data-pltdoc="x">Implementations</a>):</p><ul><li><p><a name="(idx._(gentag._422._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">racket</span></p></li><li><p><a name="(idx._(gentag._423._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">chez-scheme</span></p></li></ul><p>In <a name="(idx._(gentag._424._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">gc</span> mode,
the possible symbol results are (see also <a href="implementations.html" data-pltdoc="x">Implementations</a>):</p><ul><li><p><a name="(idx._(gentag._425._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">cgc</span> &#8212;<wbr></wbr> when <span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">vm</span><span class="RktPn">)</span> is <span class="RktVal">'</span><span class="RktVal">racket</span></p></li><li><p><a name="(idx._(gentag._426._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">3m</span> &#8212;<wbr></wbr> when <span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">vm</span><span class="RktPn">)</span> is <span class="RktVal">'</span><span class="RktVal">racket</span></p></li><li><p><a name="(idx._(gentag._427._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">cs</span> &#8212;<wbr></wbr> when <span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">vm</span><span class="RktPn">)</span> is <span class="RktVal">'</span><span class="RktVal">chez-scheme</span></p></li></ul><p>In <a name="(idx._(gentag._428._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">link</span> mode, the possible symbol results are:</p><ul><li><p><a name="(idx._(gentag._429._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">static</span> (Unix)</p></li><li><p><a name="(idx._(gentag._430._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">shared</span> (Unix)</p></li><li><p><a name="(idx._(gentag._431._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">dll</span> (Windows)</p></li><li><p><a name="(idx._(gentag._432._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">framework</span> (Mac OS)</p></li></ul><p>Future ports of Racket may expand the list of <span class="RktVal">'</span><span class="RktVal">os</span>, <span class="RktVal">'</span><span class="RktVal">os*</span>,
<span class="RktVal">'</span><span class="RktVal">arch</span>, <span class="RktVal">'</span><span class="RktVal">vm</span>, <span class="RktVal">'</span><span class="RktVal">gc</span>, and <span class="RktVal">'</span><span class="RktVal">link</span> results.</p><p>In <a name="(idx._(gentag._433._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">machine</span> mode, then the result is a string, which
contains further details about the current machine in a
platform-specific format.</p><p>In <a name="(idx._(gentag._434._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">target-machine</span> mode, the result is a symbol for
the running Racket&rsquo;s native bytecode format, or it is <span class="RktVal">#f</span> if
there is no native format other than the machine-independent format.
If the result is a symbol, then <span class="RktSym"><a href="eval.html#%28def._%28%28quote._~23~25kernel%29._compile-target-machine~3f%29%29" class="RktValLink" data-pltdoc="x">compile-target-machine?</a></span> returns
<span class="RktVal">#t</span> when applied to the symbol; see also
<span class="RktSym"><a href="eval.html#%28def._%28%28quote._~23~25kernel%29._current-compile-target-machine%29%29" class="RktValLink" data-pltdoc="x">current-compile-target-machine</a></span>.</p><p>In <a name="(idx._(gentag._435._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">so-suffix</span> 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 <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-replace-suffix%29%29" class="RktValLink" data-pltdoc="x">path-replace-suffix</a></span>.</p><p>In <a name="(idx._(gentag._436._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">so-mode</span> mode, then the result is <span class="RktVal">'</span><span class="RktVal">local</span>
if foreign libraries should be opened in &ldquo;local&rdquo; mode by default
(as on most platforms) or <span class="RktVal">'</span><span class="RktVal">global</span> if foreign libraries
should be opened in &ldquo;global&rdquo; mode.</p><p>In <a name="(idx._(gentag._437._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">fs-change</span> mode, the result is an immutable vector
of four elements. Each element is either <span class="RktVal">#f</span> or a symbol,
where a symbol indicates the presence of a property and <span class="RktVal">#f</span>
indicates the absence of a property. The possible symbols, in order,
are:</p><ul><li><p><a name="(idx._(gentag._438._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">supported</span> &#8212;<wbr></wbr> <span class="RktSym"><a href="Filesystem.html#%28def._%28%28quote._~23~25kernel%29._filesystem-change-evt%29%29" class="RktValLink" data-pltdoc="x">filesystem-change-evt</a></span>
can produce a <a href="Filesystem.html#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change event</span></a> to monitor filesystem changes;
if this symbol is not first in the vector, all other vector elements
are <span class="RktVal">#f</span></p></li><li><p><a name="(idx._(gentag._439._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">scalable</span> &#8212;<wbr></wbr> resources consumed by a
<a href="Filesystem.html#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change event</span></a> are effectively limited only by
available memory, as opposed to file-descriptor limits; this property
is <span class="RktVal">#f</span> on Mac OS and BSD variants of Unix</p></li><li><p><a name="(idx._(gentag._440._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">low-latency</span> &#8212;<wbr></wbr> creation and checking of a
<a href="Filesystem.html#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change event</span></a> is practically instantaneous; this
property is <span class="RktVal">#f</span> on Linux</p></li><li><p><a name="(idx._(gentag._441._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">file-level</span> &#8212;<wbr></wbr> a <a href="Filesystem.html#%28tech._filesystem._change._event%29" class="techoutside" data-pltdoc="x"><span class="techinside">filesystem change
event</span></a> can track changes at the level of a file, as opposed to the
file&rsquo;s directory; this property is <span class="RktVal">#f</span> on Windows</p></li></ul><p>In <a name="(idx._(gentag._442._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">cross</span> mode, the result reports whether
cross-platform build mode has been selected (through the <span class="nobreak"><span class="stt">-C</span></span> or
<span class="nobreak"><span class="stt">--cross</span></span> argument to <span class="stt">racket</span>; see <a href="running-sa.html#%28part._mz-cmdline%29" data-pltdoc="x">Command Line</a>).
The possible symbols are:</p><ul><li><p><a name="(idx._(gentag._443._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">infer</span> &#8212;<wbr></wbr> infer cross-platform mode based on
whether <span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="RktPn">)</span> and <span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/releases/8.6/doc/local-redirect/index.html?doc=raco&amp;rel=cross-system.html%23%2528def._%2528%2528lib._setup%252Fcross-system..rkt%2529._cross-system-type%2529%2529&amp;version=8.6" class="RktValLink Sq" data-pltdoc="x">cross-system-type</a></span><span class="RktPn">)</span> report
the same symbol</p></li><li><p><a name="(idx._(gentag._444._(lib._scribblings/reference/reference..scrbl)))"></a><span class="RktVal">'</span><span class="RktVal">force</span> &#8212;<wbr></wbr> use cross-platform mode, even if the
current and target system types are the same, because the current and target
executables can be different</p></li></ul><p class="SHistory">Changed in version 6.8.0.2 of package <span class="stt">base</span>: Added <span class="RktVal">'</span><span class="RktVal">vm</span> mode.<br/>Changed in version 6.9.0.1: Added <span class="RktVal">'</span><span class="RktVal">cross</span> mode.<br/>Changed in version 7.1.0.6: Added <span class="RktVal">'</span><span class="RktVal">target-machine</span> mode.<br/>Changed in version 7.9.0.6: Added <span class="RktVal">'</span><span class="RktVal">os*</span> and <span class="RktVal">'</span><span class="RktVal">arch</span> modes.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._system-language+country))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-language%2Bcountry%29%29" class="RktValDef RktValLink" data-pltdoc="x">system-language+country</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns a string to identify the current user&rsquo;s language and
country.</div></p><p>On Unix and Mac OS, 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.</p><p>On Unix, the result is determined by checking the
<a name="(idx._(gentag._445._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">LC_ALL</span>, <a name="(idx._(gentag._446._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">LC_TYPE</span>, and
<a name="(idx._(gentag._447._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">LANG</span> environment variables, in that order (and the
result is used if the environment variable&rsquo;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, the result is determined by system calls.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._system-library-subpath))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-library-subpath%29%29" class="RktValDef RktValLink" data-pltdoc="x">system-library-subpath</a></span></span><span class="hspace">&nbsp;</span><span class="RktOpt">[</span><span class="RktVar">mode</span><span class="RktOpt">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">mode</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">cgc</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">3m</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">cs</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">gc</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a relative directory path. This string can be used to build
paths to system-specific files. For example, when Racket is running
on Solaris on a Sparc architecture, the subpath starts
<span class="RktVal">"sparc-solaris"</span>, while the subpath for Windows on an i386
architecture starts <span class="RktVal">"win32\\i386"</span>.</div></p><p>The optional <span class="RktVar">mode</span> argument specifies the relevant
garbage-collection variant, which one of the possible results of
<span class="RktPn">(</span><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._system-type%29%29" class="RktValLink" data-pltdoc="x">system-type</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">gc</span><span class="RktPn">)</span>: <span class="RktVal">'</span><span class="RktVal">cgc</span>, <span class="RktVal">'</span><span class="RktVal">3m</span>, or <span class="RktVal">'</span><span class="RktVal">cs</span>. It can also
be <span class="RktVal">#f</span>, in which case the result is independent of the
garbage-collection variant.</p><p>Installation tools should use <span class="RktSym"><a href="https://download.racket-lang.org/releases/8.6/doc/local-redirect/index.html?doc=raco&amp;rel=cross-system.html%23%2528def._%2528%2528lib._setup%252Fcross-system..rkt%2529._cross-system-library-subpath%2529%2529&amp;version=8.6" class="RktValLink Sq" data-pltdoc="x">cross-system-library-subpath</a></span>,
instead, to support cross-installation.</p><p class="SHistory">Changed in version 7.0 of package <span class="stt">base</span>: Added <span class="RktVal">'</span><span class="RktVal">cs</span> mode.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._version))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._version%29%29" class="RktValDef RktValLink" data-pltdoc="x">version</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._immutable~3f%29%29" class="RktValLink" data-pltdoc="x">immutable?</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns an immutable string indicating the currently executing version of
Racket.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._banner))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._banner%29%29" class="RktValDef RktValLink" data-pltdoc="x">banner</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._immutable~3f%29%29" class="RktValLink" data-pltdoc="x">immutable?</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns an immutable string for Racket&rsquo;s start-up banner text (or the
banner text for an embedding program, such as GRacket). The banner string
ends with a newline.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-command-line-arguments))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._current-command-line-arguments%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-command-line-arguments</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vectorof%29%29" class="RktValLink" data-pltdoc="x">vectorof</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._immutable~3f%29%29" class="RktValLink" data-pltdoc="x">immutable?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._current-command-line-arguments%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-command-line-arguments</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">argv</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">argv</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fvector..rkt%29._vectorof%29%29" class="RktValLink" data-pltdoc="x">vectorof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that is initialized with command-line arguments when
Racket starts (not including any command-line arguments that were
treated as flags for the system).</div></p><p>On Unix and Mac OS, command-line arguments are provided to the
Racket process as <a href="bytestrings.html#%28tech._byte._string%29" class="techoutside" data-pltdoc="x"><span class="techinside">byte strings</span></a>. The arguments are converted to
<a href="strings.html#%28tech._string%29" class="techoutside" data-pltdoc="x"><span class="techinside">strings</span></a> using <span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes-~3estring%2Flocale%29%29" class="RktValLink" data-pltdoc="x">bytes-&gt;string/locale</a></span> and
<span class="RktVal">#\uFFFD</span> as the encoding-error character.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-thread-initial-stack-size))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._current-thread-initial-stack-size%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-thread-initial-stack-size</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-positive-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-positive-integer?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._current-thread-initial-stack-size%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-thread-initial-stack-size</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">size</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">size</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-positive-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-positive-integer?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that provides a hint about how much space to reserve for a
newly created thread&rsquo;s local variables. The actual space used by a
computation is affected by <a href="eval.html#%28tech._jit%29" class="techoutside" data-pltdoc="x"><span class="techinside">JIT</span></a> compilation, but it is
otherwise platform-independent.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._vector-set-performance-stats!))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="runtime.html#%28def._%28%28quote._~23~25kernel%29._vector-set-performance-stats%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector-set-performance-stats!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">results</span><span class="hspace">&nbsp;</span><span class="RktOpt">[</span><span class="RktVar">thd</span><span class="RktOpt">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace">&nbsp;&nbsp;</span></td><td valign="top"><span class="RktVar">results</span></td><td valign="top"><span class="hspace">&nbsp;</span></td><td valign="top">:</td><td valign="top"><span class="hspace">&nbsp;</span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._and%2Fc%29%29" class="RktValLink" data-pltdoc="x">and/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="vectors.html#%28def._%28%28quote._~23~25kernel%29._vector~3f%29%29" class="RktValLink" data-pltdoc="x">vector?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._not%2Fc%29%29" class="RktValLink" data-pltdoc="x">not/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._immutable~3f%29%29" class="RktValLink" data-pltdoc="x">immutable?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">thd</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="threads.html#%28def._%28%28quote._~23~25kernel%29._thread~3f%29%29" class="RktValLink" data-pltdoc="x">thread?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Sets elements in <span class="RktVar">results</span> to report current performance
statistics. If <span class="RktVar">thd</span> is not <span class="RktVal">#f</span>, a particular set of
thread-specific statistics are reported, otherwise a different set of
global (within the current <a href="places.html#%28tech._place%29" class="techoutside" data-pltdoc="x"><span class="techinside">place</span></a>) statistics are reported.</div></p><p>For global statistics, up to <span style="font-style: italic"></span>1<span style="font-style: italic"></span>2<span style="font-style: italic"></span> elements are set in the vector,
starting from the beginning. If <span class="RktVar">results</span> has <span style="font-style: italic">n</span> elements
where <span style="font-style: italic">n &lt; </span>1<span style="font-style: italic"></span>2<span style="font-style: italic"></span>, then the <span style="font-style: italic">n</span> elements are set to the first
<span style="font-style: italic">n</span> performance-statistics values. The reported statistics values
are as follows, in the order that they are set within
<span class="RktVar">results</span>:</p><ul><li><p><span class="RktVal">0</span>: The same value as returned by
<span class="RktSym"><a href="time.html#%28def._%28%28quote._~23~25kernel%29._current-process-milliseconds%29%29" class="RktValLink" data-pltdoc="x">current-process-milliseconds</a></span>.</p></li><li><p><span class="RktVal">1</span>: The same value as returned
by <span class="RktSym"><a href="time.html#%28def._%28%28quote._~23~25kernel%29._current-milliseconds%29%29" class="RktValLink" data-pltdoc="x">current-milliseconds</a></span>.</p></li><li><p><span class="RktVal">2</span>: The same value as returned
by <span class="RktSym"><a href="time.html#%28def._%28%28quote._~23~25kernel%29._current-gc-milliseconds%29%29" class="RktValLink" data-pltdoc="x">current-gc-milliseconds</a></span>.</p></li><li><p><span class="RktVal">3</span>: The number of garbage collections performed since
start-up within the current <a href="places.html#%28tech._place%29" class="techoutside" data-pltdoc="x"><span class="techinside">place</span></a>.</p></li><li><p><span class="RktVal">4</span>: The number of thread context switches performed since
start-up.</p></li><li><p><span class="RktVal">5</span>: The number of internal stack overflows handled since
start-up.</p></li><li><p><span class="RktVal">6</span>: The number of threads currently scheduled for
execution (i.e., threads that are running, not suspended, and not
unscheduled due to a synchronization).</p></li><li><p><span class="RktVal">7</span>: The number of syntax objects read from compiled code
since start-up.</p></li><li><p><span class="RktVal">8</span>: The number of hash-table searches performed. When
this counter reaches the maximum value of a <a href="numbers.html#%28tech._fixnum%29" class="techoutside" data-pltdoc="x"><span class="techinside">fixnum</span></a>, it
overflows to the most negative <a href="numbers.html#%28tech._fixnum%29" class="techoutside" data-pltdoc="x"><span class="techinside">fixnum</span></a>.</p></li><li><p><span class="RktVal">9</span>: The number of additional hash slots searched to
complete hash searches (using double hashing). When this counter
reaches the maximum value of a <a href="numbers.html#%28tech._fixnum%29" class="techoutside" data-pltdoc="x"><span class="techinside">fixnum</span></a>, it overflows to the
most negative <a href="numbers.html#%28tech._fixnum%29" class="techoutside" data-pltdoc="x"><span class="techinside">fixnum</span></a>.</p></li><li><p><span class="RktVal">10</span>: The number of bytes allocated for machine code
that is not reported by <span class="RktSym"><a href="garbagecollection.html#%28def._%28%28quote._~23~25kernel%29._current-memory-use%29%29" class="RktValLink" data-pltdoc="x">current-memory-use</a></span>.</p></li><li><p><span class="RktVal">11</span>: The peak number of allocated bytes just
before a garbage collection.</p></li></ul><p>For thread-specific statistics, up to <span style="font-style: italic"></span>4<span style="font-style: italic"></span> elements are set in the
vector:</p><ul><li><p><span class="RktVal">0</span>: <span class="RktVal">#t</span> if the thread is running, <span class="RktVal">#f</span>
otherwise (same result as <span class="RktSym"><a href="threads.html#%28def._%28%28quote._~23~25kernel%29._thread-running~3f%29%29" class="RktValLink" data-pltdoc="x">thread-running?</a></span>).</p></li><li><p><span class="RktVal">1</span>: <span class="RktVal">#t</span> if the thread has terminated,
<span class="RktVal">#f</span> otherwise (same result as <span class="RktSym"><a href="threads.html#%28def._%28%28quote._~23~25kernel%29._thread-dead~3f%29%29" class="RktValLink" data-pltdoc="x">thread-dead?</a></span>).</p></li><li><p><span class="RktVal">2</span>: <span class="RktVal">#t</span> if the thread is currently blocked on a
synchronizable event (or sleeping for some number of milliseconds),
<span class="RktVal">#f</span> otherwise.</p></li><li><p><span class="RktVal">3</span>: The number of bytes currently in use for the
thread&rsquo;s continuation.</p></li></ul><p class="SHistory">Changed in version 6.1.1.8 of package <span class="stt">base</span>: Added vector position <span class="RktVal">11</span> for global statistics.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" id="searchbox" type="text" tabindex="1" placeholder="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;8.6&quot;, &quot;../&quot;);"/></form>&nbsp;&nbsp;<a href="https://docs.racket-lang.org/index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;8.6&quot;);">top</a><span class="tocsettoggle">&nbsp;&nbsp;<a href="javascript:void(0);" title="show/hide table of contents" onclick="TocsetToggle();">contents</a></span></span><span class="navright">&nbsp;&nbsp;<a href="envvars.html" title="backward to &quot;15.7 Environment Variables&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="os.html" title="up to &quot;15 Operating System&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Command-Line_Parsing.html" title="forward to &quot;15.9 Command-Line Parsing&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>