[Git][NTPsec/ntpsec][master] Properly set compatibility defines for Solaris

Matt Selsky gitlab at mg.gitlab.com
Fri Jun 9 04:59:48 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
a00f7ee8 by Matt Selsky at 2017-06-09T00:54:42-04:00
Properly set compatibility defines for Solaris

struct msghdr has all of the members specified by POSIX, if you set the defines
correctly.

Fixes Gitlab issue #342

- - - - -


3 changed files:

- ntpd/ntp_io.c
- ntpd/ntp_packetstamp.c
- wscript


Changes:

=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -2326,8 +2326,7 @@ read_network_packet(
 	msghdr.msg_namelen    = fromlen;
 	msghdr.msg_iov        = &iovec;
 	msghdr.msg_iovlen     = 1;
-	/* msghdr.msg_flags   = 0; Not all msghdr have msg_flags: Solaris */
-        /* Solaris does not have the next two */
+	msghdr.msg_flags      = 0;
 	msghdr.msg_control    = (void *)&control;
 	msghdr.msg_controllen = sizeof(control);
 	buflen                = recvmsg(fd, &msghdr, 0);


=====================================
ntpd/ntp_packetstamp.c
=====================================
--- a/ntpd/ntp_packetstamp.c
+++ b/ntpd/ntp_packetstamp.c
@@ -22,7 +22,8 @@
  *   bintime documentation is at
  *   http://phk.freebsd.dk/pubs/timecounter.pdf
  * SO_TIMESTAMPNS/SCM_TIMESTAMPNS  Linux
- * SO_TIMESTAMP/SCM_TIMESTAMP      FreeBSD, NetBSD, OpenBSD, Linux, macOS
+ * SO_TIMESTAMP/SCM_TIMESTAMP      FreeBSD, NetBSD, OpenBSD, Linux, macOS,
+ *                                 Solaris
  *
  * Linux supports both SO_TIMESTAMP and SO_TIMESTAMPNS so it's
  * important to check for SO_TIMESTAMPNS first to get the better accuracy.


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -534,8 +534,10 @@ int main(int argc, char **argv) {
         ctx.define("__APPLE_USE_RFC_3542", 1,
                    comment="Needed for IPv6 support")
     elif ctx.env.DEST_OS == "sunos":
-        ctx.define("_POSIX_PTHREAD_SEMANTICS", "1", quote=False,
-                   comment="Needed for POSIX function definitions on Solaris")
+        # Declare compatibility with the POSIX.1-2001 standard, and any
+        # headers/interfaces not in conflict with that standard
+        ctx.define("_POSIX_C_SOURCE", "200112L", quote=False)
+        ctx.define("__EXTENSIONS__", "1", quote=False)
 
     # XXX: needed for ntp_worker, for now
     if ctx.env.DEST_OS == "openbsd":



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a00f7ee86b4b16fd8e7c90d231d029f146f508c3

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a00f7ee86b4b16fd8e7c90d231d029f146f508c3
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170609/b4488443/attachment.html>


More information about the vc mailing list