Article View: comp.sys.amiga.tech
Article #10430Re: problems with forkv (lattice) (long)
From: R. Scott Bartlett
Date: Tue, 29 Nov 1988 20:43
Date: Tue, 29 Nov 1988 20:43
115 lines
4016 bytes
4016 bytes
[aliens ate my line eater]
In article <167@fishpond.UUCP> fnf@fishpond.UUCP (Fred Fish) writes:
>In article <wXY38Sy00Uka8=Ac5B@andrew.cmu.edu> bader+@andrew.cmu.edu (Miles Bader) writes:
>>Despite many re-readings of the manual section, and talking to
>>lattice technical support, I STILL can't forkv to work as advertised.
>
>Forkv only works when the forked program is a C program. This restriction
>did not make it into the manual, but is apparently in one of the README
>files supplied with the compiler (or so I've been informed, read the README
>files? never... :-).
>-Fred
I have forkv() call csh2.07m (thanks Matt & Steve), the shell gets loaded, but
bombs before it does anything. (Guru #0000000B(or 03) #20382038 when run from a
CLtd harddrive (old fs/driver); Guru #00000003(or 0B) #00032075 when from ram:)
News Flash!! I just tried the program from RAM: on my roomate's 500:
Guru #00000003 #00032075 AARGH!!! The shell loaded fine, but when it sourced
the file root:us1/rsb/.profile it crashed (root: assigned to ram:). If that
file was not there, csh would complain that it couldn't find the file and leave
me at that shell's prompt. Why the different behavior?
What gives??
rsb
BTW: ROOT:us1/rsb/.profile contained:
A1000-> pwd
cd root:us1/rsb
set _path c:,UUCP:c,df1:c,df0:c
alias pg type
endcli
A500-> cd root:us1/rsb
echo hi
System:
A1000 1.3KS and WB (WB not loaded)
2Mb Microbotics w/ MFM
old CLtd harddrive /* Do they have an uucp-able email address? */
PopCLI & MemWatch /* 'cus I want to upgrade so i can use FFS */
A500 1.2KS and WB (WB not loaded)
A501 mem expansion
PopCLI
Code segment below:
/* ************************************************************************* */
/* v0.1 11/16/88 it's a start. */
/* by R. Scott Bartlett */
/* ************************************************************************* */
/* Note that this is only part of the program!!! for posting purposes only */
/* (C)1988 R. Scott Bartlett It's not PD (yet ;-) */
#include <exec/types.h>
#include <exec/tasks.h>
#include <libraries/dos.h>
#include <libraries/dosextens.h>
#include <stdio.h>
#include <dos.h>
#define ROOT_DIR "ROOT:"
#define CLI CommandLineInterface
struct ProcID child;
main()
{
struct Process *myProc;
struct CLI *my_CLI;
struct FORKENV child_env;
char *child_argv[3],
home_dir[80],
shell_name[80],
printf("HOME: '%s'\n",home_dir);
printf("Shell: '%s'\n",shell_name);
child_argv[0] = shell_name;
child_argv[1] = home_dir;
child_argv[2] = NULL;
Forbid();
myProc = (struct Process *)FindTask(0L);
my_CLI = (struct CLI *)BADDR(myProc->pr_CLI);
Permit();
child_env.priority = 0;
child_env.stack = 25000; /* STACK SIZE */
child_env.std_in = my_CLI->cli_StandardInput;
child_env.std_out = my_CLI->cli_StandardOutput;
child_env.console = (BPTR)myProc->pr_WindowPtr;
child_env.msgport = NULL;
if (forkv(child_argv[0],child_argv,&child_env,&child) == -1) {
perror("Error in fork!!!\n");
perror("Goodbye\n");
}
else {
perror("Hello\n");
wait(&child);
return(0);
}
--
rsb@dukeac.ac.duke.edu /// "Amigas do it with hardware."-- Me
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ /// "Sycamore is open."-- Negativ Land
Note the shorter addr \\\/// "I luv S&M!!!" "No geeks here!!"
Disclaimer NOT included! \XX/ "This space for rent"
Technical Details
Message-ID:
<1135@dukeac.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!rutgers!mcnc!ecsvax!dukeac!rsbReferences:
<wXY38Sy00Uka8=Ac5B@andrew.cmu.edu> <167@fishpond.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!rutgers!mcnc!ecsvax!dukeac!rsb From: rsb@dukeac.UUCP (R. Scott Bartlett) Newsgroups: comp.sys.amiga.tech Subject: Re: problems with forkv (lattice) (long) Keywords: Please help!! Message-ID: <1135@dukeac.UUCP> Date: 29 Nov 88 20:43:47 GMT References: <wXY38Sy00Uka8=Ac5B@andrew.cmu.edu> <167@fishpond.UUCP> Reply-To: rsb@dukeac.UUCP (R. Scott Bartlett) Organization: Center for Demographic Studies, Duke University, Durham, NC Lines: 115