view docs/ccguide/chain.refentry @ 2168:fbfc56b826bf

Makin' changines
author boisy
date Sat, 24 May 2008 12:52:17 +0000
parents c0da1728ed5b
children
line wrap: on
line source

<refentry id="chain">
<refnamediv>
<refname>Chain</refname>
<refpurpose>load and execute a new program</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
  <funcdef><function>chain</function></funcdef>
  <paramdef>char *<parameter>modname</parameter></paramdef>
  <paramdef>int <parameter>paramsize</parameter></paramdef>
  <paramdef>char *<parameter>paramptr</parameter></paramdef>
  <paramdef>int <parameter>type</parameter></paramdef>
  <paramdef>int <parameter>lang</parameter></paramdef>
  <paramdef>int <parameter>datasize</parameter></paramdef>
</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Assembler Equivalent</title>
<para>
os9 F$CHAIN
</para>
</refsect1>

<refsect1><title>Description</title>
<para>
The action of F$CHAIN is described fully in the OS-9
documentation. Chain implements the service request as
described with one important exception: chain will NEVER return
to the caller. If there is an error, the process will abort
and return to its parent process. It might be wise, therefore,
for the programs to check the existence and access permissions
of the module before calling chain. Permissions may be checked
by using "modlink()" or "modload()" followed by an "munlink()".
</para>
<para>
"Modname" should point to the name of the desired module.
"Paramsize is the length of the parameter string (which should
normally be terminated with a "\n"), and "paramptr" points to
the parameter string. "Type" is the module type as found in
the module header (normally 1: program), and "lang" should
match the language nibble in the module header (C programs
have 1 for 6809 machine code here). "Datasize" may be zero, or
it may contain the number of 256 byte pages to give to the new
process as initial allocation of data memory.
</para>
</refsect1>
</refentry>