VFLUSHO -> VDISCARD
[unix-history] / usr / src / sys / kern / subr_xxx.c
... / ...
CommitLineData
1/*
2 * Copyright (c) 1982, 1986 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
6 * @(#)subr_xxx.c 7.7 (Berkeley) %G%
7 */
8
9#include "errno.h"
10
11/*
12 * Routine placed in illegal entries in the bdevsw and cdevsw tables.
13 */
14nodev()
15{
16
17 return (ENODEV);
18}
19
20/*
21 * Null routine; placed in insignificant entries
22 * in the bdevsw and cdevsw tables.
23 */
24nulldev()
25{
26
27 return (0);
28}
29
30/*
31 * Definitions of various trivial functions;
32 * usually expanded inline rather than being defined here.
33 */
34#if !defined(vax) && !defined(tahoe)
35imin(a, b)
36{
37
38 return (a < b ? a : b);
39}
40
41imax(a, b)
42{
43
44 return (a > b ? a : b);
45}
46
47unsigned
48min(a, b)
49 unsigned a, b;
50{
51
52 return (a < b ? a : b);
53}
54
55unsigned
56max(a, b)
57 unsigned a, b;
58{
59
60 return (a > b ? a : b);
61}
62#endif
63
64#if !defined(vax) && !defined(tahoe) && !defined(hp300)
65ffs(mask)
66 register long mask;
67{
68 register int bit;
69
70 if (!mask)
71 return(0);
72 for (bit = 1;; ++bit)
73 if (mask&0x01)
74 return(bit);
75 mask >>= 1;
76 }
77}
78#endif
79
80#if !defined(vax) && !defined(hp300)
81bcmp(s1, s2, len)
82 register char *s1, *s2;
83 register unsigned len;
84{
85
86 while (len--)
87 if (*s1++ != *s2++)
88 return (1);
89 return (0);
90}
91
92strlen(s1)
93 register char *s1;
94{
95 register int len;
96
97 for (len = 0; *s1++ != '\0'; len++)
98 /* void */;
99 return (len);
100}
101#endif