[comp.sys.amiga.tech] Lattice's fork function

jmdavis@ihlpm.ATT.COM (Davis) (10/03/88)

I thought I would try writing a simple multitasting program,
however it doesn't work.

The program is "time", it times the execution of a program. It works
similar to the UNIX(r) time command. That is you enter "time command"
and the program forks the "command" portion, taking the time before
the fork and after the fork. I am using Lattice 4.01's version of fork
and version 34.1 of ARP. Time without a parameter will return a usage
statement.

"time time" works fine as does "time microemacs" (from the 1.2 extras),
however, "time dir" prints the contents of the directory and then gurus,
"time cd" crashes before printing, and "time echo hello" won't even fork
the process.

I know I could try the "system" call, but I would like to know if I
am misunderstanding something. (I suspect that fork doesn't do as much
housekeeping as I had hoped.)

Thanks

-- 
________________________________________
					|	Mike Davis
					|	..!att!ihlpm!jmdavis
				 	|_________________________

cmcmanis%pepper@Sun.COM (Chuck McManis) (10/03/88)

In article <2386@ihlpm.ATT.COM> jmdavis@ihlpm.ATT.COM (Davis) writes:
> "time time" works fine as does "time microemacs" (from the 1.2 extras),
> however, "time dir" prints the contents of the directory and then gurus,
> "time cd" crashes before printing, and "time echo hello" won't even fork
> the process.
>					|	Mike Davis

The Lattice fork() function only works on C executables and *not* BCPL
ones. The ARP replacement commands may fail (haven't tried them) because
they don't use the C startup code but I am not sure. The standard AmigaDOS
commands will definitely fail. 


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.