-/* ufs_vnops.c 4.6 %G% */
+/* ufs_vnops.c 4.11 81/08/12 */
#include "../h/param.h"
#include "../h/systm.h"
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;
+ }
+#ifdef BBNNET
+ if (fp->f_flag&FNET) {
+ u.u_error = EINVAL;
+ return;
+ }
+#endif
+ stat1(fp->f_inode, uap->sb);
}
/*
ip = namei(uchar, 0);
if(ip == NULL)
return;
- stat1(ip, uap->sb, (off_t)0);
+ stat1(ip, uap->sb);
iput(ip);
}
* 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;
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
*/
/*
* the mount system call.
*/
-smount()
-{
+smount() {
dev_t dev;
register struct inode *ip;
register struct mount *mp;
char *freg;
int ronly;
} *uap;
+ register char *cp;
uap = (struct a *)u.u_ap;
dev = getmdev();
fp->s_ronly = uap->ronly & 1;
fp->s_nbehind = 0;
fp->s_lasti = 1;
+ u.u_dirp = uap->freg;
+ for (cp = fp->s_fsmnt; cp < &fp->s_fsmnt[sizeof (fp->s_fsmnt) - 1]; )
+ if ((*cp++ = uchar()) == 0)
+ u.u_dirp--; /* get 0 again */
+ *cp = 0;
brelse(bp);
ip->i_flag |= IMOUNT;
prele(ip);
found:
stillopen = 0;
- for(ip = &inode[0]; ip < &inode[NINODE]; ip++)
+ for(ip = inode; ip < inodeNINODE; ip++)
if (ip->i_number != 0 && dev == ip->i_dev) {
u.u_error = EBUSY;
return;