LIB$ - General Routines
Overview
VX/LIB$ is a call-compatible implementation of the OpenVMS LIB$ general-purpose run-time library for x86 and ARM Linux. Applications that call LIB$ routines for string handling, integer and extended arithmetic, date and time, virtual-memory management, queues, balanced trees, and system services link against the VX runtime and run unchanged, keeping the same calling conventions, string descriptors, and condition-code behavior they relied on under OpenVMS.
VX/LIB$ is a library, not a server or daemon. Its routines are compiled into the VX runtime library and linked directly into the migrated program. Over 150 LIB$ entry points are implemented and exposed under their VMS dollar-sign names as well as portable C and Fortran-callable aliases, so existing object references resolve and existing source compiles without rewriting the calling logic. VX/LIB$ integrates with VX/RT to deliver full OpenVMS utility functionality across x86 and ARM Linux.
<!-- Webflow embed (min). Source: lib-page-technical/lib-tech-body-embed-dark.html → python3 website/embeds/minify_webflow_embed.py … -->
<div class="s7-tech-embed" data-vxlibd-body-embed="1" data-technical-mega-embed="1" lang="en"><h2 id="architecture">Architecture and linkage</h2><p>
VX/LIB$ is a library, not a running service. Its routines are compiled from C++ (with a
small number of C modules) into object modules and archived into the VX runtime static
library, <code>libvxrt.a</code>. A migrated application links that archive and calls the
<code>LIB$</code> entry points directly, exactly as it linked the OpenVMS run-time library
before. There is no LIB$ server process, no daemon, and no inter-process substrate to
configure.
</p><div class="table-wrapper"><table><thead><tr><th>Property</th><th>VX/LIB$</th></tr></thead><tbody><tr><td>Delivery</td><td>Object modules archived into <code>libvxrt.a</code>, linked into the application.</td></tr><tr><td>Implementation language</td><td>C++ with <code>extern "C"</code> bodies, plus a small number of C modules.</td></tr><tr><td>Public entry points</td><td>Over 150 distinct <code>LIB$</code> routines.</td></tr><tr><td>Calling model</td><td>Direct in-process function calls; no runtime server, no IPC.</td></tr><tr><td>Target platforms</td><td>x86 and ARM Linux, through the VX/RT runtime.</td></tr><tr><td>Prototypes</td><td>Shared VX headers (string descriptors, aliases, <code>lib$routines.h</code>).</td></tr></tbody></table></div><h6>Link model</h6><style>.s7-tech-embed .process-flow {margin: 1.5rem 0;padding: 16px;border: 1px solid var(--s7t-border);border-radius: 10px;background: rgba(255, 255, 255, 0.01);}.s7-tech-embed .process-endpoint {display: grid;grid-template-columns: 72px minmax(0, 1fr);gap: 14px;align-items: center;padding: 14px 16px;border-radius: 8px;background: var(--s7t-surface);color: var(--s7t-text);}.s7-tech-embed .process-output {border: 1px solid var(--s7t-note-bd);background: var(--s7t-note-bg);}.s7-tech-embed .process-runtime {margin-top: 10px;}.s7-tech-embed .process-label,.s7-tech-embed .process-number {font-family: var(--s7t-mono);color: var(--s7t-accent);font-size: 0.76em;font-weight: 700;letter-spacing: 0.08em;text-transform: uppercase;}.s7-tech-embed .process-endpoint div,.s7-tech-embed .process-stage {min-width: 0;}.s7-tech-embed .process-endpoint strong,.s7-tech-embed .process-endpoint span:last-child,.s7-tech-embed .process-stage strong,.s7-tech-embed .process-stage span:last-child {display: block;}.s7-tech-embed .process-endpoint strong,.s7-tech-embed .process-stage strong {margin-bottom: 4px;color: var(--s7t-text);}.s7-tech-embed .process-endpoint span:last-child,.s7-tech-embed .process-stage span:last-child {color: var(--s7t-muted);font-size: 0.9em;line-height: 1.45;}.s7-tech-embed .process-stages {display: grid;grid-template-columns: repeat(3, minmax(0, 1fr));gap: 10px;margin: 10px 0;}.s7-tech-embed .process-stage {padding: 15px;border-top: 3px solid var(--s7t-accent);border-radius: 6px;background: var(--s7t-surface2);color: var(--s7t-text);}.s7-tech-embed .process-stage .process-number {margin-bottom: 10px;}@media (max-width: 800px) {.s7-tech-embed .process-stages {grid-template-columns: 1fr;}.s7-tech-embed .process-endpoint {grid-template-columns: 1fr;gap: 5px;}}</style><div class="process-flow" aria-label="VX/LIB link model and routine families"><div class="process-endpoint"><span class="process-label">Caller</span><div><strong>Application object code</strong><span>Calls LIB$INDEX, LIB$GET_VM, LIB$ADD_TIMES, LIB$SYS_FAO, and related routines.</span></div></div><div class="process-endpoint process-runtime"><span class="process-label">Archive</span><div><strong>LIB$ object modules in libvxrt.a</strong><span>The linker resolves each LIB$ call to its service-family implementation.</span></div></div><div class="process-stages"><div class="process-stage"><span class="process-number">01</span><strong>String</strong><span>Descriptor-aware string inspection, comparison, and formatting.</span></div><div class="process-stage"><span class="process-number">02</span><strong>Arithmetic</strong><span>Integer arithmetic and related utility routines.</span></div><div class="process-stage"><span class="process-number">03</span><strong>Time</strong><span>Time arithmetic, conversion, and comparison.</span></div><div class="process-stage"><span class="process-number">04</span><strong>Virtual memory</strong><span>Allocation, release, and VM zone services.</span></div><div class="process-stage"><span class="process-number">05</span><strong>Tree</strong><span>Balanced-tree lookup and insertion services.</span></div><div class="process-stage"><span class="process-number">06</span><strong>System</strong><span>Signaling, FAO formatting, and host-facing utilities.</span></div></div><div class="process-endpoint process-output"><span class="process-label">Target</span><div><strong>VX/RT runtime</strong><span>x86 or ARM Linux.</span></div></div></div><div class="callout"><strong>No server to administer.</strong> LIB$ services resolve at link time and execute
in-process. Deploying VX/LIB$ means shipping the linked binary, not standing up a service
or configuring a daemon.
</div><h2 id="conventions">Naming, linkage and calling conventions</h2><p>
Every routine is exposed under several equivalent names, so existing object references and
source in any supported language resolve without change. The VMS dollar-sign form
(<code>LIB$INDEX</code>) and its lowercase spelling (<code>lib$index</code>) are aliases for
a canonical C symbol; Fortran callers reach the same body through a thunk that unpacks the
hidden trailing length arguments the Fortran ABI passes.
</p><div class="table-wrapper"><table><thead><tr><th>Name form</th><th>Example</th><th>Used by</th></tr></thead><tbody><tr><td>VMS dollar-sign name</td><td><code>LIB$INDEX</code></td><td>Recompiled OpenVMS object code and assembler references.</td></tr><tr><td>Lowercase alias</td><td><code>lib$index</code></td><td>Case-sensitive toolchains and mixed-case source.</td></tr><tr><td>Canonical C symbol</td><td><code>LIB_D_INDEX</code></td><td>Portable C and C++ callers.</td></tr><tr><td>Fortran-callable thunk</td><td><code>LIB$CRC</code> (with length args)</td><td>Fortran callers that pass hidden string lengths.</td></tr></tbody></table></div><h6>Condition-code convention</h6><p>
Routines that report status return a 32-bit VMS condition value <strong>by value</strong>:
<strong>odd means success, even means failure</strong>. Callers test the low bit
(<code>status & 1</code>, or <code>ODD(status)</code> in the original languages) rather
than comparing against a single success constant, because success can be reported as either
<code>SS$_NORMAL</code> or <code>LIB$_NORMAL</code>. A small number of routines report
results by raising a VMS-style signal instead of returning: <code>LIB$SIGNAL</code>,
<code>LIB$STOP</code> and <code>LIB$SIG_TO_STOP</code>, caught through
<code>LIB$ESTABLISH</code> or an equivalent handler.
</p><div class="table-wrapper"><table><thead><tr><th>Symbol</th><th>Value</th><th>Meaning</th></tr></thead><tbody><tr><td><code>SS$_NORMAL</code></td><td><code>1</code></td><td>Generic success.</td></tr><tr><td><code>LIB$_NORMAL</code></td><td><code>0x158009</code></td><td>LIB$ success (distinct from <code>SS$_NORMAL</code>).</td></tr><tr><td><code>LIB$_STRTRU</code></td><td><code>0x158040</code></td><td>Output string truncated (qualified success).</td></tr><tr><td><code>LIB$_INTOVF</code></td><td><code>0x150854</code></td><td>Integer overflow.</td></tr><tr><td><code>LIB$_INVARG</code></td><td><code>0x158094</code></td><td>Invalid argument.</td></tr><tr><td><code>LIB$_INSVIRMEM</code></td><td><code>0x15800C</code></td><td>Insufficient virtual memory.</td></tr><tr><td><code>LIB$_ONEDELTIM</code></td><td><code>0x158434</code></td><td>At least one delta time required.</td></tr><tr><td><code>LIB$_KEYNOTFOU</code></td><td><code>0x158184</code></td><td>Key not found (tree lookup).</td></tr><tr><td><code>LIB$_QUEWASEMP</code></td><td><code>0x15816C</code></td><td>Queue was empty.</td></tr></tbody></table></div><h6>A routine body</h6><p>
Routine bodies are plain <code>extern "C"</code> functions that unpack their string
descriptors and return a condition value or result. <code>LIB$INDEX</code>, which returns
the 1-based position of a substring, is representative:
</p>
<pre><span class="kw">extern "C"</span> U32 LIB_D_INDEX( VMS_DESCR *sourcestring, VMS_DESCR *substring )
{
<span class="cmt">/* unpack both descriptors to pointer + length */</span>
subp = vxrt_strptr16(substring, &subl);
srcp = vxrt_strptr16(sourcestring, &srcl);
<span class="kw">if</span> (subl > srcl) <span class="kw">return</span> 0;
<span class="kw">for</span> (i = 0; i < srcl && (i + subl) <= srcl; i++)
<span class="kw">if</span> (!memcmp(srcp + i, subp, subl)) <span class="kw">return</span> i + 1;
<span class="kw">return</span> 0;
}</pre>
<h6>Calling a routine</h6><p>
A migrated program links against <code>libvxrt.a</code> and calls the <code>LIB$</code>
entry points directly. The example below allocates a buffer, locates a field within a
statement line, and formats an operator message, testing the low bit of each status:
</p>
<pre><span class="cmt">/* allocate a working buffer from LIB$ virtual memory */</span>
status = <span class="kw">LIB$GET_VM</span>(&buf_size, &buffer_addr);
<span class="kw">if</span> (!(status & 1)) <span class="kw">return</span> status; <span class="cmt">/* odd = success */</span>
<span class="cmt">/* 1-based position of the account reference in a statement line */</span>
position = <span class="kw">LIB$INDEX</span>(&statement_line, &acct_ref);
<span class="cmt">/* format an operator message with FAO directives */</span>
status = <span class="kw">LIB$SYS_FAO</span>(&fao_control, &out_len, &message,
transfer_id, transfer_amount);
<span class="cmt">/* release the buffer back to the VM zone */</span>
status = <span class="kw">LIB$FREE_VM</span>(&buf_size, &buffer_addr);</pre>
<h2 id="data-model">Data model</h2><p>
Two OpenVMS data conventions matter to almost every caller: the string descriptor and the
quadword. VX/LIB$ accepts both the 32-bit and 64-bit VMS descriptor layouts and infers
which one is in use from the descriptor's first word, so mixed 32-bit and 64-bit code links
together without change.
</p><h6>String descriptors</h6><p>
String arguments are passed by descriptor rather than as bare pointers. The descriptor
records the storage class, data type, length, and address of the string. The storage class
determines how the buffer is managed:
</p><div class="table-wrapper"><table><thead><tr><th>Class</th><th>Value</th><th>Storage</th></tr></thead><tbody><tr><td><code>DSC$K_CLASS_S</code></td><td>1</td><td>Static: a fixed caller-supplied buffer.</td></tr><tr><td><code>DSC$K_CLASS_D</code></td><td>2</td><td>Dynamic: runtime-allocated and resizable through <code>LIB$SGET1_DD</code>.</td></tr><tr><td><code>DSC$K_CLASS_VS</code></td><td>11</td><td>Varying: a 16-bit current-length prefix plus a fixed buffer.</td></tr><tr><td><code>DSC$K_CLASS_SD</code></td><td>9</td><td>Scaled decimal, used by <code>LIB$CVT_DX_DX</code>.</td></tr></tbody></table></div><h6>Quadwords and VMS time</h6><p>
Time values are 64-bit quadwords, a pair of 32-bit fields (a low and a high longword). VMS
time is counted in 100-nanosecond ticks from the standard 1858-11-17 epoch. A
<strong>delta</strong> (relative) time is distinguished from an absolute time by the top bit
of the high longword, which the time routines test before choosing how to add, subtract, or
scale two values. This is why routines such as <code>LIB$ADD_TIMES</code> and
<code>LIB$SUB_TIMES</code> return <code>LIB$_ONEDELTIM</code> when neither operand is a
delta time: the operation is only defined when at least one operand is relative.
</p><h2 id="routine-groups">Routine groups</h2><p>
The LIB$ library spans a wide range of general-purpose services. The table below groups the
implemented routines by function and names a representative sample from each group; the full
list follows in the next section.
</p><div class="table-wrapper"><table><thead><tr><th>Group</th><th>What it covers</th><th>Representative routines</th></tr></thead><tbody><tr><td>Integer and bit arithmetic</td><td>Extended-precision add, subtract, multiply and divide, and bit-field operations.</td><td><code>LIB$ADDX</code>, <code>LIB$SUBX</code>, <code>LIB$EDIV</code>, <code>LIB$EMUL</code>, <code>LIB$INSV</code>, <code>LIB$FFS</code></td></tr><tr><td>String and character</td><td>Search, compare, move, translate and copy operations over descriptor strings.</td><td><code>LIB$INDEX</code>, <code>LIB$LEN</code>, <code>LIB$MATCHC</code>, <code>LIB$SCANC</code>, <code>LIB$MOVC3</code>, <code>LIB$MOVTC</code></td></tr><tr><td>Date and time</td><td>Current time, time arithmetic, and conversion to and from the system internal time format.</td><td><code>LIB$DATE_TIME</code>, <code>LIB$ADD_TIMES</code>, <code>LIB$SUB_TIMES</code>, <code>LIB$DAY_OF_WEEK</code>, <code>LIB$FORMAT_DATE_TIME</code></td></tr><tr><td>Data conversion</td><td>Radix conversion, numeric formatting, and character-set translation.</td><td><code>LIB$CVT_HTB</code>, <code>LIB$CVT_OTB</code>, <code>LIB$CURRENCY</code>, <code>LIB$TRA_ASC_EBC</code>, <code>LIB$TRA_EBC_ASC</code></td></tr><tr><td>Virtual memory (32 and 64 bit)</td><td>General allocation, page allocation, and zone management in both addressing modes.</td><td><code>LIB$GET_VM</code>, <code>LIB$FREE_VM</code>, <code>LIB$CREATE_VM_ZONE</code>, <code>LIB$GET_VM_64</code></td></tr><tr><td>Queues and trees</td><td>Self-relative interlocked queues and balanced binary trees.</td><td><code>LIB$INSQHI</code>, <code>LIB$REMQTI</code>, <code>LIB$INSERT_TREE</code>, <code>LIB$LOOKUP_TREE</code></td></tr><tr><td>Symbols, logicals and common</td><td>DCL symbol and logical-name access and the inter-image common block.</td><td><code>LIB$GET_SYMBOL</code>, <code>LIB$SET_LOGICAL</code>, <code>LIB$SYS_TRNLOG</code>, <code>LIB$GET_COMMON</code></td></tr><tr><td>Process and system information</td><td>Device, process, queue and system inquiry, and subprocess control.</td><td><code>LIB$GETDVI</code>, <code>LIB$GETJPI</code>, <code>LIB$GETSYI</code>, <code>LIB$SPAWN</code>, <code>LIB$RUN_PROGRAM</code></td></tr><tr><td>Screen and terminal</td><td>Cursor placement, screen and line erase, scrolling and buffered output.</td><td><code>LIB$SET_CURSOR</code>, <code>LIB$ERASE_LINE</code>, <code>LIB$PUT_SCREEN</code>, <code>LIB$SCREEN_INFO</code></td></tr><tr><td>Condition handling and signals</td><td>Establishing and reverting handlers and signalling conditions.</td><td><code>LIB$SIGNAL</code>, <code>LIB$STOP</code>, <code>LIB$ESTABLISH</code>, <code>LIB$REVERT</code>, <code>LIB$SIG_TO_RET</code></td></tr><tr><td>Files</td><td>File search, scan, rename, delete and directory creation.</td><td><code>LIB$FIND_FILE</code>, <code>LIB$FILE_SCAN</code>, <code>LIB$DELETE_FILE</code>, <code>LIB$CREATE_DIR</code></td></tr><tr><td>Event flags, LUNs and timers</td><td>Allocation of event flags and logical unit numbers, and timing statistics.</td><td><code>LIB$GET_EF</code>, <code>LIB$GET_LUN</code>, <code>LIB$INIT_TIMER</code>, <code>LIB$STAT_TIMER</code></td></tr><tr><td>Messages and formatting</td><td>FAO output formatting, system message retrieval, and input and output helpers.</td><td><code>LIB$SYS_FAO</code>, <code>LIB$SYS_FAOL</code>, <code>LIB$SYS_GETMSG</code>, <code>LIB$PUT_OUTPUT</code></td></tr><tr><td>Checksums</td><td>CRC checksum generation over a descriptor byte stream.</td><td><code>LIB$CRC</code>, <code>LIB$CRC_TABLE</code></td></tr></tbody></table></div><h2 id="callable-routines">VX/LIB$ callable routines</h2><p>
The full set of callable routines, over 150 in total, spanning string handling, arithmetic,
date and time, virtual memory, queues, trees, screen control, files, and system services.
Each is available under its VMS dollar-sign name as well as the portable C and
Fortran-callable aliases described above.
</p><div class="table-wrapper"><table><thead><tr><th>LIB$ API</th><th>Function</th></tr></thead><tbody><tr><td><code>LIB$ADAWI</code></td><td>Adds a word-integer value</td></tr><tr><td><code>LIB$ADD_TIMES</code></td><td>Add two time values</td></tr><tr><td><code>LIB$ADDX</code></td><td>Add two numbers</td></tr><tr><td><code>LIB$ANALYZE_SDESC</code></td><td>Analyze string descriptor</td></tr><tr><td><code>LIB$ASN_WTH_MBX</code></td><td>Assigns a mailbox for communication</td></tr><tr><td><code>LIB$AST_IN_PROG</code></td><td>Checks if an AST (Asynchronous System Trap) is in progress</td></tr><tr><td><code>LIB$ATTACH</code></td><td>Attach to process</td></tr><tr><td><code>LIB$BBCCI</code></td><td>Performs bitwise operations on bit fields</td></tr><tr><td><code>LIB$CALLG</code></td><td>General call function</td></tr><tr><td><code>LIB$CALLG_64</code></td><td>Calls a function with arguments in 64-bit addressing</td></tr><tr><td><code>LIB$CONVERT_DATE_STRING</code></td><td>Convert date string</td></tr><tr><td><code>LIB$CRC</code></td><td>Compute CRC checksum</td></tr><tr><td><code>LIB$CRC_TABLE</code></td><td>Generate CRC table</td></tr><tr><td><code>LIB$CREATE_DIR</code></td><td>Create a directory</td></tr><tr><td><code>LIB$CREATE_VM_ZONE</code></td><td>Create VM zone</td></tr><tr><td><code>LIB$CREATE_VM_ZONE_64</code></td><td>Creates a 64-bit virtual memory zone</td></tr><tr><td><code>LIB$CURRENCY</code></td><td>Formats numbers as currency values</td></tr><tr><td><code>LIB$CVT_DTB</code></td><td>Convert date to binary</td></tr><tr><td><code>LIB$CVT_DTB_64</code></td><td>Converts a 64-bit date-time value to binary</td></tr><tr><td><code>LIB$CVT_DX_DX</code></td><td>Convert descriptor to descriptor</td></tr><tr><td><code>LIB$CVT_FROM_INTERNAL_TIME</code></td><td>Converts system internal time to standard format</td></tr><tr><td><code>LIB$CVT_HTB</code></td><td>Convert hex to binary</td></tr><tr><td><code>LIB$CVT_OTB</code></td><td>Convert octal to binary</td></tr><tr><td><code>LIB$CVT_TO_INTERNAL_TIME</code></td><td>Convert to internal time</td></tr><tr><td><code>LIB$CVT_VECTIM</code></td><td>Converts vector time format to system time</td></tr><tr><td><code>LIB$CVTF_FROM_INTERNAL_TIME</code></td><td>Converts floating-point internal time to standard format</td></tr><tr><td><code>LIB$CVTF_TO_INTERNAL_TIME</code></td><td>Converts standard time to floating-point internal time</td></tr><tr><td><code>LIB$CVTS_FROM_INTERNAL_TIME</code></td><td>Converts string-formatted internal time to standard</td></tr><tr><td><code>LIB$CVTS_TO_INTERNAL_TIME</code></td><td>Converts standard time to string-formatted internal time</td></tr><tr><td><code>LIB$DATE_TIME</code></td><td>Get current date and time</td></tr><tr><td><code>LIB$DAY</code></td><td>Get day value</td></tr><tr><td><code>LIB$DAY_OF_WEEK</code></td><td>Get day of the week</td></tr><tr><td><code>LIB$DELETE_FILE</code></td><td>Delete a file</td></tr><tr><td><code>LIB$DELETE_LOGICAL</code></td><td>Delete logical name</td></tr><tr><td><code>LIB$DELETE_SYMBOL</code></td><td>Delete a symbol</td></tr><tr><td><code>LIB$DELETE_VM_ZONE</code></td><td>Delete VM zone</td></tr><tr><td><code>LIB$DELETE_VM_ZONE_64</code></td><td>Deletes a 64-bit virtual memory zone</td></tr><tr><td><code>LIB$DIGIT_SEP</code></td><td>Format digit separators</td></tr><tr><td><code>LIB$DISABLE_CTRL</code></td><td>Disable control characters</td></tr><tr><td><code>LIB$DO_COMMAND</code></td><td>Execute a command</td></tr><tr><td><code>LIB$DOWN_SCROLL</code></td><td>Scrolls the display downwards</td></tr><tr><td><code>LIB$EDIV</code></td><td>Performs extended division on large integers</td></tr><tr><td><code>LIB$EMUL</code></td><td>Performs extended multiplication</td></tr><tr><td><code>LIB$ENABLE_CTRL</code></td><td>Enable control characters</td></tr><tr><td><code>LIB$ERASE_LINE</code></td><td>Erase line on display</td></tr><tr><td><code>LIB$ERASE_PAGE</code></td><td>Erase page on display</td></tr><tr><td><code>LIB$ESTABLISH</code></td><td>Set up error handler</td></tr><tr><td><code>LIB$EXTV</code></td><td>Extend vector operation</td></tr><tr><td><code>LIB$EXTZV</code></td><td>Extend zero vector</td></tr><tr><td><code>LIB$FFC</code></td><td>Find first character</td></tr><tr><td><code>LIB$FFS</code></td><td>Find first set bit</td></tr><tr><td><code>LIB$FILE_SCAN</code></td><td>Scans files for specified patterns</td></tr><tr><td><code>LIB$FILE_SCAN_END</code></td><td>Ends a file scanning operation</td></tr><tr><td><code>LIB$FIND_FILE</code></td><td>Find file in directory</td></tr><tr><td><code>LIB$FIND_FILE_END</code></td><td>End file search</td></tr><tr><td><code>LIB$FIND_IMAGE_SYMBOL</code></td><td>Find symbol in image</td></tr><tr><td><code>LIB$FIND_VM_ZONE</code></td><td>Locates a virtual memory zone</td></tr><tr><td><code>LIB$FIND_VM_ZONE_64</code></td><td>Locates a 64-bit virtual memory zone</td></tr><tr><td><code>LIB$FORMAT_DATE_TIME</code></td><td>Format date and time</td></tr><tr><td><code>LIB$FREE_DATE_TIME_CONTEXT</code></td><td>Releases memory allocated for date-time processing</td></tr><tr><td><code>LIB$FREE_EF</code></td><td>Free event flag</td></tr><tr><td><code>LIB$FREE_LUN</code></td><td>Free logical unit number</td></tr><tr><td><code>LIB$FREE_TIMER</code></td><td>Free timer resource</td></tr><tr><td><code>LIB$FREE_VM</code></td><td>Free virtual memory</td></tr><tr><td><code>LIB$FREE_VM_64</code></td><td>Releases 64-bit virtual memory</td></tr><tr><td><code>LIB$FREE_VM_PAGE</code></td><td>Frees a virtual memory page</td></tr><tr><td><code>LIB$FREE_VM_PAGE_64</code></td><td>Frees a 64-bit virtual memory page</td></tr><tr><td><code>LIB$GET_COMMAND</code></td><td>Retrieves the current command input</td></tr><tr><td><code>LIB$GET_COMMON</code></td><td>Get common block data</td></tr><tr><td><code>LIB$GET_EF</code></td><td>Get event flag</td></tr><tr><td><code>LIB$GET_FOREIGN</code></td><td>Get foreign command</td></tr><tr><td><code>LIB$GET_HOSTNAME</code></td><td>Retrieves the system's hostname</td></tr><tr><td><code>LIB$GET_INPUT</code></td><td>Get input from user</td></tr><tr><td><code>LIB$GET_LOGICAL</code></td><td>Get logical name</td></tr><tr><td><code>LIB$GET_LUN</code></td><td>Get logical unit number</td></tr><tr><td><code>LIB$GET_SYMBOL</code></td><td>Get symbol value</td></tr><tr><td><code>LIB$GET_VM</code></td><td>Get virtual memory</td></tr><tr><td><code>LIB$GET_VM_64</code></td><td>Allocates 64-bit virtual memory</td></tr><tr><td><code>LIB$GET_VM_PAGE</code></td><td>Allocates a virtual memory page</td></tr><tr><td><code>LIB$GET_VM_PAGE_64</code></td><td>Allocates a 64-bit virtual memory page</td></tr><tr><td><code>LIB$GETDVI</code></td><td>Get device information</td></tr><tr><td><code>LIB$GETJPI</code></td><td>Get job process info</td></tr><tr><td><code>LIB$GETQUI</code></td><td>Retrieves queue information synchronously</td></tr><tr><td><code>LIB$GETSYI</code></td><td>Get system info</td></tr><tr><td><code>LIB$INDEX</code></td><td>Find index in string</td></tr><tr><td><code>LIB$INIT_DATE_TIME_CONTEXT</code></td><td>Initialize date-time context</td></tr><tr><td><code>LIB$INIT_TIMER</code></td><td>Initialize timer</td></tr><tr><td><code>LIB$INSERT_TREE</code></td><td>Insert item in tree</td></tr><tr><td><code>LIB$INSQHI</code></td><td>Insert queue head</td></tr><tr><td><code>LIB$INSQTI</code></td><td>Insert queue tail</td></tr><tr><td><code>LIB$INSV</code></td><td>Insert bit field</td></tr><tr><td><code>LIB$LEN</code></td><td>Get string length</td></tr><tr><td><code>LIB$LOCC</code></td><td>Finds the first occurrence of a character in a string</td></tr><tr><td><code>LIB$LOOKUP_TREE</code></td><td>Lookup in tree structure</td></tr><tr><td><code>LIB$MATCH_COND</code></td><td>Match condition</td></tr><tr><td><code>LIB$MATCHC</code></td><td>Match characters</td></tr><tr><td><code>LIB$MOVC3</code></td><td>Move characters</td></tr><tr><td><code>LIB$MOVC5</code></td><td>Move characters with fill</td></tr><tr><td><code>LIB$MOVTC</code></td><td>Move and transform characters</td></tr><tr><td><code>LIB$MULT_DELTA_TIME</code></td><td>Multiplies delta time values</td></tr><tr><td><code>LIB$MULTS_DELTA_TIME</code></td><td>Multiplies scaled delta time values</td></tr><tr><td><code>LIB$PUT_BUFFER</code></td><td>Write to buffer</td></tr><tr><td><code>LIB$PUT_COMMON</code></td><td>Write to common block</td></tr><tr><td><code>LIB$PUT_LINE</code></td><td>Outputs a formatted line of text</td></tr><tr><td><code>LIB$PUT_OUTPUT</code></td><td>Write output</td></tr><tr><td><code>LIB$PUT_SCREEN</code></td><td>Write to screen</td></tr><tr><td><code>LIB$RADIX_POINT</code></td><td>Get radix point</td></tr><tr><td><code>LIB$REMOVE_TREE</code></td><td>Removes an entry from a balanced tree structure</td></tr><tr><td><code>LIB$REMQHI</code></td><td>Remove queue head</td></tr><tr><td><code>LIB$REMQTI</code></td><td>Remove queue tail</td></tr><tr><td><code>LIB$RENAME_FILE</code></td><td>Rename a file</td></tr><tr><td><code>LIB$RESET_VM_ZONE</code></td><td>Resets a virtual memory zone</td></tr><tr><td><code>LIB$RESET_VM_ZONE_64</code></td><td>Resets a 64-bit virtual memory zone</td></tr><tr><td><code>LIB$REVERT</code></td><td>Revert to previous state</td></tr><tr><td><code>LIB$RUN_PROGRAM</code></td><td>Run a program</td></tr><tr><td><code>LIB$SCANC</code></td><td>Scan for characters</td></tr><tr><td><code>LIB$SCOPY_DXDX</code></td><td>Copy descriptor data</td></tr><tr><td><code>LIB$SCOPY_R_DX</code></td><td>Copies a descriptor-based string with right justification</td></tr><tr><td><code>LIB$SCREEN_INFO</code></td><td>Get screen info</td></tr><tr><td><code>LIB$SET_BUFFER</code></td><td>Set buffer contents</td></tr><tr><td><code>LIB$SET_CURSOR</code></td><td>Set cursor position</td></tr><tr><td><code>LIB$SET_LOGICAL</code></td><td>Set logical name</td></tr><tr><td><code>LIB$SET_SCROLL</code></td><td>Configures display scrolling settings</td></tr><tr><td><code>LIB$SET_SYMBOL</code></td><td>Set symbol value</td></tr><tr><td><code>LIB$SFREE1_DD</code></td><td>Frees a dynamically allocated descriptor</td></tr><tr><td><code>LIB$SGET1_DD</code></td><td>Retrieves a dynamically allocated descriptor</td></tr><tr><td><code>LIB$SHOW_TIMER</code></td><td>Displays system timer settings</td></tr><tr><td><code>LIB$SHOW_TIMER_</code></td><td>Displays system timer settings (alternative version)</td></tr><tr><td><code>LIB$SHOW_VM</code></td><td>Displays virtual memory details</td></tr><tr><td><code>LIB$SHOW_VM_ZONE</code></td><td>Displays information about a virtual memory zone</td></tr><tr><td><code>LIB$SHOW_VM_ZONE_64</code></td><td>Displays information about a 64-bit virtual memory zone</td></tr><tr><td><code>LIB$SIG_TO_RET</code></td><td>Converts a signal code to a return status</td></tr><tr><td><code>LIB$SIG_TO_STOP</code></td><td>Converts a signal to a process stop action</td></tr><tr><td><code>LIB$SIGNAL</code></td><td>Send signal</td></tr><tr><td><code>LIB$SKPC</code></td><td>Skip characters</td></tr><tr><td><code>LIB$SPANC</code></td><td>Span characters</td></tr><tr><td><code>LIB$SPAWN</code></td><td>Spawn subprocess</td></tr><tr><td><code>LIB$STAT_TIMER</code></td><td>Retrieves statistics for system timers</td></tr><tr><td><code>LIB$STAT_VM</code></td><td>Retrieves virtual memory statistics</td></tr><tr><td><code>LIB$STOP</code></td><td>Stop execution</td></tr><tr><td><code>LIB$SUB_TIMES</code></td><td>Subtract time values</td></tr><tr><td><code>LIB$SUBX</code></td><td>Subtract values</td></tr><tr><td><code>LIB$SYS_ASCTIM</code></td><td>Convert time to ASCII</td></tr><tr><td><code>LIB$SYS_FAO</code></td><td>Format output message</td></tr><tr><td><code>LIB$SYS_FAOL</code></td><td>Format output</td></tr><tr><td><code>LIB$SYS_GETMSG</code></td><td>Get system message</td></tr><tr><td><code>LIB$SYS_TRNLOG</code></td><td>Translate logical name</td></tr><tr><td><code>LIB$TRA_ASC_EBC</code></td><td>Translate ASCII to EBCDIC</td></tr><tr><td><code>LIB$TRA_EBC_ASC</code></td><td>Translate EBCDIC to ASCII</td></tr><tr><td><code>LIB$TRIM_FILESPEC</code></td><td>Trims a file specification string</td></tr><tr><td><code>LIB$WAIT</code></td><td>Wait for event</td></tr></tbody></table></div><h2 id="status">Implementation status</h2><p>
The overwhelming majority of LIB$ routines are fully implemented and exercised. A small
number of advanced virtual-memory options are partially covered, and a set of rarely used
routines is not yet implemented. The table summarises the state of each area so a migration
can be scoped accurately.
</p><div class="table-wrapper"><table><thead><tr><th>Capability area</th><th>Status</th><th>Notes</th></tr></thead><tbody><tr><td>Core string, arithmetic, tree, queue, time, symbol, file and screen routines</td><td><span class="ac-live">live</span></td><td>Full implementations, built into the VX runtime library.</td></tr><tr><td>CRC checksums and character translation</td><td><span class="ac-live">live</span></td><td><code>LIB$CRC</code>, <code>LIB$CRC_TABLE</code>, and the ASCII and EBCDIC translation routines.</td></tr><tr><td>Basic virtual-memory allocation and zones</td><td><span class="ac-live">live</span></td><td><code>LIB$GET_VM</code>, <code>LIB$FREE_VM</code>, and standard zone create, delete, find and reset.</td></tr><tr><td>Advanced VM-zone options and 64-bit high-address handling</td><td><span class="ac-v1">partial</span></td><td>Custom zone algorithms, alignment, page limits, user get and free-page callbacks, and full 64-bit quadword address handling are being completed.</td></tr><tr><td>Signal-handler dispatch for <code>LIB$STOP</code> and <code>LIB$SIG_TO_RET</code></td><td><span class="ac-v1">partial</span></td><td>Signalling works; some handler-unwind paths are being finalised.</td></tr><tr><td>Rarely used routines (for example <code>LIB$VERIFY_VM_ZONE</code>, <code>LIB$CREATE_USER_VM_ZONE</code>)</td><td><span class="ac-no">not yet implemented</span></td><td>A set of low-usage entry points is declared but not yet implemented. Sector7 prioritises these on demand as migrations require them.</td></tr></tbody></table></div><div class="callout"><strong>Migration sizing.</strong> When scoping a port, check your application's actual LIB$
call inventory against this matrix. Anything in the "not yet implemented" set that your code
depends on can be prioritised as part of the engagement.
</div><h2 id="quickref">Quick reference</h2><h6>Key facts</h6><div class="table-wrapper"><table><thead><tr><th>Item</th><th>Value</th></tr></thead><tbody><tr><td>Public entry points</td><td>Over 150 <code>LIB$</code> routines</td></tr><tr><td>Delivery</td><td>Linked into the application via <code>libvxrt.a</code></td></tr><tr><td>Platforms</td><td>x86 and ARM Linux, through VX/RT</td></tr><tr><td>Success test</td><td>Odd condition code (<code>status & 1</code>), not equality</td></tr><tr><td>String passing</td><td>By descriptor; 32-bit and 64-bit layouts both accepted</td></tr><tr><td>Descriptor classes</td><td>Static (1), Dynamic (2), Varying (11), Scaled decimal (9)</td></tr><tr><td>Time base</td><td>64-bit quadword, 100-ns ticks from the 1858-11-17 epoch</td></tr></tbody></table></div><h6>Name forms</h6><div class="kw-grid"><div>LIB$INDEX</div><div>lib$index</div><div>LIB_D_INDEX</div><div>Fortran thunk</div></div><h6>String and character routines</h6><div class="kw-grid"><div>LIB$INDEX</div><div>LIB$LEN</div><div>LIB$LOCC</div><div>LIB$MATCHC</div><div>LIB$SCANC</div><div>LIB$SKPC</div><div>LIB$SPANC</div><div>LIB$MOVC3</div><div>LIB$MOVC5</div><div>LIB$MOVTC</div><div>LIB$SCOPY_DXDX</div><div>LIB$ANALYZE_SDESC</div></div><h6>Date and time routines</h6><div class="kw-grid"><div>LIB$DATE_TIME</div><div>LIB$DAY</div><div>LIB$DAY_OF_WEEK</div><div>LIB$ADD_TIMES</div><div>LIB$SUB_TIMES</div><div>LIB$MULT_DELTA_TIME</div><div>LIB$CVT_DTB</div><div>LIB$FORMAT_DATE_TIME</div></div><h6>Virtual-memory routines</h6><div class="kw-grid"><div>LIB$GET_VM</div><div>LIB$FREE_VM</div><div>LIB$GET_VM_PAGE</div><div>LIB$CREATE_VM_ZONE</div><div>LIB$DELETE_VM_ZONE</div><div>LIB$FIND_VM_ZONE</div><div>LIB$RESET_VM_ZONE</div><div>LIB$STAT_VM</div></div><h6>System and process routines</h6><div class="kw-grid"><div>LIB$GETDVI</div><div>LIB$GETJPI</div><div>LIB$GETSYI</div><div>LIB$SPAWN</div><div>LIB$RUN_PROGRAM</div><div>LIB$DO_COMMAND</div><div>LIB$GET_SYMBOL</div><div>LIB$SYS_FAO</div></div></div>