From a3aa7f922e3ae05899d6314b9fb7afd40eb29b47 Mon Sep 17 00:00:00 2001 From: Bill Joy Date: Tue, 28 Apr 1981 09:59:24 -0800 Subject: [PATCH] fstat for ports now in pipe.c SCCS-vsn: sys/kern/vfs_syscalls.c 4.10 SCCS-vsn: sys/ufs/ffs/ffs_vnops.c 4.10 SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 4.10 SCCS-vsn: sys/ufs/lfs/lfs_vnops.c 4.10 SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 4.10 --- usr/src/sys/kern/vfs_syscalls.c | 15 +++++++++------ usr/src/sys/ufs/ffs/ffs_vnops.c | 15 +++++++++------ usr/src/sys/ufs/ffs/ufs_vnops.c | 15 +++++++++------ usr/src/sys/ufs/lfs/lfs_vnops.c | 15 +++++++++------ usr/src/sys/ufs/ufs/ufs_vnops.c | 15 +++++++++------ 5 files changed, 45 insertions(+), 30 deletions(-) diff --git a/usr/src/sys/kern/vfs_syscalls.c b/usr/src/sys/kern/vfs_syscalls.c index 72470b8eb5..0048c8bcc0 100644 --- a/usr/src/sys/kern/vfs_syscalls.c +++ b/usr/src/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* vfs_syscalls.c 4.9 81/03/09 */ +/* vfs_syscalls.c 4.10 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" @@ -30,7 +30,11 @@ fstat() fp = getf(uap->fdes); if(fp == NULL) return; - stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0); + if (fp->f_flag&FPORT) { + ptstat(fp); + return; + } + stat1(fp->f_inode, uap->sb); } /* @@ -48,7 +52,7 @@ stat() ip = namei(uchar, 0); if(ip == NULL) return; - stat1(ip, uap->sb, (off_t)0); + stat1(ip, uap->sb); iput(ip); } @@ -56,10 +60,9 @@ stat() * The basic routine for fstat and stat: * get the inode and pass appropriate parts back. */ -stat1(ip, ub, pipeadj) +stat1(ip, ub) register struct inode *ip; struct stat *ub; -off_t pipeadj; { register struct dinode *dp; register struct buf *bp; @@ -76,7 +79,7 @@ off_t pipeadj; ds.st_uid = ip->i_uid; ds.st_gid = ip->i_gid; ds.st_rdev = (dev_t)ip->i_un.i_rdev; - ds.st_size = ip->i_size - pipeadj; + ds.st_size = ip->i_size; /* * next the dates in the disk */ diff --git a/usr/src/sys/ufs/ffs/ffs_vnops.c b/usr/src/sys/ufs/ffs/ffs_vnops.c index beccb4c59b..bd99d7fe40 100644 --- a/usr/src/sys/ufs/ffs/ffs_vnops.c +++ b/usr/src/sys/ufs/ffs/ffs_vnops.c @@ -1,4 +1,4 @@ -/* ffs_vnops.c 4.9 81/03/09 */ +/* ffs_vnops.c 4.10 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" @@ -30,7 +30,11 @@ fstat() fp = getf(uap->fdes); if(fp == NULL) return; - stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0); + if (fp->f_flag&FPORT) { + ptstat(fp); + return; + } + stat1(fp->f_inode, uap->sb); } /* @@ -48,7 +52,7 @@ stat() ip = namei(uchar, 0); if(ip == NULL) return; - stat1(ip, uap->sb, (off_t)0); + stat1(ip, uap->sb); iput(ip); } @@ -56,10 +60,9 @@ stat() * The basic routine for fstat and stat: * get the inode and pass appropriate parts back. */ -stat1(ip, ub, pipeadj) +stat1(ip, ub) register struct inode *ip; struct stat *ub; -off_t pipeadj; { register struct dinode *dp; register struct buf *bp; @@ -76,7 +79,7 @@ off_t pipeadj; ds.st_uid = ip->i_uid; ds.st_gid = ip->i_gid; ds.st_rdev = (dev_t)ip->i_un.i_rdev; - ds.st_size = ip->i_size - pipeadj; + ds.st_size = ip->i_size; /* * next the dates in the disk */ diff --git a/usr/src/sys/ufs/ffs/ufs_vnops.c b/usr/src/sys/ufs/ffs/ufs_vnops.c index 69bdd85d80..d930a820f6 100644 --- a/usr/src/sys/ufs/ffs/ufs_vnops.c +++ b/usr/src/sys/ufs/ffs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* ufs_vnops.c 4.9 81/03/09 */ +/* ufs_vnops.c 4.10 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" @@ -30,7 +30,11 @@ fstat() fp = getf(uap->fdes); if(fp == NULL) return; - stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0); + if (fp->f_flag&FPORT) { + ptstat(fp); + return; + } + stat1(fp->f_inode, uap->sb); } /* @@ -48,7 +52,7 @@ stat() ip = namei(uchar, 0); if(ip == NULL) return; - stat1(ip, uap->sb, (off_t)0); + stat1(ip, uap->sb); iput(ip); } @@ -56,10 +60,9 @@ stat() * The basic routine for fstat and stat: * get the inode and pass appropriate parts back. */ -stat1(ip, ub, pipeadj) +stat1(ip, ub) register struct inode *ip; struct stat *ub; -off_t pipeadj; { register struct dinode *dp; register struct buf *bp; @@ -76,7 +79,7 @@ off_t pipeadj; ds.st_uid = ip->i_uid; ds.st_gid = ip->i_gid; ds.st_rdev = (dev_t)ip->i_un.i_rdev; - ds.st_size = ip->i_size - pipeadj; + ds.st_size = ip->i_size; /* * next the dates in the disk */ diff --git a/usr/src/sys/ufs/lfs/lfs_vnops.c b/usr/src/sys/ufs/lfs/lfs_vnops.c index 529fc0e7cf..bd1fc0cf16 100644 --- a/usr/src/sys/ufs/lfs/lfs_vnops.c +++ b/usr/src/sys/ufs/lfs/lfs_vnops.c @@ -1,4 +1,4 @@ -/* lfs_vnops.c 4.9 81/03/09 */ +/* lfs_vnops.c 4.10 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" @@ -30,7 +30,11 @@ fstat() fp = getf(uap->fdes); if(fp == NULL) return; - stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0); + if (fp->f_flag&FPORT) { + ptstat(fp); + return; + } + stat1(fp->f_inode, uap->sb); } /* @@ -48,7 +52,7 @@ stat() ip = namei(uchar, 0); if(ip == NULL) return; - stat1(ip, uap->sb, (off_t)0); + stat1(ip, uap->sb); iput(ip); } @@ -56,10 +60,9 @@ stat() * The basic routine for fstat and stat: * get the inode and pass appropriate parts back. */ -stat1(ip, ub, pipeadj) +stat1(ip, ub) register struct inode *ip; struct stat *ub; -off_t pipeadj; { register struct dinode *dp; register struct buf *bp; @@ -76,7 +79,7 @@ off_t pipeadj; ds.st_uid = ip->i_uid; ds.st_gid = ip->i_gid; ds.st_rdev = (dev_t)ip->i_un.i_rdev; - ds.st_size = ip->i_size - pipeadj; + ds.st_size = ip->i_size; /* * next the dates in the disk */ diff --git a/usr/src/sys/ufs/ufs/ufs_vnops.c b/usr/src/sys/ufs/ufs/ufs_vnops.c index 69bdd85d80..d930a820f6 100644 --- a/usr/src/sys/ufs/ufs/ufs_vnops.c +++ b/usr/src/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* ufs_vnops.c 4.9 81/03/09 */ +/* ufs_vnops.c 4.10 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" @@ -30,7 +30,11 @@ fstat() fp = getf(uap->fdes); if(fp == NULL) return; - stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0); + if (fp->f_flag&FPORT) { + ptstat(fp); + return; + } + stat1(fp->f_inode, uap->sb); } /* @@ -48,7 +52,7 @@ stat() ip = namei(uchar, 0); if(ip == NULL) return; - stat1(ip, uap->sb, (off_t)0); + stat1(ip, uap->sb); iput(ip); } @@ -56,10 +60,9 @@ stat() * The basic routine for fstat and stat: * get the inode and pass appropriate parts back. */ -stat1(ip, ub, pipeadj) +stat1(ip, ub) register struct inode *ip; struct stat *ub; -off_t pipeadj; { register struct dinode *dp; register struct buf *bp; @@ -76,7 +79,7 @@ off_t pipeadj; ds.st_uid = ip->i_uid; ds.st_gid = ip->i_gid; ds.st_rdev = (dev_t)ip->i_un.i_rdev; - ds.st_size = ip->i_size - pipeadj; + ds.st_size = ip->i_size; /* * next the dates in the disk */ -- 2.20.1