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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24207 invoked from network); 11 Oct 2022 13:19:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2022 13:19:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665494390; b=qXRQoa2Vcr4Ry0UMVuztWgMXFt5jqiGlMgMF053+ztZ6HOndBuh49MQe6nxnyKzvrHe8sr/KjH YDsPetDENwS5R+Pvf0pycoAqYqlXmNdR9k5jKLbt8XFa4rxc8N0weEun9PpS06VRxD4BphXh1q 0oyRRIXtgWEfUrd0P990to8j2oBJmNUeVnhdGH+ehJ9ZYEHSbN1FBPMXBbdmZ5C8yLP56lV9lj NHX+mqf751b8z9Rtu/aLInzkzHdKixKZ4MkwVSA6jRZnAqgWSq1xYy8g59x+nXnasFcyOChTIj PfA0aC9+ocjvILRsz4rGtURKhIFbn4f+arQuo2z0i57Vzw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; 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=1665494390; bh=0KnAQQTl3iuAKCAtP5ICQYdNGvrqg62hjHu15wIhUjU=; 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=RPHYfpjE1gvBxcexQSm20BvXkWZvP9tr+VqvanUecMS0CRBhlMVupywWMRBGjx8+7wp359ll1+ lRG5d8ZUwKHpJQM0yVZi8eoaeKqIao5u41/juaYo3skRMeswZJ2ixjb1to0n6VDpuhZf2TtnD4 tgtQCsD+e1mfHaej1G6AxIOL4v10RWdgdjiIaUZgnKgLJUF/7tb1yndpc62P4HWUpojpkqBrlB WCFPYyo6V/gvHAi0puDJs+QFf74woq7lwajjyQpKdxAFWQon4uvIZBX/uG7KRDryhyz7ltlp3/ NMYg9aVQenU8ZKpH6VIrQSpsRf353RTTn9qyiVb9RvuNRw==; 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=7r9RRCMlQNQhtGQ3SyixFcYNm7PSZDBeSG7cMf0LksU=; b=lOUVruyQFiBiTM+DPdfBHedI65 5Up0YlzKbTSuCDNFUOgyQnb17fhaYVderQekJv00YLdeS/ELsOLgUqAVGp83/58Fbpn9gfje9x87O mjar18QL8e6gyaDNKAuxLiYNy8y+e0EbKFylkvg6GgJ0AbM3lJdIWAdib0a70tedxtL6PjFxdT7NH bxyXKSNYTRNwrQ80TEik9icrmu462O53xF5jtCFyQu/wyi8rRIXvG/mEzfUd5oaly07TUEgS4XEMV Aen5Kp5BMUBGZZHymHDOdkFafKbGO5v2DdTx5IhIJ2A+2zPks9anqQwbWizqGFWwgaCyyqD52qhIY t7wSxecQ==; Received: by zero.zsh.org with local id 1oiFAk-000DT6-4U; Tue, 11 Oct 2022 13:19:50 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:53804) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1oiF9s-000DA9-PJ; Tue, 11 Oct 2022 13:18:58 +0000 Received: from [212.54.57.80] (helo=smtp1.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1oiF9s-0000Wi-GE for zsh-workers@zsh.org; Tue, 11 Oct 2022 15:18:56 +0200 Received: from oxbe7.tb.ukmail.iss.as9143.net ([172.25.160.138]) by smtp1.tb.ukmail.iss.as9143.net with ESMTP id iF9soiOiPVu5XiF9soV8XY; Tue, 11 Oct 2022 15:18:56 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.138 X-CNFS-Analysis: v=2.4 cv=LNR1/ba9 c=1 sm=1 tr=0 ts=63456d40 cx=a_exe a=fsVlV1GYKS3C/xnq+HX56g==:117 a=1DWFKdCB1IcA:10 a=IkcTkHD0fZMA:10 a=ZjyAdWuDOD4A:10 a=If2VLsBYAAAA:8 a=oE74on7ZVZHb4UIkwisA:9 a=QEXdDO2ut3YA:10 a=ZCxjKSnKyCmnrEQjtP-5: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=1665494336; bh=0KnAQQTl3iuAKCAtP5ICQYdNGvrqg62hjHu15wIhUjU=; h=Date:From:To:In-Reply-To:References:Subject; b=aM5m3+8abELsYvp01/xkJRA7MWifk3YsOdBkPCLyrxkszDq2Man85b0lBepXcpYWt XZooNQta4GarU5NYevjIsvK5jDawoKjhdDIiH6ErEY3JXeEyEUKmVi11sCIHqq9frK /vNikcs98JYmT2cLGz4UMpFsbmlKBMG3NNRoZRGbBlJZjGPdBL3mdme9hWW/5BFXBu dZUo+vU7X1AMJCT5/4XudikYkBnG+XWbycup9EtW8e6oJPLUA5mgXTixvwoCsTdyFM +Zw1Rrb/Kdg1ml80Xel3EM52oCClJMBMiULgjJ1ClujZWIloymFs/qcUryF/sIGmZg 1LOGIezGp6htg== Date: Tue, 11 Oct 2022 14:18:56 +0100 (BST) From: Peter Stephenson To: zsh-workers@zsh.org Message-ID: <1046616417.2639901.1665494336416@mail.virginmedia.com> In-Reply-To: <8918db54-3687-b26e-4a04-1a8814b11f86@zentaur.org> References: <8918db54-3687-b26e-4a04-1a8814b11f86@zentaur.org> Subject: Re: use of rand() in zsh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer X-Originating-IP: 147.161.224.167 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfHWcyzQUZeJancoV5TEVY7fin9esSSYvlOQC3fh+4S1IpgU1+q4Uh09SmmVDnVj9lQyMCqZRV/PKIstMvob7gTDZeBUcJmMC4JWlgMbWv9XqxV6hf8JI KxHi7Lulw1LgwwTu1RnchUxVlSUtHHnS8+a2S7JV/Dk4A9MyFKXHEt2nydv5c4+Pljjr3B4oCOsAJv02xyilYGwNWnycJKhNEZfShiPC3ukqIn4PcIcRezWz X-Seq: 50780 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 11/10/2022 13:35 Clinton Bunch wrote: > On 10/10/2022 8:14 PM, Bart Schaefer wrote: > > On Mon, Oct 10, 2022 at 4:38 PM Clinton Bunch wrote: > >> Is there a reason that zsh goes out of the way (srand_deterministic) to > >> use the least random "random" function on modern Unix? > > > > This is e.g. so you aren't surprised by referencing $RANDOM inside > > $(...) and getting a different result. > > > Doesn't zsleep_random's use of rand() break this predictability, or have > I just not studied the use of zsleep_random enough? Yes, looks like any locking of history files will disturb the sequence. That could be fairly easily fixed on a modern system by using rand_r here --- history locking doesn't need high quality randomness, just some sort of variation, so probably isn't worth reimplementing fully. pws