/* This hopefully will fix some compile errors on other platforms --
* the usage of msg_control/msg_controllen are X/Open Extended attributes,
- * or so it seems, by reading HP/UX 10.20 manual pages. */
+ * or so it seems, by reading HP/UX 10.20 manual pages.
+ *
+ * The second two defines are for Solaris 8 with the Sun WorkShop compiler.
+ */
#define _XOPEN_SOURCE_EXTENDED
+#define _XPG4_2
+#define __EXTENSIONS__
#include "ext/standard/info.h"
#include "php_sockets.h"
#endif
#endif
+/* Solaris 8 doesn't appear to define SUN_LEN in <sys/un.h> */
+#ifndef SUN_LEN
+#define SUN_LEN(su) \
+ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+#endif
+
/* Use the read() wrapper, stopping at '\n', '\r', or '\0'. */
#define PHP_NORMAL_READ 0x0001
/* Use the read() wrapper, but read until the entire buffer is filled. */