linux/sock_diag.h for use with netlink sockets

Mike Frysinger vapier at gentoo.org
Thu Aug 7 08:55:57 UTC 2014


On Thu 07 Aug 2014 09:40:56 Zubin Mithra wrote:
> I was trying out some netlink socket code and I needed to use the
> header file "linux/sock_diag.h".
> 
> Doing a locate for the file gave me the following result(I do have
> kernel headers installed and I'm on an Ubuntu machine).
> 
> $ locate linux/sock_diag.h
> /usr/arm-linux-gnueabi/include/linux/sock_diag.h
> /usr/src/linux-headers-3.8.0-29/include/linux/sock_diag.h
> /usr/src/linux-headers-3.8.0-29/include/uapi/linux/sock_diag.h
> /usr/src/linux-headers-3.8.0-29-generic/include/linux/sock_diag.h
> 
> Upon compiling my code I got the error stating :-
> fatal error: linux/sock_diag.h: No such file or directory
> 
> As per instructions I found, I tried doing the following :-
> sudo ln -sfn /usr/src/linux-headers-3.8.0-29-generic /usr/src/linux
> 
> However, the error seems to persist. Is there something obvious that
> I'm missing/doing wrong? An alternative would be to move the
> macros/structures in sock_diag.h to the codebase but I don't think
> thats a good idea.

code may not build against files in /usr/src/linux.  you must use files that 
are provided for the system in e.g. /usr/include.  user linux headers live 
normally at /usr/include/linux/ but you don't need to adjust your include 
paths for those to work.

make sure you have have the relevant dev package installed that provides 
things.  i guess on Ubuntu it's called linux-libc-dev.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140807/0b50d6b3/attachment.bin>


More information about the Strace-devel mailing list