
Examples from: Stevens, Advanced Programming ...
Quote:
>> Sonce your question is about Unix rather than about the C programming
>> language you'll need to ask it in a more appropriate newsgroup.
>> comp.unix.programmer is good for general Unix programming questions.
>> There is a comp.os.linux.* hierarchy for Linux related questions.
>Thanks for your advice. I'm not convinced though that C programming
>under Unix is more about Unix than about C.
Most of the examples in Stevens' book use facilities that the C language
does not define. What the book describes is the Unix system interface.
Quote:
>C is supposed to be an extremely portable language,
It is, but to get that portability you must restrict yourself to
the facilities defined by the language. Steven's book talks mostly about
things that are not; it talks about how to program under Unix using the
Unix system interface. Most of the program there won't run on other platforms.
Even functions like open() (and anything that uses int file descriptors)
are not standard C.
Quote:
>and its origins are related to
>Unix.
True, but it since the ANSI standard came out in 1989 it is now essentially
divorced from those origins. The Unix interface definitons may be based
on C but they are on other platforms too.
Quote:
>Unfortunately, each and every operating system treats C and its
>standard libraries in a different fashion, and this can drive you
>nuts.
That's why it is essential to know the difference between the standard C
library and platform-specific extensions. That is why we make a big deal
of the distinction in comp.lang.c.
Quote:
>Of course, if we all ignore the fact that there are more
>operating systems around than M$ Windows, then portability is not an
>issue.
comp.lang.c is more often accused of being anti-MS than pro. The truth is
that we try to stick to standard C and redirect any plsatform-specific
stuff to platform related newsgroups. That happens a lot more to MS related
newsgroups because a lot more MS related questions get posted. The regulars
(myself included) have tended to have more of a Unix than MS background
so it is probably true that Unix related questions are more likely
to get a helpful comment along with the redirection. It is also easier
to write in standard C on Unix platforms, a native Windows application
can't avoid non-standard extensions.
--
-----------------------------------------
-----------------------------------------