From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id EAF1938708C3 for ; Sun, 14 Feb 2021 15:14:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EAF1938708C3 Received: by mail-pl1-x629.google.com with SMTP id d13so2346235plg.0 for ; Sun, 14 Feb 2021 07:14:48 -0800 (PST) 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; bh=xzmdaid3vpSFR9g0x63K59p1dScz/aSUJPGZjTI3Uqs=; b=RftLjjYaJTlBIZHOlsE3iLoj9I3qM3/L78oWjeqehUmH4jIONoVhcsqTVItOv0aIZa kUvLwnCFEcUFPCEcKKmnZeW8hh07w5nsDVSm6/GDbkPd5pJa0/4b0yQ8Aq7wtb0t3QhR NxWmgk9KoUpzmPVuI8qfJnFnsakbJLc7CgYM88WTLShRck8VtcSFEumY25TtzrMnSGXJ ixQ1j7BoitXR6XgkI4uWHWSGj+SApDmXrbwQF38Qr4it9pWJMLiCSFzgrue+eLKM9hb2 4a2t75d2T0i+4J/q6ir20xV0AlKO5RhgOeThIJH2ruiJPiTUDiO/ud+gAc/cHDJ53XTD II0g== X-Gm-Message-State: AOAM531/FxUiytP9+umb/nmV3jaTrZJho59mdYEv5v8lqTcF9XE0l5RE uxtLqEZyzH1/dY3egWLY7DfRtF5pcWpN2mxkhWz8Y0EA9Rr2iQ== X-Google-Smtp-Source: ABdhPJyiXpMVPh2XYLLP3qHpw5puqXzYQ1LQJ+KJS24HijWfc9rvTdHK3W1JvO87qC0QESQRwY05//2lcigBQEg1msQ= X-Received: by 2002:a17:902:b103:b029:e3:5480:6b74 with SMTP id q3-20020a170902b103b02900e354806b74mr1141650plr.4.1613315688071; Sun, 14 Feb 2021 07:14:48 -0800 (PST) MIME-Version: 1.0 References: <000830b6-1cf0-6349-5667-a5af6894ac1b@web.de> In-Reply-To: <000830b6-1cf0-6349-5667-a5af6894ac1b@web.de> From: Godmar Back Date: Sun, 14 Feb 2021 10:14:37 -0500 Message-ID: Subject: Re: (stat(...) == -1 || faccessat(...) == -1) && errno == EINTR ?!?? To: Tobias Bading Cc: William Tambe via Libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, PLING_QUERY, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 15:14:50 -0000 Tobias, my assessment would be that this is the wrong email list - what you describe, if correct, would be a kernel bug. Specifically, inside the kernel, most system calls are restartable (and should be restarted if `SA_RESTART` is given), but occasionally you find a place where the kernel implementor decided that they can't restart the system call, in which case `EINTR` is propagated to user land. I've encountered this personally in the past with `tcsetattr()`. Now whether it is indeed impossible for the implementor to safely restart the call or not depends on the specific implementation details (and path taken through the kernel). Your choices are, in my opinion: - to handle `EINTR` in user mode - to file a bug (and propose a fix) against the kernel. You'd need to look in https://github.com/torvalds/linux/tree/master/fs/cifs for places where they set something to `-EINTR` and then fail to turn it into `-ERESTARTSYS` and do not have good reason to do so. I suspect this would require in-depth knowledge of the cifs file system code. Bringing up POSIX may not be the most fruitful course of action, and asking for compensation in the C library (as in doing an automatic restart in the C library system call wrapper) is generally not a good idea to my knowledge. My 2c. - Godmar