Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: linux emulation take two



On Jun 3,  3:52pm, prlw1%cam.ac.uk@localhost (Patrick Welche) wrote:
-- Subject: Re: linux emulation take two

| On Tue, Jun 02, 2015 at 03:34:31PM +0000, Christos Zoulas wrote:
| > In article <20150602134017.GC10950%quark.internal.precedence.co.uk@localhost>,
| > Patrick Welche  <prlw1%cam.ac.uk@localhost> wrote:
| > >Starting again... On the same -current/amd64 computer, with suse 13.2
| > >installed, /emul/linux32/usr/bin/xeyes fails with:
| > 
| > There is no chance those will work under linux32. You need to
| > convert the msghdr structures and the iov's... Copying the
| > sendmsg/recvmsg code from linux/common/linux_socket.c to
| > linux32/common/linux32_socket.c, adjusting the structs, and then
| > doing the iov conversions like they are done in
| > netbsd32/netbsd32_socket.c is what needs to be done to get those
| > working. Give it a try! It should not be too hard, all the bits
| > are there.
| 
| I've been having a good crack at it - this bit doesn't look promising though:
| 
| /*
|  * Linux alignment requirement for CMSG struct manipulation.
|  * Linux aligns on (size_t) boundary on all architectures.
|  * Fortunately for linux, linux_cmsghdr is always size_t aligned !
|  * since no padding is added between the header and data.
|  * XXX: this code isn't right for the compat32 code.
|  */
| struct linux_cmsghdr {
|         size_t  cmsg_len;       /* NB not socklen_t */
|         int     cmsg_level;
|         int     cmsg_type;
|     /*  unsigned char __cmsg_data[0]; */
| };

I think on 32 bits that would be netbsd32_size_t, so you'd need
struct linux32_cmsghdr?

christos


Home | Main Index | Thread Index | Old Index