Take the 2-minute tour ×

This may be a ridiculous question, but it seems like a reasonable one to me... I often open up source files and see various system header files included and wonder what each of them are. I know what the likes of stdio.h and sys\types.h are for, but there are others that I'm not too sure about. Is there someplace that gives a list of standard header files and a description of their purpose (and details given per OS, language standard)? Maybe this list would also include definitions included in said header files, macros, etc. Something organised by topic would be helpful, too.

share|improve this question
@kichik, I have. A Google query returns things like this StackOverflow question, the Wikipedia entry cited by several other answers, and a few other hits--none of which answer my question. The hit for the relevant O'Reilly C in a Nutshell section seem to fit the bill, but I'm looking for an online resource. –  GarlicFries Aug 20 '11 at 1:19
Would information limited to, say, POSIX and Windows systems be sufficient, or do you want to cover more exotic systems as well? –  Keith Thompson Nov 15 '11 at 11:12
I'm most interested in Mac--and I do mean Mac (as opposed to just plain POSIX). There seem to be a heap of Mac-specific header files beyond or alongside the POSIX-standard files. –  GarlicFries Nov 15 '11 at 11:23
add comment

5 Answers

up vote 2 down vote accepted

For language-defined headers, the library section (section 7) of the C standard (PDF) is definitive. There's a subsection for each header, though <limits.h> and <float.h> are described in

POSIX is here; access is free, but you have to sign up for an account. (I'm actually not 100% sure of the relationship among POSIX, SUS, and IEEE Std 1003.1.)


Mac OSX man pages are available here.

But consider that you might be approaching this from the wrong direction. When writing code, a better approach is typically to (a) decide what you want to do, (b) find a function that will do it, and (c) read the function's documentation to determine which header you need to #include. A given header doesn't necessarily have a coherent meaning.

share|improve this answer
This is yet closer to what I seek, yet still not exactly it. Nothing regarding OS-specific readers there, and for obvious reasons. I guess I'm really asking if something like headerfiles.com exists... ;) –  GarlicFries Aug 20 '11 at 6:58
Any OS in particular? If you're looking for Windows, msdn.microsoft.com is probably a good place to start. –  Keith Thompson Aug 20 '11 at 7:14
I'm interested in various *nix flavours and Mac OS X. Wouldn't touch Windows with a ten-foot pole, but I'm sure there are some who would be interested. –  GarlicFries Aug 20 '11 at 7:55
I actually wasn't sure about the POSIX/SUS/IEEE 1003.1 relationship either. This sums it up nicely. –  GarlicFries Aug 20 '11 at 8:03
Maybe I'm just OCD... ;) I know about the differing opinions around accepting answers for reasons other than the obvious, but that's not really the problem here. This is one of the issues with SO (and a conversation that occurs frequently on meta)--this question has received 5 answers, several upvoted, but none that completely answer my question. Pile up a few of those while you wait eternally for new answers, and that 94% continues to drop further and further... –  GarlicFries Nov 15 '11 at 11:21
show 2 more comments


share|improve this answer
See comment on Justin Pearce's answer... –  GarlicFries Aug 20 '11 at 1:15
add comment

Hopefully this is along th lines of what you were looking for:


share|improve this answer
Yes, along the lines of what I want, but doesn't include POSIX library headers, etc. I understand that there is a link to this information, but I'm interested in a reference that actually pulls everything together... –  GarlicFries Aug 20 '11 at 1:15
I don't think you will find such a reference on the net right now. But maybe someone get inspired by our question and creates one ;) –  Thomas Berger Aug 20 '11 at 1:22
add comment

Here's one for C:


share|improve this answer
This does not include the os specific ones, or have i missed them in the index? –  Thomas Berger Aug 20 '11 at 1:10
So far, this is the closest answer to my question, but presents only a subset of the headers in which I am interested. Note that I am not only asking abou the ISO standard library, but standard system headers--anything that #include <you_might_find_here.h>... –  GarlicFries Aug 20 '11 at 1:24
@Thomas: there can be a lot of OS specific ones, sometimes a few hundred, and they seem to change every now and then. I doubt you will find a listing of those, except in the documentation for the OS SDKs. –  Rudy Velthuis Aug 20 '11 at 4:05
add comment

One way is to look inside the header file. Many files have good comments. Under unix systems you could use the manpage: man stdint.h p.a.

share|improve this answer
This is what I already do and find tedious, hence my question. –  GarlicFries Aug 20 '11 at 1:12
The header files themselves tend to contain a lot of system-specific stuff, which can obscure the portable stuff you're really looking for. –  Keith Thompson Aug 20 '11 at 1:29
@Keith From the question: (and details given per OS, language standard) –  Thomas Berger Aug 20 '11 at 1:34
add comment

Your Answer


