🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: mod.computers.68k
Article #154

Re: ! fork() on OS/9

#154
From: jejones
Date: Sat, 14 Feb 1987 18:32
26 lines
1660 bytes
Sure--the OS-9 F$Fork system call creates a process running a specified
module (the "primary" module you see listed in the output of "procs,"
the OS-9 analogue of "ps"), with a parameter so that you can optionally
override the default initial data memory allocation that lives in the
module header.  OS-9/6809's F$Fork gives you no choice but to let the
child inherit paths 0, 1, and 2; OS-9/68000 lets you specify the number
of paths the child should inherit (a contiguous hunk, starting with 0).

Since OS-9 also has the I$Dup system call, semantics essentially like
the Unix dup(), the shell does something like the following to redirect,
say, stdin when it spawns a child:

	n = dup(0)
	open file that child is to get stdin from
		(1st available path # is used, so it's #0)
	fork child
	close(0)
	dup(n)
		(1st available path # is used, so it's #0)
	close(n)
		(we don't need the copy any more)

with analogous stuff if stdout is redirected.  To make it work right,
you have to do the dups, opens, and closes in the right order.

		James Jones
Technical Details
Message-ID: <8702141832.AA05404@mcrware.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ucbvax!mcrware.UUCP!jejones
References: <8702132223.AA17545@violet.berkeley.edu>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ucbvax!mcrware.UUCP!jejones
From: jejones@mcrware.UUCP.UUCP
Newsgroups: mod.computers.68k
Subject: Re: ! fork() on OS/9
Message-ID: <8702141832.AA05404@mcrware.UUCP>
Date: Sat, 14-Feb-87 13:32:00 EST
Article-I.D.: mcrware.8702141832.AA05404
Posted: Sat Feb 14 13:32:00 1987
Date-Received: Mon, 16-Feb-87 01:53:54 EST
References: <8702132223.AA17545@violet.berkeley.edu>
Sender: mwm@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 26
Approved: info-68k@ucbvax.berkeley.edu