BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / kern / subr_xxx.c
index 9cc4c9f..4d8ce97 100644 (file)
@@ -2,18 +2,44 @@
  * Copyright (c) 1982, 1986, 1991 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1982, 1986, 1991 Regents of the University of California.
  * All rights reserved.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)subr_xxx.c  7.9 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)subr_xxx.c  7.10 (Berkeley) 4/20/91
  */
 
 /*
  * Miscellaneous trivial functions, including many
  * that are often inline-expanded or done in assembler.
  */
  */
 
 /*
  * Miscellaneous trivial functions, including many
  * that are often inline-expanded or done in assembler.
  */
-#include "types.h"
+#include "param.h"
+#include "systm.h"
 #include "machine/cpu.h"
 #include "machine/cpu.h"
-#include "errno.h"
 
 /*
  * Unsupported device function (e.g. writing to read-only device).
 
 /*
  * Unsupported device function (e.g. writing to read-only device).
@@ -34,7 +60,28 @@ enxio()
 }
 
 /*
 }
 
 /*
- * Return error for unsupported operation.
+ * Unsupported ioctl function.
+ */
+enoioctl()
+{
+
+       return (ENOTTY);
+}
+
+/*
+ * Unsupported system function.
+ * This is used for an otherwise-reasonable operation
+ * that is not supported by the current system binary.
+ */
+enosys()
+{
+
+       return (ENOSYS);
+}
+
+/*
+ * Return error for operation not supported
+ * on a specific object or file type.
  */
 eopnotsupp()
 {
  */
 eopnotsupp()
 {
@@ -55,7 +102,7 @@ nullop()
  * Definitions of various trivial functions;
  * usually expanded inline rather than being defined here.
  */
  * Definitions of various trivial functions;
  * usually expanded inline rather than being defined here.
  */
-#if !defined(vax) && !defined(tahoe)
+#ifdef NEED_MINMAX
 imin(a, b)
        int a, b;
 {
 imin(a, b)
        int a, b;
 {
@@ -117,9 +164,9 @@ ulmax(a, b)
 
        return (a > b ? a : b);
 }
 
        return (a > b ? a : b);
 }
-#endif
+#endif /* NEED_MINMAX */
 
 
-#if !defined(vax) && !defined(tahoe) && !defined(hp300)
+#ifdef NEED_FFS
 ffs(mask)
        register long mask;
 {
 ffs(mask)
        register long mask;
 {
@@ -133,9 +180,9 @@ ffs(mask)
                mask >>= 1;
        }
 }
                mask >>= 1;
        }
 }
-#endif
+#endif /* NEED_FFS */
 
 
-#if !defined(vax) && !defined(hp300)
+#ifdef NEED_BCMP
 bcmp(v1, v2, len)
        void *v1, *v2;
        register unsigned len;
 bcmp(v1, v2, len)
        void *v1, *v2;
        register unsigned len;
@@ -147,7 +194,9 @@ bcmp(v1, v2, len)
                        return (1);
        return (0);
 }
                        return (1);
        return (0);
 }
+#endif /* NEED_BCMP */
 
 
+#ifdef NEED_STRLEN
 strlen(s1)
        register char *s1;
 {
 strlen(s1)
        register char *s1;
 {
@@ -157,4 +206,4 @@ strlen(s1)
                ;
        return (len);
 }
                ;
        return (len);
 }
-#endif
+#endif /* NEED_STRLEN */