From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25215 invoked from network); 27 Apr 2022 09:34:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Apr 2022 09:34:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651052078; b=ryxSunGP6r2wgQ0/WY+fqhrKHPag0SyXcs+YQiaR6jMzljXobEJjYCSY2+NV6kI0q5/GjZwKXs 3vYYbHjjkCu0S7+tEonW5J7Ws+1vvEaO9TdJBCvDcQ6AB/6BtomwaBKFjWJt4JDTNlqoeQbzpt USNfl3yxy+IdoalXVhPPfTI78A/pV1pzc7ershpKmS6mEQtkb5xeoStgPjbnirc9RlMft38dIg J+oPQ7RGRIURPWcHrR/Pi4/5VekKtMNAS10mEIQFuTCVd7rd54R4Me4UtL5wGU3vOQMDLfmRi+ RRW0rrpaYWoO6mmUyykpum7ShMrybqrHc9x6i76yFgnxPg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1651052078; bh=wLAvHona+sMdVaDAoPNaNYf6CR5FCmnWgHWRzZxnL1g=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=dULP8xcjtce95Ao73UXpqG7A74sevxp6EO2Kd3I2isrEI2aYGqSEVVJ/RG5wwC4Knhz5uFkHkM zPjW6dsEGI5sawgnn2pRF7emNRUnqd7YVoUtwCUnblLL+SFcNwZAXembDM/R+WCkhSZD2gI/YK egc7knZBxxBuiPfGQoi5pngzAplPM5WywwTsfFMGbu6JfXCVOgMBURoYQ8cCnfGcAO+A2I1AOE 7MbWjnsSdhkinhf6ZlMM/TkKJvdApCuuEvM2oiLi7OBJElV8ffPsiN/UmBBnCxOoRa9rV1RTPz maoDPjxSOD//WDCTk96lA1KxPnpzp+9PqB3ihlHf/Lc64A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=deNtvX72y7Betqh/uZ3Z8fF4yKz2fjOEKMNw/d25NOo=; b=FTF8kOz5XFYGNTzgEhzp9oqe57 FvphmyKr1i/EOpcCLk1ZUTnV0jHLSK4ldsAfK7ZVCgoBMDGexMuSaMQ3MeHtFTdVTct9+a+4cODHD JcfW6ca6yT0/DTuZEPbrIQs4jRHwOCsqwe1ZB6EOMYqgxjxe0iQw11P7+6VrzKYRJFnAIi5G46F7u +x6FL9PFVhwJqa21fXQjbnBITKfsEoSQmEjSw/W6dniXotqHldzzVeLrYgYmtSmmNOAYpEqv/gxuu QjBvkSmfbNdz/l0KQoGAMBS5Y9rTdLAPF0oUk11EInkmzQKSTlCroWsOuS3blRGBcgnsAtZL4quuE vHB32QQQ==; Received: from authenticated user by zero.zsh.org with local id 1nje4C-0006vq-GD; Wed, 27 Apr 2022 09:34:36 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq2.tb.ukmail.iss.as9143.net ([212.54.57.97]:43612) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1nje3y-0006aL-G3; Wed, 27 Apr 2022 09:34:23 +0000 Received: from [212.54.57.80] (helo=smtp1.tb.ukmail.iss.as9143.net) by smtpq2.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1nje3y-0005k0-97 for zsh-workers@zsh.org; Wed, 27 Apr 2022 11:34:22 +0200 Received: from oxbe3.tb.ukmail.iss.as9143.net ([172.25.160.134]) by smtp1.tb.ukmail.iss.as9143.net with ESMTP id je3xnxAxPg8Lgje3yntPLL; Wed, 27 Apr 2022 11:34:22 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.134 X-CNFS-Analysis: v=2.4 cv=cOTzD3SN c=1 sm=1 tr=0 ts=62690e1e cx=a_exe a=rX2mKgs1IZJU9lF6pltyEQ==:117 a=I_Av47A-8eYA:10 a=IkcTkHD0fZMA:10 a=vinPr5In5y8A:10 a=q2GGsy2AAAAA:8 a=lp6CGZVK8dDbOxU8f6QA:9 a=QEXdDO2ut3YA:10 a=z9dJwno5l634igLiVhy-:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1651052062; bh=wLAvHona+sMdVaDAoPNaNYf6CR5FCmnWgHWRzZxnL1g=; h=Date:From:To:In-Reply-To:References:Subject; b=LyFtoBKoY65V9hhffyHCD0FmEJSBd66DW4Hb3rC2dPt6T8nFl6Iwn52daUZJ4DO/n knNtSZR7fYq+VIbalLNYG1W4GKyXkCguBIV+W9t+3qd9cdvqttOrcthpcnCpn0Au8F T3nZLdPdC2tMaU1Ye75URUFzZ6pUDKuTM52sWae3slUnRiV96czQQ5O/WRAvw+qRLU mjWzgZwxiyF+k9rAJ34bXsHhOO4oVVF06aU9uBn4ylh+zQQMfgRMMpUIUJyJhwtxyv HQhcmkAB243RHGbMPZ7PcX6UZifNMeonnZ7Uvb9vDV5uC9dSa6qjs98Gg/NMUcEDDw flTPIdO1zpjgg== Date: Wed, 27 Apr 2022 10:34:21 +0100 (BST) From: Peter Stephenson To: Zsh hackers list Message-ID: <632293647.60210.1651052061990@mail2.virginmedia.com> In-Reply-To: References: <20220425192036.p6awbyro2a2lp7bq@chazelas.org> <7E5CB0D9-4740-486A-B55E-6EA0530532F9@kba.biglobe.ne.jp> Subject: Re: ZSH performance regression in 5.8.1.2-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 165.225.17.146 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfD1jAGxlP1XeVFLM6K4HS6WJ2wyr+kEGoRzpExYwWANUWlhu2clu5alCXU0MY3TV8ZJxFnX1IGb142sqZBFOaC2Q70pb5QzVfBfsPr2ViOrtkrRMpyGy YI+FCjJKR1QZpAcKHnu7ruPitArTKdspbReGWRYpbI6SlkTBdcVzINz1NLD1ScEjfu94HlojKn2nwxegq6N7Up/shfQAfR69/CF0pCiuMAW7IhxTe6xTptsK X-Seq: 50113 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: > On 27 April 2022 at 01:38 Bart Schaefer wrote: > On Tue, Apr 26, 2022 at 7:37 AM Jun. T wrote: > > > > But at least on my Mac the following seems to work also: > > > > if (lseek(SHIN, 0, SEEK_CUR) == 0) > > rsize = SHINBUFSIZE; > > > > # Have you found a case in which lseek(SHIN, 0, SEEK_CUR) fails > > # when it shouldn't fail, or does not fail when it should fail? > > I was pretty sure I'd found a case (on Ubuntu 20.04) where it > succeeded on a pipe when there was already data written to the pipe > before the seek was attempted. That was only/exactly for (0, > SEEK_CUR). A simple test for this still caused the seek on the type to fail here, but I could be missing the key elements. Should still be a safe test with only a few bytes in the pipe, I would think. pws #include #include #include #include #include int main(int argc, char **argv) { int pipefd[2], fd; if (pipe(pipefd) < 0) { printf("creating pipe failed\n"); } else { char stuff[9] = "abcdefgh"; write(pipefd[1], stuff, 8); if (lseek(pipefd[0], 0, SEEK_CUR) == (off_t)-1) { printf("lseek on pipe failed\n"); } else { printf("lseek on pipe succeeded\n"); } } close(pipefd[0]); close(pipefd[1]); fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) { printf("creating UNIX domain socket failed\n"); } else if (lseek(fd, 0, SEEK_CUR) == (off_t)-1) { printf("lseek on UNIX domain socket failed\n"); } else { printf("lseek on UNIX domain socket succeeded\n"); } close(fd); fd = open("seekfiletest.tmp", O_CREAT); if (fd < 0) { printf("creating file failed\n"); } else if (lseek(fd, 0, SEEK_CUR) == (off_t)-1) { printf("lseek on regular file failed\n"); } else { printf("lseek on regular file succeeded\n"); } close(fd); return 0; }