STATUS: 8%
0000 T _fstat not compatible
0044 T _stat not compatible
0086 T _stat1 not compatible
0172 T _dup not compatible
022e T _fcntl compatible
02fc T _smount not compatible
04bc T _sumount not compatible
05be T _getmdev not compatible
062a T _ioctl not compatible
06c2 T _stty not compatible
06e2 T _gtty not compatible
0702 T _mdmctl not existing
This commit is contained in:
parent
3b9a936bd2
commit
06cad5919e
|
|
@ -1,17 +1,39 @@
|
||||||
#include "sys/param.h"
|
/******************************************************************************
|
||||||
#include "sys/systm.h"
|
*******************************************************************************
|
||||||
#include "sys/mount.h"
|
|
||||||
#include "sys/ino.h"
|
W E G A - Quelle
|
||||||
#include "sys/buf.h"
|
|
||||||
#include "sys/filsys.h"
|
KERN 3.2 Modul: sys3.c
|
||||||
#include "sys/dir.h"
|
|
||||||
#include "sys/user.h"
|
|
||||||
#include "sys/inode.h"
|
Bearbeiter: O. Lehmann
|
||||||
#include "sys/file.h"
|
Datum: 23.05.08
|
||||||
#include "sys/conf.h"
|
Version: 1.0
|
||||||
#include "sys/stat.h"
|
|
||||||
#include "sys/ioctl.h"
|
*******************************************************************************
|
||||||
#include "sys/var.h"
|
******************************************************************************/
|
||||||
|
|
||||||
|
char sys3wstr[] = "@[$]sys3.c Rev : 4.1 08/27/83 11:59:28";
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/sysinfo.h>
|
||||||
|
#include <sys/systm.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#include <sys/ino.h>
|
||||||
|
#include <sys/buf.h>
|
||||||
|
#include <sys/filsys.h>
|
||||||
|
#include <sys/dir.h>
|
||||||
|
#include <sys/s.out.h>
|
||||||
|
#include <sys/mmu.h>
|
||||||
|
#include <sys/user.h>
|
||||||
|
#include <sys/inode.h>
|
||||||
|
#include <sys/file.h>
|
||||||
|
#include <sys/conf.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
extern int Nmount;
|
||||||
|
extern int Ninode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the fstat system call.
|
* the fstat system call.
|
||||||
|
|
@ -141,7 +163,7 @@ fcntl()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
u.u_rval1 = u.u_pofile[uap->fdes];
|
u.u_r.r_val1 = u.u_pofile[uap->fdes];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
|
|
@ -149,7 +171,7 @@ fcntl()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
u.u_rval1 = fp->f_flag+FOPEN;
|
u.u_r.r_val1 = fp->f_flag+FOPEN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
|
|
@ -162,63 +184,6 @@ fcntl()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* character special i/o control
|
|
||||||
*/
|
|
||||||
ioctl()
|
|
||||||
{
|
|
||||||
register struct file *fp;
|
|
||||||
register struct inode *ip;
|
|
||||||
register struct a {
|
|
||||||
int fdes;
|
|
||||||
int cmd;
|
|
||||||
int arg;
|
|
||||||
} *uap;
|
|
||||||
register dev_t dev;
|
|
||||||
|
|
||||||
uap = (struct a *)u.u_ap;
|
|
||||||
if ((fp = getf(uap->fdes)) == NULL)
|
|
||||||
return;
|
|
||||||
ip = fp->f_inode;
|
|
||||||
if ((ip->i_mode&IFMT) != IFCHR) {
|
|
||||||
u.u_error = ENOTTY;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
dev = (dev_t)ip->i_rdev;
|
|
||||||
(*cdevsw[major(dev)].d_ioctl)(minor(dev),uap->cmd,uap->arg,fp->f_flag);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* old stty and gtty
|
|
||||||
*/
|
|
||||||
stty()
|
|
||||||
{
|
|
||||||
register struct a {
|
|
||||||
int fdes;
|
|
||||||
int arg;
|
|
||||||
int narg;
|
|
||||||
} *uap;
|
|
||||||
|
|
||||||
uap = (struct a *)u.u_ap;
|
|
||||||
uap->narg = uap->arg;
|
|
||||||
uap->arg = TIOCSETP;
|
|
||||||
ioctl();
|
|
||||||
}
|
|
||||||
|
|
||||||
gtty()
|
|
||||||
{
|
|
||||||
register struct a {
|
|
||||||
int fdes;
|
|
||||||
int arg;
|
|
||||||
int narg;
|
|
||||||
} *uap;
|
|
||||||
|
|
||||||
uap = (struct a *)u.u_ap;
|
|
||||||
uap->narg = uap->arg;
|
|
||||||
uap->arg = TIOCGETP;
|
|
||||||
ioctl();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the mount system call.
|
* the mount system call.
|
||||||
*/
|
*/
|
||||||
|
|
@ -242,7 +207,7 @@ smount()
|
||||||
dev = getmdev();
|
dev = getmdev();
|
||||||
if(u.u_error)
|
if(u.u_error)
|
||||||
return;
|
return;
|
||||||
u.u_dirp = (caddr_t)uap->freg;
|
u.u_dirp.l = (caddr_t)uap->freg;
|
||||||
ip = namei(uchar, 0);
|
ip = namei(uchar, 0);
|
||||||
if(ip == NULL)
|
if(ip == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
@ -255,7 +220,7 @@ smount()
|
||||||
if (ip->i_number == ROOTINO)
|
if (ip->i_number == ROOTINO)
|
||||||
goto out;
|
goto out;
|
||||||
smp = NULL;
|
smp = NULL;
|
||||||
for(mp = &mount[0]; mp < (struct mount *)v.ve_mount; mp++) {
|
for(mp = &mount[0]; mp < &mount[Nmount]; mp++) {
|
||||||
if(mp->m_flags != MFREE) {
|
if(mp->m_flags != MFREE) {
|
||||||
if(dev == mp->m_dev)
|
if(dev == mp->m_dev)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
@ -318,14 +283,14 @@ sumount()
|
||||||
return;
|
return;
|
||||||
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 < (struct mount *)v.ve_mount; mp++)
|
for(mp = &mount[0]; mp < &mount[Nmount]; mp++)
|
||||||
if(mp->m_flags == MINUSE && dev == mp->m_dev)
|
if(mp->m_flags == MINUSE && dev == mp->m_dev)
|
||||||
goto found;
|
goto found;
|
||||||
u.u_error = EINVAL;
|
u.u_error = EINVAL;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
found:
|
found:
|
||||||
for(ip = &inode[0]; ip < (struct inode *)v.ve_inode; ip++)
|
for(ip = &inode[0]; ip < &inode[Ninode]; ip++)
|
||||||
if(ip->i_number != 0 && dev == ip->i_dev) {
|
if(ip->i_number != 0 && dev == ip->i_dev) {
|
||||||
u.u_error = EBUSY;
|
u.u_error = EBUSY;
|
||||||
return;
|
return;
|
||||||
|
|
@ -358,8 +323,66 @@ getmdev()
|
||||||
if((ip->i_mode&IFMT) != IFBLK)
|
if((ip->i_mode&IFMT) != IFBLK)
|
||||||
u.u_error = ENOTBLK;
|
u.u_error = ENOTBLK;
|
||||||
dev = (dev_t)ip->i_rdev;
|
dev = (dev_t)ip->i_rdev;
|
||||||
if(major(dev) >= bdevcnt)
|
/* if(major(dev) >= bdevcnt)
|
||||||
u.u_error = ENXIO;
|
u.u_error = ENXIO;
|
||||||
iput(ip);
|
*/ iput(ip);
|
||||||
return(dev);
|
return(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* character special i/o control
|
||||||
|
*/
|
||||||
|
ioctl()
|
||||||
|
{
|
||||||
|
register struct file *fp;
|
||||||
|
register struct inode *ip;
|
||||||
|
register struct a {
|
||||||
|
int fdes;
|
||||||
|
int cmd;
|
||||||
|
int arg;
|
||||||
|
} *uap;
|
||||||
|
register dev_t dev;
|
||||||
|
|
||||||
|
uap = (struct a *)u.u_ap;
|
||||||
|
if ((fp = getf(uap->fdes)) == NULL)
|
||||||
|
return;
|
||||||
|
ip = fp->f_inode;
|
||||||
|
if ((ip->i_mode&IFMT) != IFCHR) {
|
||||||
|
u.u_error = ENOTTY;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dev = (dev_t)ip->i_rdev;
|
||||||
|
(*cdevsw[major(dev)].d_ioctl)(minor(dev),uap->cmd,uap->arg,fp->f_flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* old stty and gtty
|
||||||
|
*/
|
||||||
|
stty()
|
||||||
|
{
|
||||||
|
register struct a {
|
||||||
|
int fdes;
|
||||||
|
int arg;
|
||||||
|
int narg;
|
||||||
|
} *uap;
|
||||||
|
|
||||||
|
uap = (struct a *)u.u_ap;
|
||||||
|
uap->narg = uap->arg;
|
||||||
|
uap->arg = TIOCSETP;
|
||||||
|
ioctl();
|
||||||
|
}
|
||||||
|
|
||||||
|
gtty()
|
||||||
|
{
|
||||||
|
register struct a {
|
||||||
|
int fdes;
|
||||||
|
int arg;
|
||||||
|
int narg;
|
||||||
|
} *uap;
|
||||||
|
|
||||||
|
uap = (struct a *)u.u_ap;
|
||||||
|
uap->narg = uap->arg;
|
||||||
|
uap->arg = TIOCGETP;
|
||||||
|
ioctl();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue