Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern move the timestamp stuff to uipc_socket.c because i...



details:   https://anonhg.NetBSD.org/src/rev/9ddafb04628c
branches:  trunk
changeset: 825275:9ddafb04628c
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jul 06 17:42:39 2017 +0000

description:
move the timestamp stuff to uipc_socket.c because it already has the compat
includes.

diffstat:

 sys/kern/uipc_socket.c  |  31 +++++++++++++++++++++++++++++--
 sys/kern/uipc_socket2.c |  37 ++-----------------------------------
 2 files changed, 31 insertions(+), 37 deletions(-)

diffs (111 lines):

diff -r 2969d1529212 -r 9ddafb04628c sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Thu Jul 06 17:14:35 2017 +0000
+++ b/sys/kern/uipc_socket.c    Thu Jul 06 17:42:39 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.255 2017/05/27 21:02:56 bouyer Exp $ */
+/*     $NetBSD: uipc_socket.c,v 1.256 2017/07/06 17:42:39 christos Exp $       */
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.255 2017/05/27 21:02:56 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.256 2017/07/06 17:42:39 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2410,6 +2410,33 @@
        return revents;
 }
 
+struct mbuf **
+sbsavetimestamp(int opt, struct mbuf *m, struct mbuf **mp)
+{
+       struct timeval tv;
+       microtime(&tv);
+
+#ifdef SO_OTIMESTAMP
+       if (opt & SO_OTIMESTAMP) {
+               struct timeval50 tv50;
+
+               timeval_to_timeval50(&tv, &tv50);
+               *mp = sbcreatecontrol(&tv50, sizeof(tv50),
+                   SCM_OTIMESTAMP, SOL_SOCKET);
+               if (*mp)
+                       mp = &(*mp)->m_next;
+       } else
+#endif
+
+       if (opt & SO_TIMESTAMP) {
+               *mp = sbcreatecontrol(&tv, sizeof(tv),
+                   SCM_TIMESTAMP, SOL_SOCKET);
+               if (*mp)
+                       mp = &(*mp)->m_next;
+       }
+       return mp;
+}
+
 
 #include <sys/sysctl.h>
 
diff -r 2969d1529212 -r 9ddafb04628c sys/kern/uipc_socket2.c
--- a/sys/kern/uipc_socket2.c   Thu Jul 06 17:14:35 2017 +0000
+++ b/sys/kern/uipc_socket2.c   Thu Jul 06 17:42:39 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket2.c,v 1.125 2017/07/06 17:08:57 christos Exp $      */
+/*     $NetBSD: uipc_socket2.c,v 1.126 2017/07/06 17:42:39 christos Exp $      */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,12 +58,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.125 2017/07/06 17:08:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.126 2017/07/06 17:42:39 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
 #include "opt_sb_max.h"
-#include "opt_compat_netbsd.h"
 #endif
 
 #include <sys/param.h>
@@ -1528,35 +1527,3 @@
                solockretry(so, lock);
        return error;
 }
-
-#ifdef COMPAT_50
-#include <compat/sys/time.h>
-#include <compat/sys/socket.h>
-#endif
-
-struct mbuf **
-sbsavetimestamp(int opt, struct mbuf *m, struct mbuf **mp)
-{
-       struct timeval tv;
-       microtime(&tv);
-
-#ifdef SO_OTIMESTAMP
-       if (opt & SO_OTIMESTAMP) {
-               struct timeval50 tv50;
-
-               timeval_to_timeval50(&tv, &tv50);
-               *mp = sbcreatecontrol(&tv50, sizeof(tv50),
-                   SCM_OTIMESTAMP, SOL_SOCKET);
-               if (*mp)
-                       mp = &(*mp)->m_next;
-       } else
-#endif
-
-       if (opt & SO_TIMESTAMP) {
-               *mp = sbcreatecontrol(&tv, sizeof(tv),
-                   SCM_TIMESTAMP, SOL_SOCKET);
-               if (*mp)
-                       mp = &(*mp)->m_next;
-       }
-       return mp;
-}



Home | Main Index | Thread Index | Old Index