bring up to revision 7 for tahoe release
[unix-history] / usr / src / sys / netns / ns_error.c
index e5b1c3e..4e5cbfd 100644 (file)
@@ -1,9 +1,15 @@
 /*
 /*
- * Copyright (c) 1984, 1985 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1984, 1988 Regents of the University of California.
+ * All rights reserved.
  *
  *
- *     @(#)ns_error.c  6.8 (Berkeley) %G%
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of California at Berkeley. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
+ *
+ *      @(#)ns_error.c 7.5 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
 int    ns_errprintfs = 0;
 #endif
 
 int    ns_errprintfs = 0;
 #endif
 
+ns_err_x(c)
+{
+       register u_short *w, *lim, *base = ns_errstat.ns_es_codes;
+       u_short x = c;
+
+       /*
+        * zero is a legit error code, handle specially
+        */
+       if (x == 0)
+               return (0);
+       lim = base + NS_ERR_MAX - 1;
+       for (w = base + 1; w < lim; w++) {
+               if (*w == 0)
+                       *w = x;
+               if (*w == x)
+                       break;
+       }
+       return (w - base);
+}
+
 /*
  * Generate an error packet of type error
  * in response to bad packet.
 /*
  * Generate an error packet of type error
  * in response to bad packet.
@@ -237,7 +263,7 @@ free:
 u_long
 nstime()
 {
 u_long
 nstime()
 {
-       int s = spl6();
+       int s = splclock();
        u_long t;
 
        t = (time.tv_sec % (24*60*60)) * 1000 + time.tv_usec / 1000;
        u_long t;
 
        t = (time.tv_sec % (24*60*60)) * 1000 + time.tv_usec / 1000;