lkml.org 
[lkml]   [1999]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Conflict in declaration of ntohs & C. ...
Date
On 20 Jun 1999 15:42:24 -0000, "Davide Libenzi" <dlibenzi@maticad.it>
wrote:

>I have kernel 2.3.6 & egcs 1.1.2 correctly installed on my system.
>Compiling this sequence on includes:

What you didn't write was which C library you're using, so I'll assume
glibc2.

#include <linux/if.h>
#include <linux/socket.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/if_ether.h>

If that is so, the answer is clear: never include kernel headers in
user space code and vice versa. For user space code include the
library headers instead. This would be:

#include <net/if.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/if_ether.h>


Philipp

--
Close the windows! The penguin is freezing.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.119 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site