| C T L _ N E W S H E L L ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English AMIGA - CTL_#?
----------------------------------------------------------------------------
NAME
ctl_newshell() - Spawns new interactive shell process
and returns its address.
SYNOPSIS
pr = ctl_newshell(fd, from);
struct Process *ctl_newshell(LONG, UBYTE *);
FUNCTION
This func. creates new interactive shell and returns
its address.
INPUTS
fd - FileHandle that will be used for input/output.
from - Filename name of a script to be executed upon
startup. Can be NULL.
RETURNS
Returns pointer to new shell proc or NULL on failure.
BASES
SysBase, DOSBase
NOTES
When you need to access 'pr' then arbitrate the call
first with 'Forbid()' / 'Permit()' and never disable
interrupts or this function will cause a deadlock!
SEE ALSO
ctl_clirun()
EXAMPLE
...
struct Process *pr;
LONG fd;
LONG num = -1;
if ((fd = Open("CON:", MODE_OLDFILE)))
{
QDEV_HLP_NOSWITCH
(
if ((pr = ctl_newshell(fd, NULL)))
{
num = pr->pr_TaskNum;
}
);
FPrintf(Output(), "NewShell at: %s\n", num);
Close(fd);
}
BUGS
None known.
----------------------------------------------------------------------------
| |
| |