TODO:
0000 T _read compatible
0006 T _write compatible
000c T _rdwr at least base assignment not correct.
01d6 T _open compatible
01fe T _creat compatible
0224 T _copen not compatible - further checking needed
041a T _close compatible
045e T _seek compatible
04ec T _link dirp assignment not correct.
05c2 T _mknod compatible
0660 T _saccess compatible
This commit is contained in:
parent
c3ca921034
commit
64ab0e59c8
|
|
@ -52,6 +52,7 @@ write()
|
||||||
rdwr(mode)
|
rdwr(mode)
|
||||||
register mode;
|
register mode;
|
||||||
{
|
{
|
||||||
|
int foo,foo2;
|
||||||
register struct file *fp;
|
register struct file *fp;
|
||||||
register struct inode *ip;
|
register struct inode *ip;
|
||||||
register struct a {
|
register struct a {
|
||||||
|
|
@ -69,7 +70,7 @@ register mode;
|
||||||
u.u_error = EBADF;
|
u.u_error = EBADF;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
u.u_base.l = (caddr_t)uap->cbuf;
|
u.u_base.left = (caddr_t)uap->cbuf;
|
||||||
u.u_count = uap->count;
|
u.u_count = uap->count;
|
||||||
u.u_segflg = 0;
|
u.u_segflg = 0;
|
||||||
u.u_fmode = fp->f_flag;
|
u.u_fmode = fp->f_flag;
|
||||||
|
|
@ -244,15 +245,6 @@ seek()
|
||||||
uap->off += fp->f_offset;
|
uap->off += fp->f_offset;
|
||||||
else if (uap->sbase == 2)
|
else if (uap->sbase == 2)
|
||||||
uap->off += fp->f_inode->i_size;
|
uap->off += fp->f_inode->i_size;
|
||||||
else if (uap->sbase != 0) {
|
|
||||||
u.u_error = EINVAL;
|
|
||||||
psignal(u.u_procp, SIGSYS);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (uap->off < 0) {
|
|
||||||
u.u_error = EINVAL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fp->f_offset = uap->off;
|
fp->f_offset = uap->off;
|
||||||
u.u_r.r_off = uap->off;
|
u.u_r.r_off = uap->off;
|
||||||
}
|
}
|
||||||
|
|
@ -272,10 +264,6 @@ link()
|
||||||
ip = namei(uchar, 0);
|
ip = namei(uchar, 0);
|
||||||
if (ip == NULL)
|
if (ip == NULL)
|
||||||
return;
|
return;
|
||||||
if (ip->i_nlink >= MAXLINK) {
|
|
||||||
u.u_error = EMLINK;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if ((ip->i_mode&IFMT)==IFDIR && !suser())
|
if ((ip->i_mode&IFMT)==IFDIR && !suser())
|
||||||
goto out;
|
goto out;
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue