Inappropriate topics. (?)

Peter da Silva peter at ficc.uu.net
Mon Aug 21 01:35:48 AEST 1989


In article <10785 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
> Nobody is seriously suggesting that all of POSIX has to be implemented
> in a non-UNIX environment for it to provide a good guide for just those
> facilities that CAN be readily emulated.

Well, perhaps there should be some attention given to what a good POSIX
subset should be, and what that subset should do for those features of
POSIX that are not readily implementable. The number one problem here is
what to do about fork(), and the number two is what to do about pipes.

Most of the uses of fork() can be satisfied by the following function:

	spawn(cmdlin, in, out, wait)
	char *cmdlin;	/* Program to execute */
	int in, out;	/* File descriptors to use for input and output */
	int wait;	/* A boolean flag indicating whether we should
			   wait for the program to complete. If the flag
			   is *true*, spawn will return an id to wait on.
			   If the flag is *false*, spawn will wait for the
			   command to complete, and return the exit status
			   of the command (8 bits). If the system can't
			   fulfil the request, spawn will return an error
			   code. */

About the only operating system I'm familiar with that can't implement this
function is CP/M, or its immediate predecessor Isis.

Most uses of pipe() can be handled by using popen(). The one big one that
can't is setting up a filter. Anyone have any ideas? This may be even harder
to solve.
-- 
Peter da Silva, *NIX support guy @ Ferranti International Controls Corporation.
Biz: peter at ficc.uu.net, +1 713 274 5180. Fun: peter at sugar.hackercorp.com. `-_-'
"Optimization is not some mystical state of grace, it is an intricate act   U
   of human labor which carries real costs and real risks." -- Tom Neff



More information about the Comp.std.c mailing list