From patchwork Tue Mar 17 15:50:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11443233 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A652A14DD for ; Tue, 17 Mar 2020 15:52:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86C8B20714 for ; Tue, 17 Mar 2020 15:52:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86C8B20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEEWR-0006mM-Kc for patchwork-qemu-devel@patchwork.kernel.org; Tue, 17 Mar 2020 11:52:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37036) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEEVL-0004p3-Nw for qemu-devel@nongnu.org; Tue, 17 Mar 2020 11:51:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEEVK-0007I2-5b for qemu-devel@nongnu.org; Tue, 17 Mar 2020 11:51:43 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:53213) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jEEVJ-0007Cz-RT for qemu-devel@nongnu.org; Tue, 17 Mar 2020 11:51:42 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N8XHb-1jIeTi0gkb-014PdF; Tue, 17 Mar 2020 16:51:31 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 08/37] linux-user: fix socket() strace Date: Tue, 17 Mar 2020 16:50:47 +0100 Message-Id: <20200317155116.1227513-9-laurent@vivier.eu> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200317155116.1227513-1-laurent@vivier.eu> References: <20200317155116.1227513-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:EWgirKQ5Nau73P3h26c8IFSt2bZDOeBwwekd8WB1ezCMJaEWZWz sodKbGRiJDNnQuqukjlgUL3C8afPISHrbfmaFsnSItC9FA/7vpf1fWiD4mdfoGuAAoJY93L 9pgsvZY5ttshBPnvx4fqvbzRylvGk2k9YEu121AWAqLSHdHgIQoh8gJ3o/l/efQDRTQuDfu MHtnWV8q86mws+GUkmeDg== X-UI-Out-Filterresults: notjunk:1;V03:K0:NrGki+CH0nY=:KqgKOY1fut76t0X7c1+mwH +pNnDr7DR0gRKtN3hisGcd6R+xBqqUqguS+IiVIn8HdG0w4hGlriEkeOWNwB4QFVBA6cOD5Qs UWnHku4vk17iurxTkdlUjmGRxYElfeVzFzX1f/e3ImjVSwuj9eBvO/sCk1ZYeRER2m17fvswz rWJRfOGudPIlt+Z5qCOBdRpU6tcfOIltKk148DLJa+Y31ZEK8DgS25wWm+wQniVh6y4uj3DL5 FNX7HaJj+UiA7apmW2mPtaUdzfoPAXCuN1rGz6U/LwCT9+M8EA448Ph+qBfQmcyZRaawRFhP0 LYhyiKYkPtdh3SuMEESJajUeFwB/D0Z511iN1zrnRGawW2RVmEHkasmLomnr7z5xfX1yGidmd y/ishvYe/I5iT6iRuFW9Th6J2mxicjjrrvy8T59D4IKHvJrXUtHPrfB0QmGwtZ0HdBCzJgzWp Y3guc7fpYHLqVUBYScojQj46Fix4Jq7q9GMS1aD34lwqgwysbJ4t4J+uKkzefLMqyJKRzOSHc xL+4bC/I1fOsfanWi6uTPFLwiMNmK210Exu33ENKFDGK8oSVOMx6gxGQ1eqvtappLit9eupjj f86wQ+TaDmH1T1yPQg2e7EnWqwVSTg5i6KJ/Dr5zswys8knh2GPC1l7K0QBi0Hr3z5+/yqOTd yNsk0XbVOWsV5ANEggLG6doCkTNvi5AM3KbTdnnZirO/g1aGxaEI0oLDU+ybK186CTaadK6m/ N1qbNsOvMmnRGShvE32CS9w5O2i9Ia7lohe57U8xZ3OrequHqC+2S3qZYmNTb4s2Hn6JS/6LG cJclJIfS8mSxM6ZB61CD45F9OzGVF79hXtYLqZji7Ly5RaW7anH+3xnEAECZCd/BAD62ej4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" print_socket_type() doesn't manage flags and the correct type cannot be displayed Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200312165530.53450-1-laurent@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 4f7130b2ff63..69232f7e27b8 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -444,7 +444,7 @@ print_socket_domain(int domain) static void print_socket_type(int type) { - switch (type) { + switch (type & TARGET_SOCK_TYPE_MASK) { case TARGET_SOCK_DGRAM: qemu_log("SOCK_DGRAM"); break; @@ -464,6 +464,12 @@ print_socket_type(int type) qemu_log("SOCK_PACKET"); break; } + if (type & TARGET_SOCK_CLOEXEC) { + qemu_log("|SOCK_CLOEXEC"); + } + if (type & TARGET_SOCK_NONBLOCK) { + qemu_log("|SOCK_NONBLOCK"); + } } static void