Deleted Added
full compact
fdesc_vnops.c (33181) fdesc_vnops.c (36840)
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 21 unchanged lines hidden (view full) ---

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
37 *
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 21 unchanged lines hidden (view full) ---

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
37 *
38 * $Id: fdesc_vnops.c,v 1.33 1997/10/27 13:33:38 bde Exp $
38 * $Id: fdesc_vnops.c,v 1.34 1998/02/09 06:09:42 eivind Exp $
39 */
40
41/*
42 * /dev/fd Filesystem
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

--- 460 unchanged lines hidden (view full) ---

507 /*
508 * Can't mess with the root vnode
509 */
510 switch (VTOFDESC(ap->a_vp)->fd_type) {
511 case Fdesc:
512 break;
513
514 case Fctty:
39 */
40
41/*
42 * /dev/fd Filesystem
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

--- 460 unchanged lines hidden (view full) ---

507 /*
508 * Can't mess with the root vnode
509 */
510 switch (VTOFDESC(ap->a_vp)->fd_type) {
511 case Fdesc:
512 break;
513
514 case Fctty:
515 if (vap->va_flags != VNOVAL)
516 return (EOPNOTSUPP);
515 return (0);
516
517 default:
518 return (EACCES);
519 }
520
521 fd = VTOFDESC(ap->a_vp)->fd_fd;
522 if (fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) {
523 return (EBADF);
524 }
525
526 /*
527 * Can setattr the underlying vnode, but not sockets!
528 */
529 switch (fp->f_type) {
530 case DTYPE_FIFO:
517 return (0);
518
519 default:
520 return (EACCES);
521 }
522
523 fd = VTOFDESC(ap->a_vp)->fd_fd;
524 if (fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) {
525 return (EBADF);
526 }
527
528 /*
529 * Can setattr the underlying vnode, but not sockets!
530 */
531 switch (fp->f_type) {
532 case DTYPE_FIFO:
533 case DTYPE_PIPE:
531 case DTYPE_VNODE:
532 error = VOP_SETATTR((struct vnode *) fp->f_data, ap->a_vap, ap->a_cred, ap->a_p);
533 break;
534
535 case DTYPE_SOCKET:
534 case DTYPE_VNODE:
535 error = VOP_SETATTR((struct vnode *) fp->f_data, ap->a_vap, ap->a_cred, ap->a_p);
536 break;
537
538 case DTYPE_SOCKET:
536 error = 0;
539 if (vap->va_flags != VNOVAL)
540 error = ENOPNOTSUPP;
541 else
542 error = 0;
537 break;
538
539 default:
540 error = EBADF;
541 break;
542 }
543
544 return (error);

--- 336 unchanged lines hidden ---
543 break;
544
545 default:
546 error = EBADF;
547 break;
548 }
549
550 return (error);

--- 336 unchanged lines hidden ---