* Implement POSIX (XSI)'s header file re_comp.h
[dragonfly.git] / sys / kern / subr_xxx.c
1 /*
2  * Copyright (c) 1982, 1986, 1991, 1993
3  *      The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *      This product includes software developed by the University of
16  *      California, Berkeley and its contributors.
17  * 4. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  *      @(#)subr_xxx.c  8.1 (Berkeley) 6/10/93
34  * $FreeBSD: src/sys/kern/subr_xxx.c,v 1.15.2.1 2001/02/26 04:23:16 jlemon Exp $
35  * $DragonFly: src/sys/kern/Attic/subr_xxx.c,v 1.3 2003/06/23 17:55:41 dillon Exp $
36  */
37
38 /*
39  * Miscellaneous trivial functions.
40  */
41 #include <sys/param.h>
42 #include <sys/systm.h>
43
44 /*
45  * Return error for operation not supported
46  * on a specific object or file type.
47  */
48 int
49 eopnotsupp()
50 {
51
52         return (EOPNOTSUPP);
53 }
54
55 /*
56  * Return error for an inval operation
57  * on a specific object or file type.
58  */
59 int
60 einval()
61 {
62
63         return (EINVAL);
64 }
65
66 /*
67  * Generic null operation, always returns success.
68  */
69 int
70 nullop()
71 {
72
73         return (0);
74 }
75
76 #include <sys/conf.h>
77
78 /*
79  * Unsupported devswitch functions (e.g. for writing to read-only device).
80  * XXX may belong elsewhere.
81  */
82
83 int
84 noopen(dev, flags, fmt, td)
85         dev_t dev;
86         int flags;
87         int fmt;
88         struct thread *td;
89 {
90
91         return (ENODEV);
92 }
93
94 int
95 noclose(dev, flags, fmt, td)
96         dev_t dev;
97         int flags;
98         int fmt;
99         struct thread *td;
100 {
101
102         return (ENODEV);
103 }
104
105 int
106 noread(dev, uio, ioflag)
107         dev_t dev;
108         struct uio *uio;
109         int ioflag;
110 {
111
112         return (ENODEV);
113 }
114
115 int
116 nowrite(dev, uio, ioflag)
117         dev_t dev;
118         struct uio *uio;
119         int ioflag;
120 {
121
122         return (ENODEV);
123 }
124
125 int
126 noioctl(dev, cmd, data, flags, td)
127         dev_t dev;
128         u_long cmd;
129         caddr_t data;
130         int flags;
131         struct thread *td;
132 {
133
134         return (ENODEV);
135 }
136
137 int
138 nokqfilter(dev, kn)
139         dev_t dev;
140         struct knote *kn;
141 {
142
143         return (ENODEV);
144 }
145
146 int
147 nommap(dev, offset, nprot)
148         dev_t dev;
149         vm_offset_t offset;
150         int nprot;
151 {
152
153         /* Don't return ENODEV.  That would allow mapping address ENODEV! */
154         return (-1);
155 }
156
157 int
158 nodump(dev)
159         dev_t dev;
160 {
161
162         return (ENODEV);
163 }
164
165 /*
166  * Null devswitch functions (for when the operation always succeeds).
167  * XXX may belong elsewhere.
168  * XXX not all are here (e.g., seltrue() isn't).
169  */
170
171 /*
172  * XXX this is probably bogus.  Any device that uses it isn't checking the
173  * minor number.
174  */
175 int
176 nullopen(dev, flags, fmt, td)
177         dev_t dev;
178         int flags;
179         int fmt;
180         struct thread *td;
181 {
182
183         return (0);
184 }
185
186 int
187 nullclose(dev, flags, fmt, td)
188         dev_t dev;
189         int flags;
190         int fmt;
191         struct thread *td;
192 {
193
194         return (0);
195 }