Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfelg!koren From: koren@hpfelg.HP.COM (Steve Koren) Newsgroups: comp.sys.amiga.tech Subject: fork() (not forkv()!) on Amiga? Message-ID: <13920001@hpfelg.HP.COM> Date: 7 Oct 89 02:54:28 GMT Organization: HP Elec. Design Div. -FtCollins Lines: 53 My appologies if this has been discussed before; our site just began subscribing to comp.sys.amiga* yesterday. If it has been discussed, could someone mail the thread to me? I have two questions. One concerns tasks, the other conserns the console device. I have lattice 5.02, if that matters. I am trying to accomplish what fork() does in UNIX. Lattice provides forkv(), but that is not at all the same thing and won't really meet my needs. I need to be able to say something like this: if (fork()) { /* process 1 */ } else { /* process 2 */ } I have found that FindTask(0) will return a pointer to a structure that contains the address of the segment list. I tried passing that into CreateProc() like this: CreateProc("MY_PROC", 0, p->pr_SegList, 5000); (from memory - may not be exact!) and then putting some code in the first segment that can tell if this is the first or second execution of itself. It didn't work though. The CreateProc() call seems to finish (when I trace it through with the debugger), but it never gets as far as actually executing my code. It stops on a rts instruction , and guru's if run outside cpr. Does anyone know what I am doing wrong, how to fix it, or an easier/better way to accomplish this? I tried AddTask() too, but couldn't make that fly either, and it involved lots of pushups to do a simple thing. Question 2: (maybe easier!) I'm trying to put the console device in a RAW mode, such that I can read single characters from it without waiting for a newline. I can turn off buffering in Lattice, but it still waits for a newline. I know that in Manx there is an stty() call; is there anything like that in Lattice? I know I can read characters via IntuiMessage events, but it's important that I do it through the console device. I can't find anything about this in the Lattice manuals, other than the function to turn off buffering. That's all for now. Thanks to anyone who has answers. BTW, please no RTFM's. I have a bunch of Ami books, none of which say anything about either problem. Also, I can't find a place on the planet that has the 1.3 ROM kernel manual set. thanks - steve (koren@hpfela)