STATUS: 99%

0000 T _fstat		compatible
    0044 T _stat		compatible
    0086 T _stat1		compatible
    0172 T _dup			compatible
    022e T _fcntl		compatible
    02fc T _smount		99% compatible
    04bc T _sumount		compatible
    05be T _getmdev		compatible
    062a T _ioctl		compatible
    06c2 T _stty		compatible
    06e2 T _gtty		compatible
    0702 T _mdmctl		compatible
This commit is contained in:
Oliver Lehmann 2008-05-24 15:00:04 +00:00
parent 114fa234f7
commit 190327c27a
1 changed files with 37 additions and 35 deletions

View File

@ -228,7 +228,7 @@ smount()
return; return;
if (ip->i_count != 1) if (ip->i_count != 1)
goto out; goto out;
if (ip->i_mode&2000) if ((ip->i_mode&0x2000) != 0)
goto out; goto out;
smp = NULL; smp = NULL;
for(mp = &mount[0]; mp < &mount[Nmount]; mp++) { for(mp = &mount[0]; mp < &mount[Nmount]; mp++) {
@ -244,7 +244,7 @@ smount()
goto out; goto out;
(*bdevsw[major(dev)].d_open)(dev, !uap->ronly); (*bdevsw[major(dev)].d_open)(dev, !uap->ronly);
if(u.u_error) if(u.u_error)
goto out1; goto out;
bp = bread(dev, SUPERB); bp = bread(dev, SUPERB);
if(u.u_error) { if(u.u_error) {
brelse(bp); brelse(bp);
@ -263,15 +263,13 @@ smount()
ip->i_flag |= IMOUNT; ip->i_flag |= IMOUNT;
prele(ip); prele(ip);
return; return;
out1:
mp->m_flags = MFREE;
out: out:
if (u.u_error == 0) u.u_error = EBUSY;
u.u_error = EBUSY; out1:
iput(ip); iput(ip);
} }
/* /*
* the umount system call. * the umount system call.
*/ */
@ -291,7 +289,7 @@ sumount()
xumount(dev); /* remove unused sticky files from text table */ xumount(dev); /* remove unused sticky files from text table */
update(); update();
for(mp = &mount[0]; mp < &mount[Nmount]; mp++) for(mp = &mount[0]; mp < &mount[Nmount]; mp++)
if(mp->m_bufp) if(mp->m_bufp && dev == mp->m_dev)
goto found; goto found;
u.u_error = EINVAL; u.u_error = EINVAL;
return; return;
@ -311,10 +309,9 @@ found:
bp = mp->m_bufp; bp = mp->m_bufp;
mp->m_bufp = NULL; mp->m_bufp = NULL;
brelse(bp); brelse(bp);
/* FIXME: here has to be a clr @r8 - rr8 is mp */ mp->m_flags = MFREE;
} }
/* /*
* Common code for mount and umount. * Common code for mount and umount.
* Check that the user's argument is a reasonable * Check that the user's argument is a reasonable
@ -338,7 +335,6 @@ getmdev()
return(dev); return(dev);
} }
/* /*
* character special i/o control * character special i/o control
*/ */
@ -349,10 +345,10 @@ ioctl()
register struct a { register struct a {
int fdes; int fdes;
int cmd; int cmd;
int arg; caddr_t arg;
} *uap; } *uap;
register dev_t dev; register dev_t dev;
uap = (struct a *)u.u_ap; uap = (struct a *)u.u_ap;
if ((fp = getf(uap->fdes)) == NULL) if ((fp = getf(uap->fdes)) == NULL)
return; return;
@ -361,38 +357,44 @@ ioctl()
u.u_error = ENOTTY; u.u_error = ENOTTY;
return; return;
} }
u.u_r.r_val1 = 0;
dev = (dev_t)ip->i_rdev; dev = (dev_t)ip->i_rdev;
(*cdevsw[major(dev)].d_ioctl)(minor(dev),uap->cmd,uap->arg,fp->f_flag); (*cdevsw[major(dev)].d_ioctl)(minor(dev),uap->cmd,uap->arg,fp->f_flag);
} }
/*
* old stty and gtty
*/
stty() stty()
{ {
register struct a { u.u_arg[1] = TIOCSETP;
int fdes; u.u_arg[3] = u.u_arg[2];
int arg; u.u_arg[2] = 0x3f00;
int narg;
} *uap;
uap = (struct a *)u.u_ap;
uap->narg = uap->arg;
uap->arg = TIOCSETP;
ioctl(); ioctl();
} }
gtty() gtty()
{ {
register struct a { u.u_arg[1] = TIOCGETP;
int fdes; u.u_arg[3] = u.u_arg[2];
int arg; u.u_arg[2] = 0x3f00;
int narg;
} *uap;
uap = (struct a *)u.u_ap;
uap->narg = uap->arg;
uap->arg = TIOCGETP;
ioctl(); ioctl();
} }
/*
* modem control
*/
mdmmctl()
{
register struct a {
int request;
long *modems;
int dev;
} *uap;
uap = (struct a *)u.u_ap;
if (uap->dev<0||uap->dev>=nchrdev ) {
u.u_error = ENODEV;
return;
}
u.u_r.r_val1 = 0;
(*cdevsw[uap->dev].d_ioctl)(0,uap->request,uap->modems,uap->dev);
}