|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58583 Build error: 'MSG_NOSIGNAL' undeclared (first use in this function)
Submitted: 2009-03-11 03:46 UTC Modified: 2009-03-15 04:57 UTC
From: jess at zend dot com Assigned:
Status: Closed Package: memcache (PECL)
PHP Version: 5_2 CVS-2009-03-11 (dev) OS: MAC OS X [Darwin]
Private report: No CVE-ID: None
 [2009-03-11 03:46 UTC] jess at zend dot com
When attempting to compile memcache 3.0.4 [latest beta] on MAC OS X 10.4 [Darwin 8.6], the following error occurs:
error: 'MSG_NOSIGNAL' undeclared (first use in this function)

Reproduce code:
This patch solves it:

--- memcache_pool.h.orig        2009-02-22 18:01:43.000000000 +0200
+++ memcache_pool.h     2009-03-11 09:36:02.000000000 +0200
@@ -45,6 +45,24 @@
 #define MMC_SERIALIZED 0x0001
 #define MMC_COMPRESSED 0x0002

+#ifndef PHP_WIN32
+// mac os x has no MSG_NOSIGNAL
+// but >= 10.2 comes with SO_NOSIGPIPE
+// SO_NOSIGPIPE is a setsockopt() option
+// and not a send() parameter as MSG_NOSIGNAL
+// OpenBSD has none of the options so we
+// need to ignore SIGPIPE events
+#define MSG_NOSIGNAL 0
+#include <sys/errno.h>
 /* use second lowest byte to indicate data type */
 #define MMC_TYPE_STRING        0x0000
 #define MMC_TYPE_BOOL  0x0100


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-12 13:12 UTC] mikael at synd dot info
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

Would you mind checking that it works (don't have an OSX shell to test on), you can checkout and build from CVS like

cvs -d co -r NON_BLOCKING_IO pecl/memcache
cd pecl/memcache
phpize ./configure
make && make install
 [2009-03-15 04:57 UTC] jess at zend dot com
Built from HEAD and of course and compiled just fine on my MAC OS X 10.4 machine [Darwin 8.6].

Thanks for applying the patch :)
 [2009-11-19 17:29 UTC] tim at digicol dot de
Sorry, not sure whether a comment on a closed bug is the 
right place for this:

I get the same error message with PHP 5.3.0 on Mac OS X 10.6 
(Snow Leopard) Server [Darwin 10.2].

The exact same patch does solve the problem.

Is it possible that this patch did not make it into 5.3?
 [2011-12-12 04:27 UTC] federico dot schwindt at gmail dot com
OpenBSD has MSG_NOSIGNAL now so the comment should be updated.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Sep 30 06:01:23 2020 UTC