From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 94F031F5AE for ; Tue, 27 Apr 2021 22:47:12 +0000 (UTC) Received: from localhost ([::1]:59380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbWU3-0007jc-JN for normalperson@yhbt.net; Tue, 27 Apr 2021 18:47:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbWTw-0007iz-Eh for bug-gnulib@gnu.org; Tue, 27 Apr 2021 18:47:04 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:43914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbWTu-0001XV-Gd for bug-gnulib@gnu.org; Tue, 27 Apr 2021 18:47:04 -0400 Received: by mail-lf1-x12e.google.com with SMTP id y4so55888982lfl.10 for ; Tue, 27 Apr 2021 15:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wfmPvUlxrKu5SD2x6/S3EzSYFpFeW3ImdHqAqH83r6s=; b=N6o6hFFZkjicrVqXDAj327F54J5E/AJYUlhh1zaBLGFKP1irSOm2mFnCDA5od3Yrp8 nXfKLVbBzKM5eNV/CktlNgBaIEmv3I3n2uZTMpcyo05Bod0DfEK8XwM9oQXqPj/3tgE6 RdyzeE4y/jFel/1IeIlms5cwr0hQm028IxWkRQsNgFPY1+pQwqVo0qv/gQM4hJxqpnc5 2YMNwtdtvOmQogkXIkhKWNXxdi9/jFJvRcLkeeXRrBwhX+dZj51imMM1BUSmF7H8iYAM dos1rFQ7f0zBF82O02n/Rk9BGjqUCjGbpCeoW/Yz+cfinCl74153/+DE3k5/++mdK4tl veFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wfmPvUlxrKu5SD2x6/S3EzSYFpFeW3ImdHqAqH83r6s=; b=A5muINpRpO03qGHrFbPtRMPhRNhj1AbpMiQdjUCVVx5MAv7fxM6V58WtnN2SDghfQ7 i/YZLHNNVstttmxyUmoroyagkpiouAfe0TISPOFOORYOOa9qiDNzuL9nA+mn8BuRIWnF 9ltsjJc7JSYCl5+6FhaXSfo5gJUqtLj940viOUVpoODpYOFkRjETeMNo2o90M8IYxkOg 0q5WkYN0NmmxsRnm6FtGBMgz7/C/wgd++64BaRe3qlK2p8gtmam7y8lQuAguRZWMtlYe P3duO5xRUg+mDHeQ8wSrxrWldAM3KQOFvYRIvC3ISByKRwoHM2OQ50kUYqFBAFGPbxCk TBGg== X-Gm-Message-State: AOAM5339eIt5gc0HIZ92zJGs/og7F5BVN0t02BN2rMes5q6cI1rNq2bj W0U6iYbPsFiveWkTsKH/FZKk3e7Ff+wapRNs7qg= X-Google-Smtp-Source: ABdhPJzJm9pgbs5qCyJiFguUjAVzpRIwOb+r4S6aGe5DPBQ2tmCO6Ik5HvD/Ziudyjw4cMzuCEKCT8Od5U+rv4zNoHg= X-Received: by 2002:a05:6512:90c:: with SMTP id e12mr19274233lft.449.1619563619582; Tue, 27 Apr 2021 15:46:59 -0700 (PDT) MIME-Version: 1.0 References: <2051587.bS8k0qy9eM@portable-bastien> <1632993.5ns3uf8gxi@omega> In-Reply-To: <1632993.5ns3uf8gxi@omega> From: Bastien ROUCARIES Date: Tue, 27 Apr 2021 22:46:31 +0000 Message-ID: Subject: Re: Portabilty of poll trick To: Bruno Haible Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=roucaries.bastien@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Blake , bug-gnulib , Michael Kerrisk Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Le mar. 27 avr. 2021 =C3=A0 22:40, Bruno Haible a =C3=A9c= rit : > > Hi Bastien, > > > I want to assess the safety and portability of the following trick, > > I would want to help you with this, but I can't. You have not stated: > - What is this code supposed to do? I want to shutdown (2) a pipe, in a multithread application, in order to get out a poll(2) wait state > - Why is it a "trick"? What advantages does it have compared to the cod= e > a na=C3=AFve developer would write? The naive delevopper will: - close the end of the pipe, but it does not break poll(2), and moreover in multithread context it is not safe due to fd reuse -use timeout but in this case why use poll... The goal is also to shutdown an eventfd but without kernel support, I suppose it is not possible... Bastien > > > > > for getting outside poll. > > I don't understand what you mean here. > > Bruno >