On Fri, 22 Oct 2010, Philip Guenther wrote:
> Instead, how about making <netinet/tcp.h> comply with SUS/POSIX, which 
> says that in a conforming environment this header file shall define 
> TCP_NODELAY and may declare additional TCP_* macros, but shall not 
> otherwise intrude on the applicatiojn visible namespace.  Wrapping the top 
> of the file in #if __BSD_VISIBLE is the simplest way to meet that 
> requirement and solve both the PR and the request in this thread without 
> breaking software that doesn't insist on slamming its face into the POSIX 
> wall.

Update: need <sys/cdefs.h> for __BSD_VISIBLE.  Running a build now...

Philip Guenther

Index: sys/netinet/tcp.h
===================================================================
RCS file: /cvs/src/sys/netinet/tcp.h,v
retrieving revision 1.17
diff -u -p -r1.17 tcp.h
--- sys/netinet/tcp.h   27 Apr 2006 02:19:32 -0000      1.17
+++ sys/netinet/tcp.h   23 Oct 2010 05:42:40 -0000
@@ -35,6 +35,10 @@
 #ifndef _NETINET_TCP_H_
 #define        _NETINET_TCP_H_
 
+#include <sys/cdefs.h>
+
+#if __BSD_VISIBLE
+
 typedef u_int32_t tcp_seq;
 
 /*
@@ -113,6 +117,8 @@ struct tcphdr {
 #define        TCP_MAXWIN      65535   /* largest value for (unscaled) window 
*/
 
 #define        TCP_MAX_WINSHIFT        14      /* maximum window shift */
+
+#endif /* __BSD_VISIBLE */
 
 /*
  * User-settable options (used with setsockopt).

Reply via email to