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.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_HI,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 C40171F5AE for ; Fri, 14 May 2021 10:43:23 +0000 (UTC) Received: from localhost ([::1]:33092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhVHu-0003Go-U2 for normalperson@yhbt.net; Fri, 14 May 2021 06:43:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhVHs-0003Gg-Cb for bug-gnulib@gnu.org; Fri, 14 May 2021 06:43:20 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.21]:36833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhVHq-0004Lt-8W for bug-gnulib@gnu.org; Fri, 14 May 2021 06:43:20 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1620988994; cv=none; d=strato.com; s=strato-dkim-0002; b=riSHXG4WXSq7vlwhmb3yWt8vB1S7qNDi0HcZFS/Dqjw9Ogfh9GqMAXTIJbZsk78Eux LQh8jGZRaaJC+0ocdHoa1A7av/4g2FjiwUeZIf4DV4UtIRe+1WQ12LARtEfE6X03UC3T sX8vKYM+UaxJefR798c+nm4YSeImuFlFNuQuKRh4SDJvlGZOmJ5mfzRocKJl7k+a2O26 ks4lIGQ+5bL+t/rOYoEnsFaIsZkOP0DG1vEOZYk3GqNKRe2Or2SSl5CqOgbcVahnQsfS V84otozk68RVF5Ebf8fmldORB67awr0LoSFFGXtyJDu/nZ2JaAkLTsNLVyOmm6iHbG1x 3RAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1620988994; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=A522ql/jnxKuc4N0LCCmmu0sIBwfD89hGW4vdJ2QkHs=; b=Bzt0KLhWBgua6Rc1o/DRq9u5ScEHLmf7VBLf38vmKtpK5ZSEq4foXg8uSHyZw3RyWv 5opTtxVZSahAKouwqUEd/qlF2W3o1H8an82d9G6dNzyFA+O1zuHylRcVoNvr8VH4cvLZ sjDfeAHUdkVr21rKt++bA/RhvLAQhCyRKAFl6NGN0mHyCHv6VH2B+xz6sMFm4GzUS0Xw 4mIvcE7XcHqlBnfcYquQPXi91n1Semdkc4BFIeMv66QF/T8bUShomc1TAkCJn6pXsmYt ZcNJTocuoNyJWlMxUlOnSHTQXimKCQx1OfjvdvUAzslUoEDQtjl+KXHNRMTnwQgIHss7 7qvw== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1620988994; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=A522ql/jnxKuc4N0LCCmmu0sIBwfD89hGW4vdJ2QkHs=; b=rxzVNFiG/gsBHEVPPBeHq5/4KMRyUH0xUMs5B9q/MswsKxarArtcWO+qWcoSXitXO2 +Sk2Ia7neK7LLgiqe8gU/XtQ1ZnBFiBIIo6E3Xz42xaSCp++1m1lNi2NvfBknX6OZH3z A+Au3c4EHkmrSZ0tK+BMz4SeMZfXLsW2s2eMnCfh46HsVDvmjMuhmqIMPZwF5tEM5chD Mb8O1ZJ2L/WSY3jQaxJSU8sPHDX3leaIlFIBmw/VDRnRmvuzXOEyJU2PlIN42I2P7LYu Wz31mK+UzqJTYAGua7ih7AZEmdLtpLwc0uIt9Z94+HiS3GKd3AR79/BT+Fx9yrOkTjUs U2Pg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqf3z5NW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.25.7 DYNA|AUTH) with ESMTPSA id 20119fx4EAhEE4l (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Fri, 14 May 2021 12:43:14 +0200 (CEST) From: Bruno Haible To: Bastien ROUCARIES Subject: Re: Portabilty of poll trick Date: Fri, 14 May 2021 12:43:13 +0200 Message-ID: <2934918.8a3MQ3Grrs@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <2051587.bS8k0qy9eM@portable-bastien> <1632993.5ns3uf8gxi@omega> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.21; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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" Bastien ROUCARIES wrote: > - 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 Yes, close() in multithreaded applications needs to be done carefully, to avoid that unintended operations get done to the next file that is connected to the same file descriptor. However, I don't see how a library / abstraction can help here. It's just careful coding of the application that is needed. Bruno