STATUS: 73%
0000 T _read compatible
0006 T _write compatible
000c T _rdwr stack assignments are not compatible
uses for an adding an other temp. reg.
u_base assignment is not correct
01d6 T _open compatible
01fe T _creat compatible
0224 T _copen stack assignments are not compatible
041a T _close compatible
045e T _seek compatible
04ec T _link u_dirp assignment is not correct.
05c2 T _mknod compatible
0660 T _saccess compatible
This commit is contained in:
parent
dc5ec1660d
commit
87841b3908
|
|
@ -52,7 +52,6 @@ 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 {
|
||||||
|
|
@ -60,6 +59,7 @@ register mode;
|
||||||
char *cbuf;
|
char *cbuf;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
} *uap;
|
} *uap;
|
||||||
|
long j; /*FIXME: should be stack+0 is stack+2*/
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
uap = (struct a *)u.u_ap;
|
uap = (struct a *)u.u_ap;
|
||||||
|
|
@ -70,13 +70,19 @@ register mode;
|
||||||
u.u_error = EBADF;
|
u.u_error = EBADF;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
u.u_base.l = (caddr_t)uap->cbuf;
|
u.u_base.l = (caddr_t)(((long)uap->cbuf) & 0x7F00FFFF); /* FIXME: this is not 100% compatible */
|
||||||
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;
|
||||||
ip = fp->f_inode;
|
ip = fp->f_inode;
|
||||||
type = ip->i_mode&IFMT;
|
type = ip->i_mode&IFMT;
|
||||||
if (type==IFREG || type==IFDIR) {
|
if (type==IFREG || type==IFDIR) {
|
||||||
|
u.u_offset = fp->f_offset;
|
||||||
|
if(ip->i_locklist) {
|
||||||
|
j = u.u_offset + u.u_count; /*FIXME: rr2 is used for adding, rr4 should be used j is used nowhere*/
|
||||||
|
if(locked(mode == FREAD?0x100:0,ip,u.u_offset))
|
||||||
|
return;
|
||||||
|
}
|
||||||
plock(ip);
|
plock(ip);
|
||||||
if ((u.u_fmode&FAPPEND) && (mode == FWRITE))
|
if ((u.u_fmode&FAPPEND) && (mode == FWRITE))
|
||||||
fp->f_offset = ip->i_size;
|
fp->f_offset = ip->i_size;
|
||||||
|
|
@ -134,12 +140,14 @@ creat()
|
||||||
* Check permissions, allocate an open file structure,
|
* Check permissions, allocate an open file structure,
|
||||||
* and call the device open routine if any.
|
* and call the device open routine if any.
|
||||||
*/
|
*/
|
||||||
copen(mode, arg)
|
copen(mode, arg,j)
|
||||||
register mode;
|
register mode;
|
||||||
|
int arg; /*FIXME: this should be stack +4 but is +0*/
|
||||||
{
|
{
|
||||||
register struct inode *ip;
|
register struct inode *ip;
|
||||||
register struct file *fp;
|
register struct file *fp;
|
||||||
int i;
|
long j; /*FIXME: this should be stack +0 but is +4*/
|
||||||
|
int i; /*FIXME: this is stack +8*/
|
||||||
|
|
||||||
if ((mode&(FREAD|FWRITE)) == 0) {
|
if ((mode&(FREAD|FWRITE)) == 0) {
|
||||||
u.u_error = EINVAL;
|
u.u_error = EINVAL;
|
||||||
|
|
@ -160,6 +168,23 @@ register mode;
|
||||||
iput(ip);
|
iput(ip);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(save(u.u_qsav)) {
|
||||||
|
setscr();
|
||||||
|
iput(ip);
|
||||||
|
if (u.u_error) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
u.u_error = EINTR;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ip->i_locklist) {
|
||||||
|
j=0x4000000; /*FIXME: only usage of j - makes no real sense if its private*/
|
||||||
|
if(locked(0,ip,0)){
|
||||||
|
iput(ip);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
mode &= ~FCREAT;
|
mode &= ~FCREAT;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -187,6 +212,7 @@ register mode;
|
||||||
fp->f_inode = ip;
|
fp->f_inode = ip;
|
||||||
i = u.u_r.r_val1;
|
i = u.u_r.r_val1;
|
||||||
if (setjmp(u.u_qsav)) { /* catch half-opens */
|
if (setjmp(u.u_qsav)) { /* catch half-opens */
|
||||||
|
setscr();
|
||||||
if (u.u_error == 0)
|
if (u.u_error == 0)
|
||||||
u.u_error = EINTR;
|
u.u_error = EINTR;
|
||||||
u.u_ofile[i] = NULL;
|
u.u_ofile[i] = NULL;
|
||||||
|
|
@ -275,7 +301,9 @@ link()
|
||||||
* embraces.
|
* embraces.
|
||||||
*/
|
*/
|
||||||
prele(ip);
|
prele(ip);
|
||||||
u.u_dirp.l = (caddr_t)uap->linkname;
|
|
||||||
|
u.u_dirp.l = (caddr_t)(((long)uap->linkname) & 0x7F00FFFF); /* FIXME: this is not 100% compatible */
|
||||||
|
|
||||||
xp = namei(uchar, 1);
|
xp = namei(uchar, 1);
|
||||||
if (xp != NULL) {
|
if (xp != NULL) {
|
||||||
u.u_error = EEXIST;
|
u.u_error = EEXIST;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue