Date: Tue, 30 May 2000 13:41:53 -0700 (PDT) From: Archie Cobbs <archie@whistle.com> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/18909: select(2) timeout limited to 100000000 seconds Message-ID: <200005302041.NAA34482@bubba.whistle.com>
next in thread | raw e-mail | index | archive | help
>Number: 18909
>Category: kern
>Synopsis: select(2) timeout limited to 100000000 seconds
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue May 30 13:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Archie Cobbs
>Release: FreeBSD 3.4-RELEASE i386
>Organization:
Whistle Communications, Inc.
>Environment:
3.4-REL, 4.0-stable, 5.0-current
>Description:
select(2) returns EINVAL if the timeout is specified for
longer than 100000000 seconds.
Is this according to some specification? If so, nevermind,
but please document this limitation in the man page. As it
stands, there's nothing in the man page that indicates there
is such an arbitrary limitation.
Otherwise, it should support up to the maximum possible value
that can be specified in a struct timeval.
>How-To-Repeat:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <string.h>
#include <err.h>
void
main(int ac, char *av[]) {
struct timeval tv;
fd_set fds;
int r;
switch (ac) {
default:
errx(1, "usage: xx [secs]");
case 2:
tv.tv_sec = strtol(av[1], 0, NULL);
break;
case 1:
tv.tv_sec = 100000001;
break;
}
tv.tv_usec = 0;
FD_ZERO(&fds);
FD_SET(0, &fds);
r = select(1, &fds, NULL, NULL, &tv);
if (r < 0)
err(1, "select");
}
>Fix:
Either allow all valid struct timeval's, or else please
document this shortcoming in the man page.
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005302041.NAA34482>
