From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 75902A0542; Thu, 10 Nov 2022 17:14:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 678204021D; Thu, 10 Nov 2022 17:14:18 +0100 (CET) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 9163C40A7D for ; Thu, 10 Nov 2022 17:14:16 +0100 (CET) Received: by mail-pf1-f172.google.com with SMTP id m6so2663255pfb.0 for ; Thu, 10 Nov 2022 08:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=xSW7lcWLZWUbftePm7cwzE7qHjk5/50Jf7RbeSjRj6I=; b=BD/kag7WaeSbsucAyIoKuhhOzNx0bw7azBtz9k4iMaB6Y7DQemcXaITVbcztAcq1oq HyqJvknZoZUsGFsnfWvT+MgfqiXD5y4AL6m4CkPjoU0tc9dNQXHwVmbfaqdXOc3wS+RC KMGBpQY/9E0hOGLYQMPXYtfeNk+TUg35NhZxuxBnfsC/3qyzkx65X4cjj8yQ/3aG5aR/ 7kY4SObbS80yJ/S8F1n1yHXwcUycbIouxGbdGDfWo/oj9ziUsJl6G11ItmMJTcI5VLji 5q2NGhH87zFZ6r2vTzWfUDYhmTREcDj3DMb0GX0EyfF9jTJLJhrbbBAA0L2nzA46JBCQ SS+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xSW7lcWLZWUbftePm7cwzE7qHjk5/50Jf7RbeSjRj6I=; b=Ns8YOLWBHmPepvIjZgkW5C9ykiwzoI1X/inB9DCpo0i2xVcPmJZkxZiY5VilC3wvLG N2PM9tWvO/5sOtBBxkNyURjnZYNmt6ngJbt6d6OY6XZL7rKfxUo3Cvk+IPpEK3+k4ihe xreDi7o8qrVw7ytl+H4qlHwROsJ3nTDk6BpkMmNyzIaZndvQ9p4oBWzI8T6H9eTjevzO X7tHKOPnht5Cvjz7CoazeRm3Z/WBYRUtUL3MmLfsuORoBwvkS1/P5HYqHg4F8iF7zlkF FTvgp/Ox6FeiFAC9f7dJVKJYNiK7nSd8ymDgZ6+SBZ5pxiEobexbu+FpQXWc8gJ3A8nK Em2A== X-Gm-Message-State: ACrzQf1w24u4fH7o/Z6aK6jOVvV8qrPFJgarMl2ZexBxqwyjuE1MN2DJ CDdeMqTm2+AmLcO8WQ7433mp/g== X-Google-Smtp-Source: AMsMyM4QhSESqpgUHljGebCEARBB0EPmW6X5z97WpzbkTdepgW/97gkycjele5TuSc5XlW1kvCOf2g== X-Received: by 2002:a65:6d9b:0:b0:45f:767:9585 with SMTP id bc27-20020a656d9b000000b0045f07679585mr2777433pgb.557.1668096855731; Thu, 10 Nov 2022 08:14:15 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id w5-20020a170902e88500b001885dbe31dfsm11468281plg.178.2022.11.10.08.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 08:14:14 -0800 (PST) Date: Thu, 10 Nov 2022 08:14:12 -0800 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: dev@dpdk.org, phil.yang@arm.com Subject: Re: [PATCH v4] testpmd: cleanup cleanly from signal Message-ID: <20221110081412.707599b2@hermes.local> In-Reply-To: References: <20221014172328.185219-2-stephen@networkplumber.org> <20221109041046.199840-1-stephen@networkplumber.org> <097a2759-f958-84ed-0ddf-4b23eb1eee04@lysator.liu.se> <20221109145323.7ac2a1b4@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 10 Nov 2022 08:50:40 +0100 Mattias R=C3=B6nnblom wrote: > >> > >> Why is select() needed? Wouldn't a blocking read suffice? Or getchar()= . =20 > >=20 > > On Linux, signal set SA_RESTART so a simple read is not interrupted. > > One option was to use sigaction() which allows controlling flags, but t= hat > > won't work on Windows. Using select() works on both. > > =20 >=20 > OK, so select() is used because a signal might interrupt read() on Window= s? >=20 > while (read(0, &c, 1) =3D=3D -1 && errno =3D=3D EINTR) > ; >=20 > Would that work? Try it. On Linux the read never gets interrupted.