spec_vnops.c revision 1.28 1 /* $NetBSD: spec_vnops.c,v 1.28 1996/02/09 22:40:57 christos Exp $ */
2
3 /*
4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)spec_vnops.c 8.8 (Berkeley) 11/21/94
36 */
37
38 #include <sys/param.h>
39 #include <sys/proc.h>
40 #include <sys/systm.h>
41 #include <sys/kernel.h>
42 #include <sys/conf.h>
43 #include <sys/buf.h>
44 #include <sys/mount.h>
45 #include <sys/namei.h>
46 #include <sys/vnode.h>
47 #include <sys/stat.h>
48 #include <sys/errno.h>
49 #include <sys/ioctl.h>
50 #include <sys/file.h>
51 #include <sys/disklabel.h>
52 #include <sys/cpu.h>
53
54 #include <miscfs/specfs/specdev.h>
55
56 /* symbolic sleep message strings for devices */
57 char devopn[] = "devopn";
58 char devio[] = "devio";
59 char devwait[] = "devwait";
60 char devin[] = "devin";
61 char devout[] = "devout";
62 char devioc[] = "devioc";
63 char devcls[] = "devcls";
64
65 int (**spec_vnodeop_p) __P((void *));
66 struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
67 { &vop_default_desc, vn_default_error },
68 { &vop_lookup_desc, spec_lookup }, /* lookup */
69 { &vop_create_desc, spec_create }, /* create */
70 { &vop_mknod_desc, spec_mknod }, /* mknod */
71 { &vop_open_desc, spec_open }, /* open */
72 { &vop_close_desc, spec_close }, /* close */
73 { &vop_access_desc, spec_access }, /* access */
74 { &vop_getattr_desc, spec_getattr }, /* getattr */
75 { &vop_setattr_desc, spec_setattr }, /* setattr */
76 { &vop_read_desc, spec_read }, /* read */
77 { &vop_write_desc, spec_write }, /* write */
78 { &vop_lease_desc, spec_lease_check }, /* lease */
79 { &vop_ioctl_desc, spec_ioctl }, /* ioctl */
80 { &vop_select_desc, spec_select }, /* select */
81 { &vop_mmap_desc, spec_mmap }, /* mmap */
82 { &vop_fsync_desc, spec_fsync }, /* fsync */
83 { &vop_seek_desc, spec_seek }, /* seek */
84 { &vop_remove_desc, spec_remove }, /* remove */
85 { &vop_link_desc, spec_link }, /* link */
86 { &vop_rename_desc, spec_rename }, /* rename */
87 { &vop_mkdir_desc, spec_mkdir }, /* mkdir */
88 { &vop_rmdir_desc, spec_rmdir }, /* rmdir */
89 { &vop_symlink_desc, spec_symlink }, /* symlink */
90 { &vop_readdir_desc, spec_readdir }, /* readdir */
91 { &vop_readlink_desc, spec_readlink }, /* readlink */
92 { &vop_abortop_desc, spec_abortop }, /* abortop */
93 { &vop_inactive_desc, spec_inactive }, /* inactive */
94 { &vop_reclaim_desc, spec_reclaim }, /* reclaim */
95 { &vop_lock_desc, spec_lock }, /* lock */
96 { &vop_unlock_desc, spec_unlock }, /* unlock */
97 { &vop_bmap_desc, spec_bmap }, /* bmap */
98 { &vop_strategy_desc, spec_strategy }, /* strategy */
99 { &vop_print_desc, spec_print }, /* print */
100 { &vop_islocked_desc, spec_islocked }, /* islocked */
101 { &vop_pathconf_desc, spec_pathconf }, /* pathconf */
102 { &vop_advlock_desc, spec_advlock }, /* advlock */
103 { &vop_blkatoff_desc, spec_blkatoff }, /* blkatoff */
104 { &vop_valloc_desc, spec_valloc }, /* valloc */
105 { &vop_vfree_desc, spec_vfree }, /* vfree */
106 { &vop_truncate_desc, spec_truncate }, /* truncate */
107 { &vop_update_desc, spec_update }, /* update */
108 { &vop_bwrite_desc, spec_bwrite }, /* bwrite */
109 { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
110 };
111 struct vnodeopv_desc spec_vnodeop_opv_desc =
112 { &spec_vnodeop_p, spec_vnodeop_entries };
113
114 /*
115 * Trivial lookup routine that always fails.
116 */
117 int
118 spec_lookup(v)
119 void *v;
120 {
121 struct vop_lookup_args /* {
122 struct vnode *a_dvp;
123 struct vnode **a_vpp;
124 struct componentname *a_cnp;
125 } */ *ap = v;
126
127 *ap->a_vpp = NULL;
128 return (ENOTDIR);
129 }
130
131 /*
132 * Open a special file.
133 */
134 /* ARGSUSED */
135 int
136 spec_open(v)
137 void *v;
138 {
139 struct vop_open_args /* {
140 struct vnode *a_vp;
141 int a_mode;
142 struct ucred *a_cred;
143 struct proc *a_p;
144 } */ *ap = v;
145 struct vnode *bvp, *vp = ap->a_vp;
146 dev_t bdev, dev = (dev_t)vp->v_rdev;
147 register int maj = major(dev);
148 int error;
149
150 /*
151 * Don't allow open if fs is mounted -nodev.
152 */
153 if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_NODEV))
154 return (ENXIO);
155
156 switch (vp->v_type) {
157
158 case VCHR:
159 if ((u_int)maj >= nchrdev)
160 return (ENXIO);
161 if (ap->a_cred != FSCRED && (ap->a_mode & FWRITE)) {
162 /*
163 * When running in very secure mode, do not allow
164 * opens for writing of any disk character devices.
165 */
166 if (securelevel >= 2 && cdevsw[maj].d_type == D_DISK)
167 return (EPERM);
168 /*
169 * When running in secure mode, do not allow opens
170 * for writing of /dev/mem, /dev/kmem, or character
171 * devices whose corresponding block devices are
172 * currently mounted.
173 */
174 if (securelevel >= 1) {
175 if ((bdev = chrtoblk(dev)) != NODEV &&
176 vfinddev(bdev, VBLK, &bvp) &&
177 bvp->v_usecount > 0 &&
178 (error = vfs_mountedon(bvp)))
179 return (error);
180 if (iskmemdev(dev))
181 return (EPERM);
182 }
183 }
184 if (cdevsw[maj].d_type == D_TTY)
185 vp->v_flag |= VISTTY;
186 VOP_UNLOCK(vp);
187 error = (*cdevsw[maj].d_open)(dev, ap->a_mode, S_IFCHR, ap->a_p);
188 VOP_LOCK(vp);
189 return (error);
190
191 case VBLK:
192 if ((u_int)maj >= nblkdev)
193 return (ENXIO);
194 /*
195 * When running in very secure mode, do not allow
196 * opens for writing of any disk block devices.
197 */
198 if (securelevel >= 2 && ap->a_cred != FSCRED &&
199 (ap->a_mode & FWRITE) && bdevsw[maj].d_type == D_DISK)
200 return (EPERM);
201 /*
202 * Do not allow opens of block devices that are
203 * currently mounted.
204 */
205 if ((error = vfs_mountedon(vp)) != 0)
206 return (error);
207 return ((*bdevsw[maj].d_open)(dev, ap->a_mode, S_IFBLK, ap->a_p));
208 case VNON:
209 case VLNK:
210 case VDIR:
211 case VREG:
212 case VBAD:
213 case VFIFO:
214 case VSOCK:
215 break;
216 }
217 return (0);
218 }
219
220 /*
221 * Vnode op for read
222 */
223 /* ARGSUSED */
224 int
225 spec_read(v)
226 void *v;
227 {
228 struct vop_read_args /* {
229 struct vnode *a_vp;
230 struct uio *a_uio;
231 int a_ioflag;
232 struct ucred *a_cred;
233 } */ *ap = v;
234 register struct vnode *vp = ap->a_vp;
235 register struct uio *uio = ap->a_uio;
236 struct proc *p = uio->uio_procp;
237 struct buf *bp;
238 daddr_t bn, nextbn;
239 long bsize, bscale, ssize;
240 struct partinfo dpart;
241 int n, on, majordev;
242 int (*ioctl) __P((dev_t, u_long, caddr_t, int, struct proc *));
243 int error = 0;
244
245 #ifdef DIAGNOSTIC
246 if (uio->uio_rw != UIO_READ)
247 panic("spec_read mode");
248 if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
249 panic("spec_read proc");
250 #endif
251 if (uio->uio_resid == 0)
252 return (0);
253
254 switch (vp->v_type) {
255
256 case VCHR:
257 VOP_UNLOCK(vp);
258 error = (*cdevsw[major(vp->v_rdev)].d_read)
259 (vp->v_rdev, uio, ap->a_ioflag);
260 VOP_LOCK(vp);
261 return (error);
262
263 case VBLK:
264 if (uio->uio_resid == 0)
265 return (0);
266 if (uio->uio_offset < 0)
267 return (EINVAL);
268 bsize = BLKDEV_IOSIZE;
269 ssize = DEV_BSIZE;
270 if ((majordev = major(vp->v_rdev)) < nblkdev &&
271 (ioctl = bdevsw[majordev].d_ioctl) != NULL &&
272 (*ioctl)(vp->v_rdev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0) {
273 if (dpart.part->p_fstype == FS_BSDFFS &&
274 dpart.part->p_frag != 0 && dpart.part->p_fsize != 0)
275 bsize = dpart.part->p_frag *
276 dpart.part->p_fsize;
277 if (dpart.disklab->d_secsize != 0)
278 ssize = dpart.disklab->d_secsize;
279 }
280 bscale = bsize / ssize;
281 do {
282 bn = (uio->uio_offset / ssize) &~ (bscale - 1);
283 on = uio->uio_offset % bsize;
284 n = min((unsigned)(bsize - on), uio->uio_resid);
285 if (vp->v_lastr + bscale == bn) {
286 nextbn = bn + bscale;
287 error = breadn(vp, bn, (int)bsize, &nextbn,
288 (int *)&bsize, 1, NOCRED, &bp);
289 } else
290 error = bread(vp, bn, (int)bsize, NOCRED, &bp);
291 vp->v_lastr = bn;
292 n = min(n, bsize - bp->b_resid);
293 if (error) {
294 brelse(bp);
295 return (error);
296 }
297 error = uiomove((char *)bp->b_data + on, n, uio);
298 brelse(bp);
299 } while (error == 0 && uio->uio_resid > 0 && n != 0);
300 return (error);
301
302 default:
303 panic("spec_read type");
304 }
305 /* NOTREACHED */
306 }
307
308 /*
309 * Vnode op for write
310 */
311 /* ARGSUSED */
312 int
313 spec_write(v)
314 void *v;
315 {
316 struct vop_write_args /* {
317 struct vnode *a_vp;
318 struct uio *a_uio;
319 int a_ioflag;
320 struct ucred *a_cred;
321 } */ *ap = v;
322 register struct vnode *vp = ap->a_vp;
323 register struct uio *uio = ap->a_uio;
324 struct proc *p = uio->uio_procp;
325 struct buf *bp;
326 daddr_t bn;
327 long bsize, bscale, ssize;
328 struct partinfo dpart;
329 int n, on, majordev;
330 int (*ioctl) __P((dev_t, u_long, caddr_t, int, struct proc *));
331 int error = 0;
332
333 #ifdef DIAGNOSTIC
334 if (uio->uio_rw != UIO_WRITE)
335 panic("spec_write mode");
336 if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
337 panic("spec_write proc");
338 #endif
339
340 switch (vp->v_type) {
341
342 case VCHR:
343 VOP_UNLOCK(vp);
344 error = (*cdevsw[major(vp->v_rdev)].d_write)
345 (vp->v_rdev, uio, ap->a_ioflag);
346 VOP_LOCK(vp);
347 return (error);
348
349 case VBLK:
350 if (uio->uio_resid == 0)
351 return (0);
352 if (uio->uio_offset < 0)
353 return (EINVAL);
354 bsize = BLKDEV_IOSIZE;
355 ssize = DEV_BSIZE;
356 if ((majordev = major(vp->v_rdev)) < nblkdev &&
357 (ioctl = bdevsw[majordev].d_ioctl) != NULL &&
358 (*ioctl)(vp->v_rdev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0) {
359 if (dpart.part->p_fstype == FS_BSDFFS &&
360 dpart.part->p_frag != 0 && dpart.part->p_fsize != 0)
361 bsize = dpart.part->p_frag *
362 dpart.part->p_fsize;
363 if (dpart.disklab->d_secsize != 0)
364 ssize = dpart.disklab->d_secsize;
365 }
366 bscale = bsize / ssize;
367 do {
368 bn = (uio->uio_offset / ssize) &~ (bscale - 1);
369 on = uio->uio_offset % bsize;
370 n = min((unsigned)(bsize - on), uio->uio_resid);
371 if (n == bsize)
372 bp = getblk(vp, bn, bsize, 0, 0);
373 else
374 error = bread(vp, bn, bsize, NOCRED, &bp);
375 n = min(n, bsize - bp->b_resid);
376 if (error) {
377 brelse(bp);
378 return (error);
379 }
380 error = uiomove((char *)bp->b_data + on, n, uio);
381 if (n + on == bsize)
382 bawrite(bp);
383 else
384 bdwrite(bp);
385 } while (error == 0 && uio->uio_resid > 0 && n != 0);
386 return (error);
387
388 default:
389 panic("spec_write type");
390 }
391 /* NOTREACHED */
392 }
393
394 /*
395 * Device ioctl operation.
396 */
397 /* ARGSUSED */
398 int
399 spec_ioctl(v)
400 void *v;
401 {
402 struct vop_ioctl_args /* {
403 struct vnode *a_vp;
404 u_long a_command;
405 caddr_t a_data;
406 int a_fflag;
407 struct ucred *a_cred;
408 struct proc *a_p;
409 } */ *ap = v;
410 dev_t dev = ap->a_vp->v_rdev;
411 int maj = major(dev);
412
413 switch (ap->a_vp->v_type) {
414
415 case VCHR:
416 return ((*cdevsw[maj].d_ioctl)(dev, ap->a_command, ap->a_data,
417 ap->a_fflag, ap->a_p));
418
419 case VBLK:
420 if (ap->a_command == 0 && (long)ap->a_data == B_TAPE)
421 if (bdevsw[maj].d_type == D_TAPE)
422 return (0);
423 else
424 return (1);
425 return ((*bdevsw[maj].d_ioctl)(dev, ap->a_command, ap->a_data,
426 ap->a_fflag, ap->a_p));
427
428 default:
429 panic("spec_ioctl");
430 /* NOTREACHED */
431 }
432 }
433
434 /* ARGSUSED */
435 int
436 spec_select(v)
437 void *v;
438 {
439 struct vop_select_args /* {
440 struct vnode *a_vp;
441 int a_which;
442 int a_fflags;
443 struct ucred *a_cred;
444 struct proc *a_p;
445 } */ *ap = v;
446 register dev_t dev;
447
448 switch (ap->a_vp->v_type) {
449
450 default:
451 return (1); /* XXX */
452
453 case VCHR:
454 dev = ap->a_vp->v_rdev;
455 return (*cdevsw[major(dev)].d_select)(dev, ap->a_which, ap->a_p);
456 }
457 }
458 /*
459 * Synch buffers associated with a block device
460 */
461 /* ARGSUSED */
462 int
463 spec_fsync(v)
464 void *v;
465 {
466 struct vop_fsync_args /* {
467 struct vnode *a_vp;
468 struct ucred *a_cred;
469 int a_waitfor;
470 struct proc *a_p;
471 } */ *ap = v;
472 register struct vnode *vp = ap->a_vp;
473 register struct buf *bp;
474 struct buf *nbp;
475 int s;
476
477 if (vp->v_type == VCHR)
478 return (0);
479 /*
480 * Flush all dirty buffers associated with a block device.
481 */
482 loop:
483 s = splbio();
484 for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
485 nbp = bp->b_vnbufs.le_next;
486 if ((bp->b_flags & B_BUSY))
487 continue;
488 if ((bp->b_flags & B_DELWRI) == 0)
489 panic("spec_fsync: not dirty");
490 bremfree(bp);
491 bp->b_flags |= B_BUSY;
492 splx(s);
493 bawrite(bp);
494 goto loop;
495 }
496 if (ap->a_waitfor == MNT_WAIT) {
497 while (vp->v_numoutput) {
498 vp->v_flag |= VBWAIT;
499 sleep((caddr_t)&vp->v_numoutput, PRIBIO + 1);
500 }
501 #ifdef DIAGNOSTIC
502 if (vp->v_dirtyblkhd.lh_first) {
503 splx(s);
504 vprint("spec_fsync: dirty", vp);
505 goto loop;
506 }
507 #endif
508 }
509 splx(s);
510 return (0);
511 }
512
513 /*
514 * Just call the device strategy routine
515 */
516 int
517 spec_strategy(v)
518 void *v;
519 {
520 struct vop_strategy_args /* {
521 struct buf *a_bp;
522 } */ *ap = v;
523
524 (*bdevsw[major(ap->a_bp->b_dev)].d_strategy)(ap->a_bp);
525 return (0);
526 }
527
528 /*
529 * This is a noop, simply returning what one has been given.
530 */
531 int
532 spec_bmap(v)
533 void *v;
534 {
535 struct vop_bmap_args /* {
536 struct vnode *a_vp;
537 daddr_t a_bn;
538 struct vnode **a_vpp;
539 daddr_t *a_bnp;
540 } */ *ap = v;
541
542 if (ap->a_vpp != NULL)
543 *ap->a_vpp = ap->a_vp;
544 if (ap->a_bnp != NULL)
545 *ap->a_bnp = ap->a_bn;
546 return (0);
547 }
548
549 /*
550 * At the moment we do not do any locking.
551 */
552 /* ARGSUSED */
553 int
554 spec_lock(v)
555 void *v;
556 {
557
558 return (0);
559 }
560
561 /* ARGSUSED */
562 int
563 spec_unlock(v)
564 void *v;
565 {
566
567 return (0);
568 }
569
570 /*
571 * Device close routine
572 */
573 /* ARGSUSED */
574 int
575 spec_close(v)
576 void *v;
577 {
578 struct vop_close_args /* {
579 struct vnode *a_vp;
580 int a_fflag;
581 struct ucred *a_cred;
582 struct proc *a_p;
583 } */ *ap = v;
584 register struct vnode *vp = ap->a_vp;
585 dev_t dev = vp->v_rdev;
586 int (*devclose) __P((dev_t, int, int, struct proc *));
587 int mode, error;
588
589 switch (vp->v_type) {
590
591 case VCHR:
592 /*
593 * Hack: a tty device that is a controlling terminal
594 * has a reference from the session structure.
595 * We cannot easily tell that a character device is
596 * a controlling terminal, unless it is the closing
597 * process' controlling terminal. In that case,
598 * if the reference count is 2 (this last descriptor
599 * plus the session), release the reference from the session.
600 */
601 if (vcount(vp) == 2 && ap->a_p &&
602 vp == ap->a_p->p_session->s_ttyvp) {
603 vrele(vp);
604 ap->a_p->p_session->s_ttyvp = NULL;
605 }
606 /*
607 * If the vnode is locked, then we are in the midst
608 * of forcably closing the device, otherwise we only
609 * close on last reference.
610 */
611 if (vcount(vp) > 1 && (vp->v_flag & VXLOCK) == 0)
612 return (0);
613 devclose = cdevsw[major(dev)].d_close;
614 mode = S_IFCHR;
615 break;
616
617 case VBLK:
618 /*
619 * On last close of a block device (that isn't mounted)
620 * we must invalidate any in core blocks, so that
621 * we can, for instance, change floppy disks.
622 */
623 error = vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 0, 0);
624 if (error)
625 return (error);
626 /*
627 * We do not want to really close the device if it
628 * is still in use unless we are trying to close it
629 * forcibly. Since every use (buffer, vnode, swap, cmap)
630 * holds a reference to the vnode, and because we mark
631 * any other vnodes that alias this device, when the
632 * sum of the reference counts on all the aliased
633 * vnodes descends to one, we are on last close.
634 */
635 if (vcount(vp) > 1 && (vp->v_flag & VXLOCK) == 0)
636 return (0);
637 devclose = bdevsw[major(dev)].d_close;
638 mode = S_IFBLK;
639 break;
640
641 default:
642 panic("spec_close: not special");
643 }
644
645 return ((*devclose)(dev, ap->a_fflag, mode, ap->a_p));
646 }
647
648 /*
649 * Print out the contents of a special device vnode.
650 */
651 int
652 spec_print(v)
653 void *v;
654 {
655 struct vop_print_args /* {
656 struct vnode *a_vp;
657 } */ *ap = v;
658
659 printf("tag VT_NON, dev %d, %d\n", major(ap->a_vp->v_rdev),
660 minor(ap->a_vp->v_rdev));
661 return 0;
662 }
663
664 /*
665 * Return POSIX pathconf information applicable to special devices.
666 */
667 int
668 spec_pathconf(v)
669 void *v;
670 {
671 struct vop_pathconf_args /* {
672 struct vnode *a_vp;
673 int a_name;
674 register_t *a_retval;
675 } */ *ap = v;
676
677 switch (ap->a_name) {
678 case _PC_LINK_MAX:
679 *ap->a_retval = LINK_MAX;
680 return (0);
681 case _PC_MAX_CANON:
682 *ap->a_retval = MAX_CANON;
683 return (0);
684 case _PC_MAX_INPUT:
685 *ap->a_retval = MAX_INPUT;
686 return (0);
687 case _PC_PIPE_BUF:
688 *ap->a_retval = PIPE_BUF;
689 return (0);
690 case _PC_CHOWN_RESTRICTED:
691 *ap->a_retval = 1;
692 return (0);
693 case _PC_VDISABLE:
694 *ap->a_retval = _POSIX_VDISABLE;
695 return (0);
696 default:
697 return (EINVAL);
698 }
699 /* NOTREACHED */
700 }
701
702 /*
703 * Special device advisory byte-level locks.
704 */
705 /* ARGSUSED */
706 int
707 spec_advlock(v)
708 void *v;
709 {
710
711 return (EOPNOTSUPP);
712 }
713
714 /*
715 * Special device failed operation
716 */
717 /*ARGSUSED*/
718 int
719 spec_ebadf(v)
720 void *v;
721 {
722
723 return (EBADF);
724 }
725
726 /*
727 * Special device bad operation
728 */
729 /*ARGSUSED*/
730 int
731 spec_badop(v)
732 void *v;
733 {
734
735 panic("spec_badop called");
736 /* NOTREACHED */
737 }
738