Inside the C Standard Library
Well, I was not expecting to read a 10,000-word article about the C standard library this morning. I haven&#x27;t been programming in C as long as many here, but over the past dozen years or so I&#x27;ve always felt that the standard library is a half-baked hodgepodge of inconsistencies and a minefield of gotchas that have caused innumerable security vulnerabilities.<p>Why is open() in fcntl.h and close() in unistd.h? Why does bcopy go src,dst but memcpy go dst,src? Why did they make strlcpy return a different value than strncpy, so you can&#x27;t improve a whole codebase with one recursive sed?<p>There are many questions I still have, but I learned a bunch of new things from this article. Thanks to the author for putting the effort into digesting the source material for us.<p>On a tangential topic, I don&#x27;t know of a good reference for exploring what is included in the standard library. Yes, of course there are manpages for individual families of functions. But I don&#x27;t know how anyone would find out about, say, strtok or strsep without encountering them in some existing code. I had a university assignment which would have been trivial if anyone in the class knew that fts.h existed.