Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uwmcsd1!nic.MR.NET!umn-cs!mmm!ems!questar!brent From: brent@questar.QUESTAR.MN.ORG (Brent Nordquist) Newsgroups: comp.sys.amiga.tech Subject: Lattice 4.0 forkl() problem Message-ID: <1222@questar.QUESTAR.MN.ORG> Date: 26 Jul 88 21:01:59 GMT Reply-To: brent@questar.QUESTAR.MN.ORG (Brent Nordquist) Followup-To: comp.sys.amiga.tech Organization: Questar Data Systems, Minneapolis, MN Lines: 36 References: [ Elf: "crunch crunch crunch... mmmmm... thank you!" ] [ Thanks to the author of DiskSounds for a good laugh at 3 A.M... ] I am trying to get the Lattice 4.0 forkl() function to work "as advertised" in the manual, to no avail. I need to be able to start up another program with its stdin redirected from somewhere else. For example, the first process opens a file, sets the stdin of the second process to be that file descriptor, and then forks; then the second process, when reading from stdin, would be reading from the file. (BTW, I *don't* want to use Execute() or system() or ____(), because I don't want to have to run off to SYS: to get the 'Run' command each time. [Tacky!] I also need them to run concurrently.) When I call forkl() with (struct ForkEnv *)NULL it works fine, with the new process inheriting stdin from the current process. Now, the manual says I should also be able to pass a (struct ForkEnv *) whose *fields* are NULL, and any NULL field will receive a default value. So, I tried it, and I get the Guru. First of all, the printed structure definition is wrong; the fields are 'std_in' and 'std_out,' not 'stdin' and 'stdout.' (Wish I had the manual with me so I could quote the page number.) Also, the .h file says they're BPTR's and not long's. Are these 'file handles' returned by open(), or is this something Amiga-specific? (Can you say, "naive- Amiga-programmer-used-to-mainframe-C?" :-) Perhaps forkl() isn't the best way to start up another process; can someone give me some help? Short example code would be invaluable! Thanks! -- Brent Nordquist Bachelorhood remaining: brent@questar.mn.org amdahl!bungia!questar!brent 20 weeks, 3 days, 19:00