PERFORCE change 44718 for review

Sam Leffler sam at FreeBSD.org
Fri Jan 2 17:22:56 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=44718

Change 44718 by sam at sam_ebb on 2004/01/02 17:22:48

	protect socket decl with ifdef _KERNEL; user apps can't
	grok the mutex in the sockbufs

Affected files ...

.. //depot/projects/netperf+sockets/sys/sys/socketvar.h#8 edit

Differences ...

==== //depot/projects/netperf+sockets/sys/sys/socketvar.h#8 (text+ko) ====

@@ -37,6 +37,7 @@
 #ifndef _SYS_SOCKETVAR_H_
 #define _SYS_SOCKETVAR_H_
 
+#ifdef _KERNEL
 #include <sys/queue.h>			/* for TAILQ macros */
 #include <sys/selinfo.h>		/* for struct selinfo */
 #include <sys/_lock.h>
@@ -152,6 +153,8 @@
 #define	SOCK_UNLOCK(_so)		SOCKBUF_UNLOCK(&(_so)->so_rcv)
 #define	SOCK_LOCK_ASSERT(_so)		SOCKBUF_LOCK_ASSERT(&(_so)->so_rcv)
 
+#endif /* _KERNEL */
+
 /*
  * Socket state bits.
  */
@@ -203,6 +206,7 @@
 	uid_t	so_uid;		/* XXX */
 };
 
+#ifdef _KERNEL
 /*
  * Macros for sockets and socket buffering.
  */
@@ -328,8 +332,6 @@
 		sowakeup_locked((so), &(so)->so_snd);	\
 } while (0)
 
-#ifdef _KERNEL
-
 /*
  * Argument structure for sosetopt et seq.  This is in the KERNEL
  * section because it will never be visible to user code.


More information about the p4-projects mailing list