vfs_syscalls.c (89306) | vfs_syscalls.c (89319) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 |
39 * $FreeBSD: head/sys/kern/vfs_syscalls.c 89306 2002-01-13 11:58:06Z alfred $ | 39 * $FreeBSD: head/sys/kern/vfs_syscalls.c 89319 2002-01-14 00:13:45Z alfred $ |
40 */ 41 42/* For 4.3 integer FS ID compatibility */ 43#include "opt_compat.h" 44#include "opt_ffs.h" 45 46#include <sys/param.h> 47#include <sys/systm.h> --- 1651 unchanged lines hidden (view full) --- 1699 register struct lseek_args /* { 1700 syscallarg(int) fd; 1701 syscallarg(int) pad; 1702 syscallarg(off_t) offset; 1703 syscallarg(int) whence; 1704 } */ *uap; 1705{ 1706 struct ucred *cred = td->td_proc->p_ucred; | 40 */ 41 42/* For 4.3 integer FS ID compatibility */ 43#include "opt_compat.h" 44#include "opt_ffs.h" 45 46#include <sys/param.h> 47#include <sys/systm.h> --- 1651 unchanged lines hidden (view full) --- 1699 register struct lseek_args /* { 1700 syscallarg(int) fd; 1701 syscallarg(int) pad; 1702 syscallarg(off_t) offset; 1703 syscallarg(int) whence; 1704 } */ *uap; 1705{ 1706 struct ucred *cred = td->td_proc->p_ucred; |
1707 register struct file *fp; | 1707 struct file *fp; |
1708 struct vnode *vp; 1709 struct vattr vattr; 1710 off_t offset; 1711 int error, noneg; 1712 | 1708 struct vnode *vp; 1709 struct vattr vattr; 1710 off_t offset; 1711 int error, noneg; 1712 |
1713 fp = ffind_hold(td, uap->fd); 1714 if (fp == NULL) 1715 return (EBADF); | 1713 if ((error = fget(td, uap->fd, &fp)) != 0) 1714 return (error); |
1716 if (fp->f_type != DTYPE_VNODE) { 1717 fdrop(fp, td); 1718 return (ESPIPE); 1719 } 1720 vp = (struct vnode *)fp->f_data; 1721 noneg = (vp->v_type != VCHR); 1722 offset = SCARG(uap, offset); 1723 switch (SCARG(uap, whence)) { --- 2581 unchanged lines hidden --- | 1715 if (fp->f_type != DTYPE_VNODE) { 1716 fdrop(fp, td); 1717 return (ESPIPE); 1718 } 1719 vp = (struct vnode *)fp->f_data; 1720 noneg = (vp->v_type != VCHR); 1721 offset = SCARG(uap, offset); 1722 switch (SCARG(uap, whence)) { --- 2581 unchanged lines hidden --- |