Keith said:
No, standard C is C as defined by the ISO C standard (either the 1990
or 1999 version). Unix is an operating system, one of many on which C
implementations exist, and POSIX is a secondary standard that defines
many things that the C standard doesn't.
If you have a copy of K&R2 (Kernighan & Ritchie, _The C Programming
Language_, 2nd Edition), standard C is basically what's covered in
appendices A and B. (If you don't have a copy, you should.)
<quote K&R Second edition>
The computing world has undergone a revolution since the publication of
the C Programming language in 1978. Big computers are much bigger, and
personal computers have capabilities that rival the mainframes of a
decade ago. During this time, C has changed too, althougth only
modestly, and it has spread far beyond it's origins as the language of
the UNIX operating system.
</quote>
I had to blow the dust of the K&R. Allthougth I have it I never use it
as I know it by heart. I know that the lib c in K&R only includes
stdio.h wrt interfaces to the real world. So can I assume from that
this ng considers OT anything that cannot be directly implemented using
the libc of K&R. It would seem a bit narrow to me.
comp.unix.programmer would **not** seem to be an appropriate place to
ask about the best libc implementation
Some quick examples: fopen(), fread(), fwrite(), and fclose() are
standard C; open(), read(), write(), close(), and fork() are not.
The ones you listed as 'not' do appear in K&R in chapter 8 "The unix
system interface". Do you think that the C language per se should not
make any attempt to incorporate interfaces to the rest of the world,
other than a vauge acknowledement that there may be input and output
streams? As the introduction to chapter 8 points out: "Scince the ANSI
C library is in many cases modelled on UNIX facilities, this code may
help your understanding of the library as well", also, "Chapter 7 was
concerned with i/o that is uniform accross operating systems". IMHO
socket i/o is nowdays as fundamental as file i/o and should be included
in "chapter 7". Forks and threads are slightly different in the sense
that different approaches to thier use (and the pro's and cons) vary
from platform to platform, including different unices, so perhaps they
should not be in the standard C library.
I acknowledge however that they are currently **not** in the ANSI
standard and therefore you consider them OT in this ng. I did not
realise you were so pedantic here.
POSIX-specific issues are typically discussed in comp.unix.programmer.
Does not really seem an appropriate place to ask about a good libc
implementation for Win32. If they are as pedantic over there as you lot
over here are I would be flamed to ashes ;-)
My issues are with C portability. I have always felt that portability
has been very much in the spirit of the C language. According to the
K&R preface the ANSI goal was to produce an unambiguous and machine
independent definition of the language. My point is that you cannot
achieve that completely by simply ignoring essential functionality that
almost any modern program needs. Or perhaps C should be called "a
standard language for mono-threaded applications which only require
file and console i/o".