[PATCH]: possible fix for the fifoor problem

Divacky Roman xdivac02 at stud.fit.vutbr.cz
Wed Nov 8 07:03:03 UTC 2006


On Tue, Nov 07, 2006 at 12:37:07PM -0500, Jung-uk Kim wrote:
> On Tuesday 07 November 2006 12:19 pm, Divacky Roman wrote:
> > the patch is wrong.... this forces NONBLOCKing on all opened files
> > which is wrong.
> 
> Nope.  It does not force anything.
> 
> static void
> translate_path_major_minor(struct thread *td, char *path, struct stat *buf)
> {
> 	struct proc *p = td->td_proc;   
> 	struct filedesc *fdp = p->p_fd;
> 	struct file *fp;
> 	int fd;
> 	int temp;
> 
> 	temp = td->td_retval[0];
> 	if (kern_open(td, path, UIO_SYSSPACE, O_RDONLY, 0) != 0)
> 		return;
> 	fd = td->td_retval[0];
> 	td->td_retval[0] = temp;
> 	translate_fd_major_minor(td, fd, buf);
> 	FILEDESC_LOCK(fdp);
> 	fp = fdp->fd_ofiles[fd];
> 	FILEDESC_UNLOCK(fdp);
> 	fdclose(fdp, fdp->fd_ofiles[fd], fd, td);
> }
> 
> As you can see the function is only used internally to convert
> major/minor and fd is closed at the end of the function.
 
oh.. I overlooked that. then I think your patch might be correct.
bde knows obviously more about it. but I personally dont object
to the patch
 
> > according to a comment in linux source code linux never blocks for
> > O_RDWR which is what I tried to implement with my patch
> 
> We don't advertise it but we do the same, AFAIK. ;-)

I read the code and I think it does but I am no expert


More information about the freebsd-emulation mailing list