Today was the second time that I ran across this problem. Each time I run across it, I search Google, come back empty handed, and then have a second look, find the solution, and altogether waste too much time on a problem I have solved before. As a measure to prevent this, I am posting both problem and solution to this mailing list, that has a high Google juice, so that the next time, I will find my own solution.

In other words, I am shamelessly using the list to archive my problems and solutions.

The problem:
The following code segfaults:
   printf("%s\n", inet_ntoa(addr) );

The cause: Failing to include the relevant header file.

The solution: Add:
#include <arpa/inet.h>

Sorry for the noise.
Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to