aboutsummaryrefslogtreecommitdiff
path: root/ftmacros.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-11-17 15:06:33 -0800
committerGuy Harris <guy@alum.mit.edu>2017-11-17 15:06:33 -0800
commit61bc50ffdbbf9cdb2444b97fbbcc0700e724414e (patch)
treec9375ba7b25d18b013203ed7fd6ae86627c1772f /ftmacros.h
parentc909e8a31ffcbb7f1a41bb801392e14f5d20e1fc (diff)
Use the XPG 4.2 versions of the networking APIs in Solaris.
Those, unlike the default versions, comply with the Single UNIX Specification, meaning they are able to detect truncation of datagrams when received with recvmsg().
Diffstat (limited to 'ftmacros.h')
-rw-r--r--ftmacros.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ftmacros.h b/ftmacros.h
index 19b9fb43..8e319493 100644
--- a/ftmacros.h
+++ b/ftmacros.h
@@ -49,6 +49,13 @@
*/
#if defined(sun) || defined(__sun)
#define __EXTENSIONS__
+
+ /*
+ * We also need to define _XPG4_2 in order to get
+ * the Single UNIX Specification version of
+ * recvmsg().
+ */
+ #define _XPG4_2
#elif defined(_hpux) || defined(hpux) || defined(__hpux)
#define _REENTRANT
#elif defined(__linux__) || defined(linux) || defined(__linux)