So any suggestions?
So any suggestions?
As for suggestions, all of the following are guesses because of my own n00b status with C. That said:
The runtime of the higher-level language of your choice. If you already know Python well, looking under the hood and seeing the C code that actually implements all the convenient and useful bits may well be instructive.
Rsync. I was able to get some small understanding of how it worked by browsing the source even though I knew hardly any C at the time.
Postfix. I don't think is a small project, but I have heard it spoken well of from a security standpoint -- in part because it is actually several small programs/modules that specialize in one task. Those individual binaries/modules might be comprehensible on their own.
http://aosabook.org/en/index.html
("Architecture of open source applications") and siblings.
I'd say reading the section on "git" there, and then having a look at the git source - or "nginx" and looking at the source - etc - might be one place to start.
Other than that, off the top of my head (suggestions from a hobbist): sqlite, the samba lightning db lmdb, the new openbsd daemons like httpd, opensmtpd, and the NaCl crypto library.
Hopefully more battle-hardened c-programmers can comment/add to the list.
[ed: and seeing rsync mentioned below, I recalled spiped along with a handful of other utilities by Colin Percival (former FreeBSD Security Officer, founder of tarsnap and active hn-er) http://www.tarsnap.com/spiped.html ]
But spiped is just 6500 lines of code, of which 4300 is segregated library code; a novice C programmer should be able to start by treating those as black boxes and read through the rest of the code to get a clear sense of how the entire program works -- something which is almost impossible for a program as large as even OpenBSD's minimalist httpd.
And reading spiped will expose you to a lot of the concepts which experienced C developers take for granted -- non-blocking network I/O and callbacks, threads, "extending" the language by creating more sophisticated data structures, workarounds for non-POSIX platforms, etc.