How to find the source code from header declaration?

I want to browse the source code in of the symbols in my header files in /usr/include/ . For example, in netdb.h, there's a function named getaddrinfo(...). I want to know where the source code is stored at least by using the shell.

I will be more appreciate if you tell me how to do it specifically in Emacs and/or Cscope.


The definition (with the function body) of standard C library's functions is (usually on Linux) inside the GNU Libc. Several functions (those in the section 2 of man pages for syscalls, with syscall numbers listed in <asm/unistd.h>) are tiny wrappers to system calls, so the actual work is done inside the linux kernel whose source is on For instance, write(2) is a system call (mostly done in the kernel) which may be used by the printf(3) library function (whose code is in GNU Libc). You could install GNU Libc source code and use ctags to find symbols there.

The declaration of standard C library's functions are in header files under /usr/include, so utilities like ctags can help you find them.

Need Your Help

Rails4 order by column alias in joins group

ruby-on-rails ruby-on-rails-4 activerecord

I want to have the slugs of the categories in descendent order of number of products per category (the category slug for the category witht the most products is first and the ones without products ...

Are there any implications of having a parent POM version number less than a child POM version number?

maven maven-3 nexus pom.xml

I am pushing maven artifacts to nexus, are there any implications around having parent POMs with version numbers less than childs POMs?