Thread (15 messages) flat view 15 messages, 3 authors, 2008-05-23

Re: [PATCH 18/18] flag parameters: check magic constants

From: David Miller <davem@davemloft.net>
Date: 2008-05-13 03:46:06
Also in: lkml

From: Andrew Morton <akpm@linux-foundation.org>
Date: Mon, 12 May 2008 20:13:41 -0700
On Tue, 6 May 2008 17:18:07 -0400 Ulrich Drepper [off-list ref] wrote:
quoted
--- a/net/socket.c
+++ b/net/socket.c
@@ -1219,6 +1219,13 @@ asmlinkage long sys_socket(int family, int type, int protocol)
 	struct socket *sock;
 	int flags;
 
+	/* Check the SOCK_* constants for consistency.  */
+	BUILD_BUG_ON(SOCK_CLOEXEC != O_CLOEXEC);
+	BUILD_BUG_ON(SOCK_NONBLOCK != O_NONBLOCK);
+	BUILD_BUG_ON((SOCK_MAX | SOCK_TYPE_MASK) != SOCK_TYPE_MASK);
+	BUILD_BUG_ON(SOCK_CLOEXEC & SOCK_TYPE_MASK);
+	BUILD_BUG_ON(SOCK_NONBLOCK & SOCK_TYPE_MASK);
The fifth assertion triggers with alpha allmodconfig.
Unfortunately, MIPS and PARISC look like they will as well :-/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help