From nobody Thu May 05 13:49:16 2022 X-Original-To: freebsd-drivers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 064091AC0862 for ; Thu, 5 May 2022 13:49:45 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KvFS75wtdz3Cg6 for ; Thu, 5 May 2022 13:49:43 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1271D5C0156 for ; Thu, 5 May 2022 09:49:37 -0400 (EDT) Received: from imap45 ([10.202.2.95]) by compute1.internal (MEProxy); Thu, 05 May 2022 09:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=farhan.codes; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t= 1651758577; x=1651844977; bh=I5BDR0mEQzxoAN6qQ2VdPxfgUpxJeKyseQo 42Edi/c4=; b=VlTZfYDV3RWJeF4FWfybn2y7MFbMkIHDKBOPB2WU3xD9PkAkulz o8EX32sFU/nBWyyz7s7NyEcFZiJX/LGozjQ9ZpuxxiGqw3Lm+7UqUGsxNw+L2KWN +Lb7r6cBzsC2ECYR2WAd78h9S7jcyVzF3MunnIgE6TsBNZn8lky6h9O/xhdzO11R HwxFDn2KlnAjUXm4z7feu8RzNx0ab6XGNR8R/tIeapiw1NiQFO8tVFM8ElzGSh0R DahU78y/G+z2MRi6CIOlFUCGtx+kjUe2icCl+HKZY+ES91btHNoB8adiR87eYRLI zsy9bL2IaKNHaNsngyRUaFJ1r0DTSSqlf0A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1651758577; x=1651844977; bh=I5BDR0mEQzxoA N6qQ2VdPxfgUpxJeKyseQo42Edi/c4=; b=lb9WvKY3HVd1qc9KiKVjoNtH66mfS xkYvxI/jrVlURbXZF1hSjdOjQWJUQgObXrbDQ/wLolKSOnsSj4wl5DSs3owpf2ja 9Z/iKbaOgpk9P5RU7WGE1ovk+F3QtRdylocfxoe7eed6ya15E6l47t62xddXhfun /wYeNEGNL8GcGJ6b1BFar592mO2/0NnXymonHv05s3lMfkkAJVRU2Ni+jRy3JvvZ ufi15qSY4XWiAB239ZlTvSvNg1kc3Pyv4ZeVCFv31Hb1eU4ZQaCkHQR271VyW7jG dfreotyJXSKpkW5DpYrGSOJZQ8Nfodi8RkaRdBWoWVhtdNmTeKtyPxZIw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesrgdtreerre ertdenucfhrhhomhepfdfhrghrhhgrnhcumfhhrghnfdcuoehfrghrhhgrnhesfhgrrhhh rghnrdgtohguvghsqeenucggtffrrghtthgvrhhnpeettdekkeefgfefiedtvdelvdelie ffiefgieetveejgfetvdeukefgvdffhfdtueenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehfrghrhhgrnhesfhgrrhhhrghnrdgtohguvghs X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id C76102720064; Thu, 5 May 2022 09:49:36 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-591-gfe6c3a2700-fm-20220427.001-gfe6c3a27 List-Id: Writing device drivers for FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-drivers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-drivers@freebsd.org Mime-Version: 1.0 Message-Id: <86ee7ca4-01c3-41dc-bbe0-5e8576fa7d62@www.fastmail.com> Date: Thu, 05 May 2022 09:49:16 -0400 From: "Farhan Khan" To: freebsd-drivers@freebsd.org Subject: What is timo from sleep(9) functions Content-Type: multipart/alternative; boundary=32c607a3a28b4d87af9861527bff80df X-Rspamd-Queue-Id: 4KvFS75wtdz3Cg6 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=farhan.codes header.s=fm2 header.b=VlTZfYDV; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=lb9WvKY3; dmarc=none; spf=pass (mx1.freebsd.org: domain of farhan@farhan.codes designates 66.111.4.25 as permitted sender) smtp.mailfrom=farhan@farhan.codes X-Spamd-Result: default: False [-3.59 / 15.00]; XM_UA_NO_VERSION(0.01)[]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.25:from]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.25]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[farhan.codes:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.997]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.25:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[farhan.codes:s=fm2,messagingengine.com:s=fm1]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-drivers@freebsd.org]; DMARC_NA(0.00)[farhan.codes]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; MLMMJ_DEST(0.00)[freebsd-drivers]; MID_RHS_WWW(0.50)[] X-ThisMailContainsUnwantedMimeParts: N --32c607a3a28b4d87af9861527bff80df Content-Type: text/plain Hi all, Hopefully simple question: What is the unit of the `int timeo` parameter in sleep(9)? Is it the timeout in milliseconds? Or would 1 mean a second? Related, what does the `hz` variable mean and why is it used? I see instances of timo's in multiples of hz (ie, hz * 10). OpenGrok shows it defined in a few different places and its not clear to me which it is. Thank you! -- Farhan Khan PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE --32c607a3a28b4d87af9861527bff80df Content-Type: text/html
Hi all,

Hopefully simple question:

What is the unit of the `int timeo` parameter in sleep(9)? Is it the timeout in milliseconds? Or would 1 mean a second?
Related, what does the `hz` variable mean and why is it used? I see instances of timo's in multiples of hz (ie, hz * 10). OpenGrok shows it defined in a few different places and its not clear to me which it is.

Thank you!
--
Farhan Khan
PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE


--32c607a3a28b4d87af9861527bff80df--