qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jun Peng" <jun7903cn@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] cmsg / target_cmsg (patch for HOST_MIPS / TARGET_MIPS)
Date: Sat, 23 Jun 2007 22:48:14 +0800	[thread overview]
Message-ID: <ab4614040706230748u1afe4d2ta0a24b8b6a1496fc@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 58 bytes --]

modified target_to_host_cmsg() and host_to_target_cmsg().

[-- Attachment #2: qemu-20070623-cmsg.patch --]
[-- Type: text/plain, Size: 1498 bytes --]

diff -Nurb qemu-20070623/linux-user/syscall.c qemu-loongson/linux-user/syscall.c
--- qemu-20070623/linux-user/syscall.c	2007-06-23 16:39:14.000000000 +0800
+++ qemu-loongson/linux-user/syscall.c	2007-06-23 21:49:18.000000000 +0800
@@ -562,10 +562,12 @@
         }
 
         cmsg->cmsg_level = tswap32(target_cmsg->cmsg_level);
+	if(cmsg->cmsg_level == TARGET_SOL_SOCKET)
+		cmsg->cmsg_level = SOL_SOCKET;
         cmsg->cmsg_type = tswap32(target_cmsg->cmsg_type);
         cmsg->cmsg_len = CMSG_LEN(len);
 
-        if (cmsg->cmsg_level != TARGET_SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) {
+        if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) {
             gemu_log("Unsupported ancillary data: %d/%d\n", cmsg->cmsg_level, cmsg->cmsg_type);
             memcpy(data, target_data, len);
         } else {
@@ -606,10 +608,12 @@
         }
 
         target_cmsg->cmsg_level = tswap32(cmsg->cmsg_level);
+	if(target_cmsg->cmsg_level == SOL_SOCKET)
+		target_cmsg->cmsg_level = TARGET_SOL_SOCKET;
         target_cmsg->cmsg_type = tswap32(cmsg->cmsg_type);
         target_cmsg->cmsg_len = tswapl(TARGET_CMSG_LEN(len));
 
-        if (cmsg->cmsg_level != TARGET_SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) {
+        if (target_cmsg->cmsg_level != TARGET_SOL_SOCKET || target_cmsg->cmsg_type != SCM_RIGHTS) {
             gemu_log("Unsupported ancillary data: %d/%d\n", cmsg->cmsg_level, cmsg->cmsg_type);
             memcpy(target_data, data, len);
         } else {

                 reply	other threads:[~2007-06-23 14:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab4614040706230748u1afe4d2ta0a24b8b6a1496fc@mail.gmail.com \
    --to=jun7903cn@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).