Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4399596pxj; Wed, 12 May 2021 05:00:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNUNVMm1hweXD+egF5xs4CFWABpQXZ1nWFab5FTLAD1Jv6wJSBe4l8iZ0/PrN8F/kh1XKj X-Received: by 2002:a02:b809:: with SMTP id o9mr32101543jam.3.1620820850471; Wed, 12 May 2021 05:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620820850; cv=none; d=google.com; s=arc-20160816; b=PxKWLpzBRmv8tCbL0DA3fvvEUC3vDzCLcOW7iqK1OcMcDY+Phosa9F/UggMBOBsmjW b4+f1pZzBHTBwj7r5oDgfIhw7T3LyqaLgyHES3R5x781qF/YzduHU/f7d7W1V0enK3WI Jfq9XPm6AehZLQw2O+Z2m+fQ1ntda4TKHqXwH8WWm/236+8/ZLbzske+8QixSAm+Q4/e xtZTdzdSvYNTPQdXQPBzrvytkLXcYXcRWyvn4shIaQxpDxPUtImYzEsLdEVuED8i6JBI rSY6YrgufsIpk+NGEcqVyYOdUBH1xdO5w8mflNS40vzXAYgy7cz1OAs6pBurSpkHMzKU H3jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nVRV7jHsc3R9+jBVMBhMrpm7O4bVfreVZJweRcrT2sU=; b=HFi5TT3OKJ7daz0o5K89rbT+R7tnUdyB/aQeYBc/RrU4K/LR+GVwlZbFqgJU6XOhLw ggPTmGh1wPzzLBsSgBUh3I9NAf8OMqdSEEM8G+JHlzQIkTFHSifjtAjef421k2qLV9MG zyoUqi7NNxRkLDYHYhQLEZEtGYPdiQYj6bCYNnENid4Z5MtmULqEYdqIibKN5AF1+Jgp EceiSLiOWF8XF2CUU908jdSV2AzvjyCwoYoiJs2jFbrVIwnqYyqX4DyfVwJIxIaOzTVB js+PVaHRXUKPt7cfrnKM4P+mmZ2h8w3RDiZOe9xiRmuMpG6ocEm4Z6y98Oh4F/yqcN6K PI3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si8196253ile.91.2021.05.12.05.00.32; Wed, 12 May 2021 05:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230362AbhELMBC (ORCPT + 99 others); Wed, 12 May 2021 08:01:02 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:52984 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbhELMBC (ORCPT ); Wed, 12 May 2021 08:01:02 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 14CBxnhh021106; Wed, 12 May 2021 13:59:49 +0200 Date: Wed, 12 May 2021 13:59:49 +0200 From: Willy Tarreau To: Mark Brown Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] tools/nolibc: Implement msleep() Message-ID: <20210512115949.GA20883@1wt.eu> References: <20210512114728.19015-1-broonie@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210512114728.19015-1-broonie@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 12, 2021 at 12:47:28PM +0100, Mark Brown wrote: > Allow users to implement shorter delays than a full second by implementing > msleep(). > > Signed-off-by: Mark Brown > --- > > v2: > - Support delays of more than a second. > - Return the number of seconds remaining if the delay does not > complete. But why returning the number of seconds instead of milliseconds ? The common use case is this: delay = delay_before_next_event(); while ((ret = msleep(delay)) > 0) delay -= ret; Willy