NetBSD Problem Report #57116

From www@netbsd.org  Sun Dec 18 03:04:18 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E18731A921F
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 18 Dec 2022 03:04:17 +0000 (UTC)
Message-Id: <20221218030416.8D4941A9239@mollari.NetBSD.org>
Date: Sun, 18 Dec 2022 03:04:16 +0000 (UTC)
From: yamt9999@gmail.com
Reply-To: yamt9999@gmail.com
To: gnats-bugs@NetBSD.org
Subject: misleading description about timeout in poll man page
X-Send-Pr-Version: www-1.0

>Number:         57116
>Category:       misc
>Synopsis:       misleading description about timeout in poll man page
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 18 03:05:00 +0000 2022
>Last-Modified:  Sun Dec 18 09:55:01 +0000 2022
>Originator:     YAMAMOTO Takashi
>Release:        NetBSD-current
>Organization:
>Environment:
https://man.netbsd.org/poll.2
>Description:
the man page says:

> If timeout is neither zero nor INFTIM (-1), it specifies a maximum
> inter-val to wait for any file descriptor to become ready, in
> milliseconds.

the text makes me think "it's ok to round it down".
but i believe it's the opposite.
ie. it's ok to sleep longer. but it isn't ok to sleep shorter.

see: https://github.com/yamt/toywasm/blob/42491d9274049490ee83b987498cf13430b890b0/lib/wasi.c#L811-L819

>How-To-Repeat:
man 2 poll
>Fix:

>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/57116: misleading description about timeout in poll man page
Date: Sun, 18 Dec 2022 09:51:26 -0000 (UTC)

 yamt9999@gmail.com writes:

 >> If timeout is neither zero nor INFTIM (-1), it specifies a maximum
 >> inter-val to wait for any file descriptor to become ready, in
 >> milliseconds.

 >the text makes me think "it's ok to round it down".
 >but i believe it's the opposite.
 >ie. it's ok to sleep longer. but it isn't ok to sleep shorter.

 It does not talk about timer resolution or whatever side effects
 make your program delay but about the poll(2) functionality, i.e.
 wait for a descriptor to become ready but don't wait more than the
 specified timeout.

 You could copy the BUGS section from nanosleep(2).

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2022 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.