From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6Op3BRwGIGBTVAAA0tVLHw (envelope-from ) for ; Sun, 07 Feb 2021 15:24:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id WLM0ARwGIGA5bgAAbx9fmQ (envelope-from ) for ; Sun, 07 Feb 2021 15:24:12 +0000 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 aspmx1.migadu.com (Postfix) with ESMTPS id 87577940309 for ; Sun, 7 Feb 2021 15:24:11 +0000 (UTC) Received: from localhost ([::1]:41934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8lv0-00059y-H0 for larch@yhetil.org; Sun, 07 Feb 2021 10:24:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8lus-00059r-FY for bug-guix@gnu.org; Sun, 07 Feb 2021 10:24:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8lus-0001As-8W for bug-guix@gnu.org; Sun, 07 Feb 2021 10:24:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l8lus-0003XM-5K for bug-guix@gnu.org; Sun, 07 Feb 2021 10:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#36380: service urandom-seed takes too long on boot References: In-Reply-To: Resent-From: raid5atemyhomework Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 07 Feb 2021 15:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36380 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: "36380@debbugs.gnu.org" <36380@debbugs.gnu.org> Received: via spool by 36380-submit@debbugs.gnu.org id=B36380.161271140713553 (code B ref 36380); Sun, 07 Feb 2021 15:24:02 +0000 Received: (at 36380) by debbugs.gnu.org; 7 Feb 2021 15:23:27 +0000 Received: from localhost ([127.0.0.1]:48489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8luJ-0003WW-3S for submit@debbugs.gnu.org; Sun, 07 Feb 2021 10:23:27 -0500 Received: from mail-40130.protonmail.ch ([185.70.40.130]:20993) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8luH-0003WK-Kq for 36380@debbugs.gnu.org; Sun, 07 Feb 2021 10:23:26 -0500 Date: Sun, 07 Feb 2021 15:23:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1612711399; bh=eZyuxTn//4XdL19o76fj1QoyY5RR/tBbR0ogsoXf2sE=; h=Date:To:From:Reply-To:Subject:From; b=q+vbe96qt2mCjRcR5t4lMZ3hc9im8riH9eWKT455CBkEDOiI4AK3pNYJzThzIYC0H 9vc7glxaZybbHZmObXga9pF203zeUY9VcOiyZ2iN9p7fEamvnY2cb2pit0vQg/Szaw 4rngbCwn3dxVPrnDtdclJHytaDSmD484pYVUDP5I= Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: raid5atemyhomework X-ACL-Warn: , raid5atemyhomework From: raid5atemyhomework via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.86 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail header.b=q+vbe96q; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 87577940309 X-Spam-Score: -2.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: qTIs1s0TSmLO ```scheme (define (get-bytevector-n-timed port count max-time) "Read COUNT octets from PORT, blocking as necessary and return a bytevector containing the octets read, and taking no more than MAX-TIME seconds. If fewer bytes are available, a bytevector smaller than COUNT is returned." (define (get-time) (let* ((pair (gettimeofday)) (secs (car pair)) (usecs (cdr pair))) (+ secs (* 0.000001 usecs)))) (let* ((start-time (get-time)) (end-time (+ start-time max-time)) (buf (make-bytevector count))) (let loop ((offset 0)) (let ((current-time (get-time))) (cond ((=3D offset count) buf) ((>=3D current-time end-time) (let ((newbuf (make-bytevector offset))) (bytevector-copy! buf 0 newbuf 0 offset) newbuf)) (else (let* ((result (select (list port) '() '() (- end-time curr= ent-time))) (readable? (not (null? (car result))))) (if readable? (begin ;; read only one byte at a time, as we cannot be sure ;; that the given port will have more than one byte ;; available and that ports will not block if we ask ;; for more than one byte. (get-bytevector-n! port buf offset 1) (loop (+ offset 1))) (loop offset))))))))) ```