Man pages are stored in sections, usually in the /usr/share/man folder. If there is a page like stat which exists in several sections, the man command always chooses the first one. The man page you are looking for on the stat function is in section 2, whereas the man page on the stat command is in section 1. To view man pages in a different section, use commands like:

Code:
man 2 stat
On some Linux distributions you need to install the developer manpages first. On Debian/Ubuntu, install the manpages-dev and glibc-doc packages. On Fedora, install the man-pages package.

Most of the useful programming information is in sections 2 (system functions) and 3 (library functions).