From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8835 invoked by alias); 10 Feb 2020 20:57:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 8751 invoked by uid 89); 10 Feb 2020 20:57:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qt1-f194.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QD5xp7VT+medhXMNpJBqEGutXmv+H4La0F3mBFAsckA=; b=TBe2M3LG+1LPhQv75L23X6HTfmyBiNRoYKbQRHZS1Gnip6DLDTAR3b3OQecdUGGMry amjy6AbRJejWTe+Y+69E3hk4EgPyfGV5ryAbx1WA3+5qMroLhHzbvCOWxnv/ZivWRGaQ hfJYvh/+ss8VwchrZvZ29zmu0sDyMd4s+mI/rHmiQQxoUIJ2m/6y8PM/m5mR8seu2VhU maF//CkCa0SUNq5Iqn2AOIDUnEvFmUgTJUKv4GeaBudsKK6yWRKA/Pv8sxd4kqXW3sRu 2henRNU0yMoH6xwmwcJlevy1zE4QUku8U67Ml2cPnsUTq5rSHex230bf+wGN0kCupQCX 3zQg== Return-Path: Subject: Re: [PATCH 1/5] Add internal header file To: Florian Weimer Cc: libc-alpha@sourceware.org References: <691b5b8d18c29b5c31de804b8393a1b9718e1a1d.1579631655.git.fweimer@redhat.com> <87v9oez03z.fsf@mid.deneb.enyo.de> From: Adhemerval Zanella Message-ID: <70b34e7e-79e1-e902-3b46-0c6dda4189f0@linaro.org> Date: Mon, 10 Feb 2020 20:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <87v9oez03z.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-02/txt/msg00315.txt.bz2 On 10/02/2020 16:57, Florian Weimer wrote: > >>> + /* Wait for a file change. Depending on file system time stamp >>> + resolution, this subtest blocks for a while. */ >>> + for (int use_stdio = 0; use_stdio < 2; ++use_stdio) >>> + { >>> + struct file_change_detection initial; >>> + TEST_VERIFY (file_change_detection_for_path (&initial, path_file1)); >>> + while (true) >>> + { >>> + support_write_file_string (path_file1, "line\n"); >>> + struct file_change_detection current; >>> + if (use_stdio) >>> + TEST_VERIFY (file_change_detection_for_fp (¤t, fp_file1)); >>> + else >>> + TEST_VERIFY (file_change_detection_for_path (¤t, path_file1)); >>> + if (!file_is_unchanged (&initial, ¤t)) >>> + break; >>> + /* Wait for a bit to reduce system load. */ >>> + usleep (100 * 1000); >>> + } >>> + } >> >> Ok, although the usleep seems excessive large (the testing will most likely >> timeout prior usleep return). > > Hmm, I thought that this would wait 100 milliseconds? So the loop > should exit in a second or two with low-resolution timestamps in the > file system. > Right, it should be ok then.