diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:53:44 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:53:44 +0000 |
commit | 90a020136c624f2d26b04b43b131e0dd2a8a7c95 (patch) | |
tree | 22db9f27f6798618ae0db01e446057b2b987756f /sys/miscfs/fifofs | |
parent | 50cfedd2bbd1eee2cfdff477ecce0e6d0393ba5d (diff) |
From NetBSD: update to 960217 sources
Diffstat (limited to 'sys/miscfs/fifofs')
-rw-r--r-- | sys/miscfs/fifofs/fifo.h | 99 | ||||
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 133 |
2 files changed, 129 insertions, 103 deletions
diff --git a/sys/miscfs/fifofs/fifo.h b/sys/miscfs/fifofs/fifo.h index 9b7ca197b39..cdfd83fdc3c 100644 --- a/sys/miscfs/fifofs/fifo.h +++ b/sys/miscfs/fifofs/fifo.h @@ -1,4 +1,5 @@ -/* $NetBSD: fifo.h,v 1.9 1994/12/13 20:14:38 mycroft Exp $ */ +/* $OpenBSD: fifo.h,v 1.2 1996/02/27 07:53:42 niklas Exp $ */ +/* $NetBSD: fifo.h,v 1.10 1996/02/09 22:40:15 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -34,55 +35,59 @@ * * @(#)fifo.h 8.3 (Berkeley) 8/10/94 */ - #ifdef FIFO + /* * Prototypes for fifo operations on vnodes. */ -int fifo_badop(), - fifo_ebadf(); +int fifo_badop __P((void *)); +int fifo_ebadf __P((void *)); + +int fifo_lookup __P((void *)); +#define fifo_create fifo_badop +#define fifo_mknod fifo_badop +int fifo_open __P((void *)); +int fifo_close __P((void *)); +#define fifo_access fifo_ebadf +#define fifo_getattr fifo_ebadf +#define fifo_setattr fifo_ebadf +int fifo_read __P((void *)); +int fifo_write __P((void *)); +#define fifo_lease_check nullop +int fifo_ioctl __P((void *)); +int fifo_select __P((void *)); +#define fifo_mmap fifo_badop +#define fifo_fsync nullop +#define fifo_seek fifo_badop +#define fifo_remove fifo_badop +#define fifo_link fifo_badop +#define fifo_rename fifo_badop +#define fifo_mkdir fifo_badop +#define fifo_rmdir fifo_badop +#define fifo_symlink fifo_badop +#define fifo_readdir fifo_badop +#define fifo_readlink fifo_badop +#define fifo_abortop fifo_badop +#define fifo_inactive nullop +#define fifo_reclaim nullop +int fifo_lock __P((void *)); +int fifo_unlock __P((void *)); +int fifo_bmap __P((void *)); +#define fifo_strategy fifo_badop +int fifo_print __P((void *)); +#define fifo_islocked nullop +int fifo_pathconf __P((void *)); +int fifo_advlock __P((void *)); +#define fifo_blkatoff fifo_badop +#define fifo_valloc fifo_badop +#define fifo_reallocblks fifo_badop +#define fifo_vfree fifo_badop +#define fifo_truncate nullop +#define fifo_update nullop +#define fifo_bwrite nullop + +void fifo_printinfo __P((struct vnode *)); + +extern int (**fifo_vnodeop_p) __P((void *)); -int fifo_lookup __P((struct vop_lookup_args *)); -#define fifo_create ((int (*) __P((struct vop_create_args *)))fifo_badop) -#define fifo_mknod ((int (*) __P((struct vop_mknod_args *)))fifo_badop) -int fifo_open __P((struct vop_open_args *)); -int fifo_close __P((struct vop_close_args *)); -#define fifo_access ((int (*) __P((struct vop_access_args *)))fifo_ebadf) -#define fifo_getattr ((int (*) __P((struct vop_getattr_args *)))fifo_ebadf) -#define fifo_setattr ((int (*) __P((struct vop_setattr_args *)))fifo_ebadf) -int fifo_read __P((struct vop_read_args *)); -int fifo_write __P((struct vop_write_args *)); -#define fifo_lease_check ((int (*) __P((struct vop_lease_args *)))nullop) -int fifo_ioctl __P((struct vop_ioctl_args *)); -int fifo_select __P((struct vop_select_args *)); -#define fifo_mmap ((int (*) __P((struct vop_mmap_args *)))fifo_badop) -#define fifo_fsync ((int (*) __P((struct vop_fsync_args *)))nullop) -#define fifo_seek ((int (*) __P((struct vop_seek_args *)))fifo_badop) -#define fifo_remove ((int (*) __P((struct vop_remove_args *)))fifo_badop) -#define fifo_link ((int (*) __P((struct vop_link_args *)))fifo_badop) -#define fifo_rename ((int (*) __P((struct vop_rename_args *)))fifo_badop) -#define fifo_mkdir ((int (*) __P((struct vop_mkdir_args *)))fifo_badop) -#define fifo_rmdir ((int (*) __P((struct vop_rmdir_args *)))fifo_badop) -#define fifo_symlink ((int (*) __P((struct vop_symlink_args *)))fifo_badop) -#define fifo_readdir ((int (*) __P((struct vop_readdir_args *)))fifo_badop) -#define fifo_readlink ((int (*) __P((struct vop_readlink_args *)))fifo_badop) -#define fifo_abortop ((int (*) __P((struct vop_abortop_args *)))fifo_badop) -#define fifo_inactive ((int (*) __P((struct vop_inactive_args *)))nullop) -#define fifo_reclaim ((int (*) __P((struct vop_reclaim_args *)))nullop) -int fifo_lock __P((struct vop_lock_args *)); -int fifo_unlock __P((struct vop_unlock_args *)); -int fifo_bmap __P((struct vop_bmap_args *)); -#define fifo_strategy ((int (*) __P((struct vop_strategy_args *)))fifo_badop) -int fifo_print __P((struct vop_print_args *)); -#define fifo_islocked ((int (*) __P((struct vop_islocked_args *)))nullop) -int fifo_pathconf __P((struct vop_pathconf_args *)); -int fifo_advlock __P((struct vop_advlock_args *)); -#define fifo_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))fifo_badop) -#define fifo_valloc ((int (*) __P((struct vop_valloc_args *)))fifo_badop) -#define fifo_reallocblks \ - ((int (*) __P((struct vop_reallocblks_args *)))fifo_badop) -#define fifo_vfree ((int (*) __P((struct vop_vfree_args *)))fifo_badop) -#define fifo_truncate ((int (*) __P((struct vop_truncate_args *)))nullop) -#define fifo_update ((int (*) __P((struct vop_update_args *)))nullop) -#define fifo_bwrite ((int (*) __P((struct vop_bwrite_args *)))nullop) #endif /* FIFO */ diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 9d7193d92a9..751380c1f89 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,5 @@ -/* $NetBSD: fifo_vnops.c,v 1.16 1995/04/14 23:30:14 mycroft Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.2 1996/02/27 07:53:43 niklas Exp $ */ +/* $NetBSD: fifo_vnops.c,v 1.17 1996/02/09 22:40:16 christos Exp $ */ /* * Copyright (c) 1990, 1993 @@ -48,6 +49,7 @@ #include <sys/file.h> #include <sys/errno.h> #include <sys/malloc.h> +#include <sys/un.h> #include <miscfs/fifofs/fifo.h> /* @@ -61,7 +63,7 @@ struct fifoinfo { long fi_writers; }; -int (**fifo_vnodeop_p)(); +int (**fifo_vnodeop_p) __P((void *)); struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, fifo_lookup }, /* lookup */ @@ -105,7 +107,7 @@ struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_truncate_desc, fifo_truncate }, /* truncate */ { &vop_update_desc, fifo_update }, /* update */ { &vop_bwrite_desc, fifo_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc fifo_vnodeop_opv_desc = { &fifo_vnodeop_p, fifo_vnodeop_entries }; @@ -114,13 +116,15 @@ struct vnodeopv_desc fifo_vnodeop_opv_desc = * Trivial lookup routine that always fails. */ /* ARGSUSED */ -fifo_lookup(ap) +int +fifo_lookup(v) + void *v; +{ struct vop_lookup_args /* { struct vnode * a_dvp; struct vnode ** a_vpp; struct componentname * a_cnp; - } */ *ap; -{ + } */ *ap = v; *ap->a_vpp = NULL; return (ENOTDIR); @@ -131,14 +135,16 @@ fifo_lookup(ap) * to find an active instance of a fifo. */ /* ARGSUSED */ -fifo_open(ap) +int +fifo_open(v) + void *v; +{ struct vop_open_args /* { struct vnode *a_vp; int a_mode; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct fifoinfo *fip; struct socket *rso, *wso; @@ -148,20 +154,20 @@ fifo_open(ap) if ((fip = vp->v_fifoinfo) == NULL) { MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK); vp->v_fifoinfo = fip; - if (error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0)) { + if ((error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0)) != 0) { free(fip, M_VNODE); vp->v_fifoinfo = NULL; return (error); } fip->fi_readsock = rso; - if (error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0)) { + if ((error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0)) != 0) { (void)soclose(rso); free(fip, M_VNODE); vp->v_fifoinfo = NULL; return (error); } fip->fi_writesock = wso; - if (error = unp_connect2(wso, rso)) { + if ((error = unp_connect2(wso, rso)) != 0) { (void)soclose(wso); (void)soclose(rso); free(fip, M_VNODE); @@ -226,14 +232,16 @@ bad: * Vnode op for read */ /* ARGSUSED */ -fifo_read(ap) +int +fifo_read(v) + void *v; +{ struct vop_read_args /* { struct vnode *a_vp; struct uio *a_uio; int a_ioflag; struct ucred *a_cred; - } */ *ap; -{ + } */ *ap = v; register struct uio *uio = ap->a_uio; register struct socket *rso = ap->a_vp->v_fifoinfo->fi_readsock; int error, startresid; @@ -265,14 +273,16 @@ fifo_read(ap) * Vnode op for write */ /* ARGSUSED */ -fifo_write(ap) +int +fifo_write(v) + void *v; +{ struct vop_write_args /* { struct vnode *a_vp; struct uio *a_uio; int a_ioflag; struct ucred *a_cred; - } */ *ap; -{ + } */ *ap = v; struct socket *wso = ap->a_vp->v_fifoinfo->fi_writesock; int error; @@ -294,7 +304,10 @@ fifo_write(ap) * Device ioctl operation. */ /* ARGSUSED */ -fifo_ioctl(ap) +int +fifo_ioctl(v) + void *v; +{ struct vop_ioctl_args /* { struct vnode *a_vp; u_long a_command; @@ -302,8 +315,7 @@ fifo_ioctl(ap) int a_fflag; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; struct file filetmp; int error; @@ -325,15 +337,17 @@ fifo_ioctl(ap) } /* ARGSUSED */ -fifo_select(ap) +int +fifo_select(v) + void *v; +{ struct vop_select_args /* { struct vnode *a_vp; int a_which; int a_fflags; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; struct file filetmp; int ready; @@ -355,14 +369,16 @@ fifo_select(ap) /* * This is a noop, simply returning what one has been given. */ -fifo_bmap(ap) +int +fifo_bmap(v) + void *v; +{ struct vop_bmap_args /* { struct vnode *a_vp; daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; - } */ *ap; -{ + } */ *ap = v; if (ap->a_vpp != NULL) *ap->a_vpp = ap->a_vp; @@ -375,20 +391,17 @@ fifo_bmap(ap) * At the moment we do not do any locking. */ /* ARGSUSED */ -fifo_lock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - } */ *ap; +int +fifo_lock(v) + void *v; { - return (0); } /* ARGSUSED */ -fifo_unlock(ap) - struct vop_unlock_args /* { - struct vnode *a_vp; - } */ *ap; +int +fifo_unlock(v) + void *v; { return (0); @@ -398,14 +411,16 @@ fifo_unlock(ap) * Device close routine */ /* ARGSUSED */ -fifo_close(ap) +int +fifo_close(v) + void *v; +{ struct vop_close_args /* { struct vnode *a_vp; int a_fflag; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct fifoinfo *fip = vp->v_fifoinfo; int error1, error2; @@ -432,20 +447,24 @@ fifo_close(ap) /* * Print out the contents of a fifo vnode. */ -fifo_print(ap) +int +fifo_print(v) + void *v; +{ struct vop_print_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; printf("tag VT_NON"); fifo_printinfo(ap->a_vp); printf("\n"); + return 0; } /* * Print out internal contents of a fifo vnode. */ +void fifo_printinfo(vp) struct vnode *vp; { @@ -458,13 +477,15 @@ fifo_printinfo(vp) /* * Return POSIX pathconf information applicable to fifo's. */ -fifo_pathconf(ap) +int +fifo_pathconf(v) + void *v; +{ struct vop_pathconf_args /* { struct vnode *a_vp; int a_name; register_t *a_retval; - } */ *ap; -{ + } */ *ap = v; switch (ap->a_name) { case _PC_LINK_MAX: @@ -485,7 +506,10 @@ fifo_pathconf(ap) /* * Fifo failed operation */ -fifo_ebadf() +/*ARGSUSED*/ +int +fifo_ebadf(v) + void *v; { return (EBADF); @@ -495,23 +519,20 @@ fifo_ebadf() * Fifo advisory byte-level locks. */ /* ARGSUSED */ -fifo_advlock(ap) - struct vop_advlock_args /* { - struct vnode *a_vp; - caddr_t a_id; - int a_op; - struct flock *a_fl; - int a_flags; - } */ *ap; +int +fifo_advlock(v) + void *v; { - return (EOPNOTSUPP); } /* * Fifo bad operation */ -fifo_badop() +/*ARGSUSED*/ +int +fifo_badop(v) + void *v; { panic("fifo_badop called"); |