Path: utzoo!attcan!uunet!wuarchive!texbell!uhnix1!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.std.c Subject: Re: Inappropriate topics. (?) Message-ID: <5795@ficc.uu.net> Date: 20 Aug 89 15:35:48 GMT References: <148@trigon.UUCP> <207600029@s.cs.uiuc.edu> <941@lakesys.UUCP> <10785@smoke.BRL.MIL> Organization: Xenix Support, FICC Lines: 35 In article <10785@smoke.BRL.MIL>, gwyn@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@ficc.uu.net, +1 713 274 5180. Fun: peter@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