Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 2009 22:55:34 +0100
From:      "Steven Hartland" <killing@multiplay.co.uk>
To:        "Alexander Leidinger" <Alexander@Leidinger.net>, "Boris Samorodov" <bsam@ipt.ru>
Cc:        freebsd-emulation@FreeBSD.org
Subject:   Re: [linux-f10] linux_socketcall... ERR#43 'Protocol not supported'
Message-ID:  <AFB8038589C04B41B7464782B8B2EFC1@multiplay.co.uk>
References:  <81924694@bb.ipt.ru><20090505144955.16373k1b32dpaxo0@webmail.leidinger.net> <47993241@bb.ipt.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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" <bsam@ipt.ru>

>> 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--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AFB8038589C04B41B7464782B8B2EFC1>