1

I want to read the definition of those APIs of netlink, but I can only find header files like sys/socket.h, linux/netlink.h. Where can I find the .c files?

mjs
  • 2,837
  • 4
  • 28
  • 48
Warbean
  • 547
  • 2
  • 5
  • 19

2 Answers2

2

A Linux cross reference site will help you.

For instance, look at include/linux/netlink.h.
It has links on each function which will bring up a search window for that function and help you find the definition.

Benjamin Leinweber
  • 2,774
  • 1
  • 24
  • 41
1

The "definition" (aka declaration) of API is in the header file.

If you want to look at the complete sources you need to download and unpack kernel sources.

JeffRSon
  • 10,404
  • 4
  • 26
  • 51
  • 1
    "declaration" and "definition" are two distinct technical words. http://www.c4learn.com/difference-between-declaration-and-definition-c-programming.html. The op's usage of "definition" is correct. – Benjamin Leinweber Jul 20 '13 at 08:04
  • I don't see it like that. The definition of API (how you call it or how you use it) is, the 'I' says it, the interface. It is "defined" through the "declaration". The OP is, however, looking for the *implementation*. – JeffRSon Jul 20 '13 at 11:05