From owner-freebsd-emulation@FreeBSD.ORG Tue May 5 22:06:01 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA3C106564A for ; Tue, 5 May 2009 22:06:01 +0000 (UTC) (envelope-from prvs=1376b98bf5=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (core6.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 605178FC14 for ; Tue, 5 May 2009 22:06:01 +0000 (UTC) (envelope-from prvs=1376b98bf5=killing@multiplay.co.uk) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=multiplay.co.uk; s=Multiplay; t=1241560537; x=1242165337; q=dns/txt; h=Received: Message-ID:From:To:Cc:References:Subject:Date:MIME-Version: Content-Type; bh=SX4Wg8C9HkYMVAzJwxhY9LGkfFtCYjw7xbJoNGI0vRw=; b=YkdcVyTHLbtPKYe3YCZ123yrqpGzK01BMjCuk9YVImDnbU/EeuKIzz8924r0DB dSWobLEhQbY6tCep46CWnKlmmrNyxAKE/tQTAPPQwKm7DnmSeMVYXFN40Ob+N/2L fe3w8gDE7hGC/ilQMteTMlqToE7mx0a5UeWacltDmVwSg= X-MDAV-Processed: mail1.multiplay.co.uk, Tue, 05 May 2009 22:55:37 +0100 Received: from r2d2 by mail1.multiplay.co.uk (MDaemon PRO v10.0.4) with ESMTP id md50007462545.msg for ; Tue, 05 May 2009 22:55:36 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Tue, 05 May 2009 22:55:36 +0100 (not processed: message from trusted or authenticated source) X-Authenticated-Sender: Killing@multiplay.co.uk X-MDRemoteIP: 85.236.106.102 X-Return-Path: prvs=1376b98bf5=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-emulation@FreeBSD.org Message-ID: From: "Steven Hartland" To: "Alexander Leidinger" , "Boris Samorodov" References: <81924694@bb.ipt.ru><20090505144955.16373k1b32dpaxo0@webmail.leidinger.net> <47993241@bb.ipt.ru> Date: Tue, 5 May 2009 22:55:34 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0CDB_01C9CDD4.991104C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Cc: freebsd-emulation@FreeBSD.org Subject: Re: [linux-f10] linux_socketcall... ERR#43 'Protocol not supported' X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2009 22:06:03 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0CDB_01C9CDD4.991104C0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Attached is some patches we use based off 7.0 which add a few additional Linux calls including sockets, so may help. Regards Steve ----- Original Message ----- From: "Boris Samorodov" >> instrument the current code to print out the parameters to >> linux_socketcall in a human readable way. > > Can you give a tiny example? ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. ------=_NextPart_000_0CDB_01C9CDD4.991104C0 Content-Type: application/octet-stream; name="syscalls.c.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="syscalls.c.patch" --- syscalls.c.orig 2008-07-13 22:34:30.000000000 +0100=0A= +++ syscalls.c 2008-11-22 02:27:12.000000000 +0000=0A= @@ -96,4 +96,8 @@=0A= { "readlink", 1, 3,=0A= { { Name, 0 } , { Readlinkres | OUT, 1 }, { Int, 2 }}},=0A= + { "linux_readlink", 1, 3,=0A= + { { Name, 0 } , { Name | OUT, 1 }, { Int, 2 }}},=0A= + { "linux_socketcall", 1, 2,=0A= + { { Int, 0 } , { LinuxSockArgs, 1 }}},=0A= { "lseek", 2, 3,=0A= { {Int, 0}, {Quad, 1 + QUAD_ALIGN},=0A= @@ -112,4 +116,6 @@=0A= { "linux_open", 1, 3,=0A= { { Name, 0 }, { Hex, 1}, { Octal, 2 }}},=0A= + { "linux_mkdir", 1, 2,=0A= + { { Name | IN, 0} , {Int, 1}}},=0A= { "close", 1, 1,=0A= { { Int, 0 } } },=0A= @@ -136,4 +142,6 @@=0A= { "stat", 1, 2,=0A= { { Name | IN, 0 }, { Stat | OUT, 1 }}},=0A= + { "linux_stat64", 1, 3,=0A= + { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 }}},=0A= { "lstat", 1, 2,=0A= { { Name | IN, 0 }, { Stat | OUT, 1 }}},=0A= @@ -149,4 +157,5 @@=0A= { "exit", 0, 1, { { Hex, 0 }}},=0A= { "access", 1, 2, { { Name | IN, 0 }, { Int, 1 }}},=0A= + { "linux_access", 1, 2, { { Name, 0 }, { Int, 1 }}},=0A= { "sigaction", 1, 3,=0A= { { Signal, 0 }, { Sigaction | IN, 1 }, { Sigaction | OUT, 2 }}},=0A= @@ -667,4 +676,75 @@=0A= break;=0A= case Itimerval:=0A= + case LinuxSockArgs:=0A= + {=0A= +=0A= + struct linux_socketcall_args largs;=0A= + if ( get_struct(pid, (void *)args[sc->offset], (void *)&largs, = sizeof(largs)) =3D=3D -1)=0A= + {=0A= + err(1, "get_struct %p", (void *)args[sc->offset]);=0A= + }=0A= + const char *what;=0A= + char buf[30];=0A= +=0A= + switch (largs.what) {=0A= + case LINUX_SOCKET:=0A= + what =3D "LINUX_SOCKET";=0A= + break;=0A= + case LINUX_BIND:=0A= + what =3D "LINUX_BIND";=0A= + break;=0A= + case LINUX_CONNECT:=0A= + what =3D "LINUX_CONNECT";=0A= + break;=0A= + case LINUX_LISTEN:=0A= + what =3D "LINUX_LISTEN";=0A= + break;=0A= + case LINUX_ACCEPT:=0A= + what =3D "LINUX_ACCEPT";=0A= + break;=0A= + case LINUX_GETSOCKNAME:=0A= + what =3D "LINUX_GETSOCKNAME";=0A= + break;=0A= + case LINUX_GETPEERNAME:=0A= + what =3D "LINUX_GETPEERNAME";=0A= + break;=0A= + case LINUX_SOCKETPAIR:=0A= + what =3D "LINUX_SOCKETPAIR";=0A= + break;=0A= + case LINUX_SEND: =0A= + what =3D "LINUX_SEND";=0A= + break;=0A= + case LINUX_RECV: =0A= + what =3D "LINUX_RECV";=0A= + break;=0A= + case LINUX_SENDTO:=0A= + what =3D "LINUX_SENDTO";=0A= + break;=0A= + case LINUX_RECVFROM:=0A= + what =3D "LINUX_RECVFROM";=0A= + break;=0A= + case LINUX_SHUTDOWN:=0A= + what =3D "LINUX_SHUTDOWN";=0A= + break;=0A= + case LINUX_SETSOCKOPT:=0A= + what =3D "LINUX_SETSOCKOPT";=0A= + break;=0A= + case LINUX_GETSOCKOPT:=0A= + what =3D "LINUX_GETSOCKOPT";=0A= + break;=0A= + case LINUX_SENDMSG:=0A= + what =3D "LINUX_SENDMSG";=0A= + break;=0A= + case LINUX_RECVMSG:=0A= + what =3D "LINUX_RECVMSG";=0A= + break;=0A= + default:=0A= + sprintf( buf, "%d", largs.what );=0A= + what =3D buf;=0A= + break;=0A= + }=0A= + asprintf(&tmp, "(0x%lx)%s, 0x%lx", args[sc->offset], what, (long = unsigned int)largs.args );=0A= + }=0A= + break;=0A= {=0A= struct itimerval itv;=0A= ------=_NextPart_000_0CDB_01C9CDD4.991104C0 Content-Type: application/octet-stream; name="syscall.h.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="syscall.h.patch" --- /usr/src/usr.bin/truss/syscall.h.orig 2007-04-10 05:03:34.000000000 = +0100=0A= +++ /usr/src/usr.bin/truss/syscall.h 2008-06-30 13:16:01.000000000 +0100=0A= @@ -41,5 +41,5 @@=0A= Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open,=0A= Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2,=0A= - Pathconf };=0A= + Pathconf, LinuxSockArgs };=0A= =0A= #define ARG_MASK 0xff=0A= @@ -65,2 +65,49 @@=0A= void print_syscall_ret(struct trussinfo *, const char *, int, char **, = int,=0A= long);=0A= +=0A= +/*=0A= + * Linux Socket defines=0A= + */=0A= +#define LINUX_SOCKET 1=0A= +#define LINUX_BIND 2=0A= +#define LINUX_CONNECT 3=0A= +#define LINUX_LISTEN 4=0A= +#define LINUX_ACCEPT 5=0A= +#define LINUX_GETSOCKNAME 6=0A= +#define LINUX_GETPEERNAME 7=0A= +#define LINUX_SOCKETPAIR 8=0A= +#define LINUX_SEND 9=0A= +#define LINUX_RECV 10=0A= +#define LINUX_SENDTO 11=0A= +#define LINUX_RECVFROM 12=0A= +#define LINUX_SHUTDOWN 13=0A= +#define LINUX_SETSOCKOPT 14=0A= +#define LINUX_GETSOCKOPT 15=0A= +#define LINUX_SENDMSG 16=0A= +#define LINUX_RECVMSG 17 =0A= +=0A= +#define PAD_(t) (sizeof(register_t) <=3D sizeof(t) ? \=0A= + 0 : sizeof(register_t) - sizeof(t))=0A= + =0A= +#if BYTE_ORDER =3D=3D LITTLE_ENDIAN=0A= +#define PADL_(t) 0=0A= +#define PADR_(t) PAD_(t)=0A= +#else=0A= +#define PADL_(t) PAD_(t)=0A= +#define PADR_(t) 0=0A= +#endif=0A= +=0A= +typedef int l_int;=0A= +typedef uint32_t l_ulong;=0A= +=0A= +struct linux_socketcall_args {=0A= + char what_l_[PADL_(l_int)]; l_int what; char what_r_[PADR_(l_int)];=0A= + char args_l_[PADL_(l_ulong)]; l_ulong args; char = args_r_[PADR_(l_ulong)];=0A= +};=0A= +=0A= +/*=0A= +struct linux_socketcall_args {=0A= + l_int what;=0A= + l_ulong args;=0A= +};=0A= +*/=0A= ------=_NextPart_000_0CDB_01C9CDD4.991104C0--