ReadKey like Function in C

Peter da Silva peter at ficc.uu.net
Wed Aug 16 01:40:03 AEST 1989


I redirected this back to comp.std.c, because I'm really not interested
in the POSIX standard here. The main reason POSIX comes up in this group
is because of holes in the ANSI C standard. Many of them are reasonably
brushed aside as outside the scope of the standard, but then the POSIX
standard is referred to as something that will cover them... and as this
message (I hope) shows, that just ain't so...

I expressed dismay that POSIX mandated fork():

In article <10734 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
> Separate fork() and exec(), along with shared file tables etc., provide
> the means to do a variety of interesting things, and UNIX-based applications
> do exploit this.  If POSIX had tried to weaken this area, it would not have
> been following its charter.

But this rules out POSIX support for a wide variety of operating systems.
Fork() is just plain inefficient unless you have virtual memory support,
so few small-system or real-time operating systems use it or even support
it.  At least an alternate that allowed the use of a more conventional
process creation mechanism would be desirable.

> >While I'm here, what's the sentiment among C standards folks for some sort
> >of standard co-routine arrangement?

> It cannot be mandated across all implementations.

Well, the flip response to this is: "Maybe, but then neither can fork().",
and I'm reasonably sure you'll use that in your code.

There really are very few systems that wouldn't be able to support the
coroutines being discussed in comp.lang.c. Many vendors would just need
to fake a jmp_buf and use setjmp/longjmp. I didn't see coroutines as
one of the things rejected in the list of proposed enhancements that was
just posted here. Were they even discussed?

It seems to me that there is a need for something between X3J11 and POSIX.
Something to provide a standard platform for systems that can't provide
full-blown UNIX, but does cover areas too broad for the C standard, such
as process creation or terminal control.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter at ficc.uu.net, +1 713 274 5180. | "The sentence I am now
Personal: peter at sugar.hackercorp.com.   `-_-' |  writing is the sentence
Quote: Have you hugged your wolf today?  'U`  |  you are now reading"



More information about the Comp.std.c mailing list