Mail Archives: geda-user/2015/08/10/12:15:52
On Mon, 10 Aug 2015, Levente (leventelist AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:
>Good old days... :-) single Unix operating system. My dream.
>
>I think we struggle too much with all these Unix variants.
>
There is also another very important aspect. All the code is astonishingly
simple and small. I've just opened the libc implementation of popen() and
pclose(). It's a single C file, 55 lines total. It's not a wrapper around
some internal popen()/pclose(), it really creates the pipe, forks, calls
execl. It includes two headers (stdlib.h and signal.h, easy to foresee
what they are going to be used for). The code is to the point, plain and
simple.
I think it's not only about having one UNIX variant and smaller amount of
hardware, it's also about making APIs more advanced (complicated) over
time, implementing workarounds that will require more workarounds in turn,
etc. Looking at the glibc implementation, it's 381 lines just for popen()
- if I even found the right file. Yeah, it "has to" deal with
close-on-exec, pipe() vs. pipe2(), set up some complex IO structs... It's
hard to follow the code riddled with #ifdefs. It includes 10 headers.
To be fair, not all parts of V7 is like that: the Bourne shell's soruce,
for example, is pretty ... strange. If I was shown a few dozen lines from
the middle of any .c, I wouldn't even tell it's written in C.
Regards,
Igor2
- Raw text -