1 Jul 2008 02:33
Re: compat linux SIOCGIFCONF fix for 64bit archs
Christos Zoulas <christos <at> astron.com>
2008-07-01 00:33:41 GMT
2008-07-01 00:33:41 GMT
In article <20080630172052.GA300913 <at> medusa.sis.pasteur.fr>, Nicolas Joly <njoly <at> pasteur.fr> wrote: >-=-=-=-=-=- > > >Hi, > >Here follow a patch that fix SIOCGIFCONF ioctl under compat linux for >64bits archs. > >The main problem, here, is that Linux `struct ifreq' is not MI, but >our is ... By example, on Linux/x86_64 use a 40 bytes structure but >our corresponding structure has only 32 bytes (this works on i386, >because the Linux structure size is 32 bytes). This difference will >lead to an alignment problem when reporting the interfaces list with >SIOCGIFCONF ioctl. > >To fix it, i added a new `struct linux_ifreq' which has the expected >size, and a new linux_getifconf() function that use it (a cleaned up >version of compat_ifconf()). > >While here, the new linux_getifconf() function will only report >interfaces of AF_INET family, like the Linux kernel does. > >I tested it on -current NetBSD/amd64 and NetBSD/i386 that i have >access to. > >Thanks. > >NB: If this is ok, i'll plan to modify compat linux32 too; at least(Continue reading)
And
> > either cscope or eid (probably eid) can help you change the whole tree at
> > once.
>
> I don't know either, but I can do it with grep :)
>
> I don't know how to translate this kind of construct then:
> mutex_enter(&vp->v_interlock);
> while (vp->v_numoutput > 0)
> cv_wait(&vp->v_cv, &vp->v_interlock);
> mutex_exit(&vp->v_interlock);
You would have to hold the lock to move v_numoutput from a non-zero value to
to zero.
> they're used in several places. There are also places where it seems it's
> expected to have vp->v_numoutput stable for several lines of code:
> vfs_subr2.c:
> mutex_enter(&vp->v_interlock);
> while (vp->v_numoutput != 0)
RSS Feed