From nobody  Mon Dec  7 12:16:45 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id MAA10740;
          Mon, 7 Dec 1998 12:16:45 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199812072016.MAA10740@hub.freebsd.org>
Date: Mon, 7 Dec 1998 12:16:45 -0800 (PST)
From: z@rentaboat.se
To: freebsd-gnats-submit@freebsd.org
Subject: Problem with alarm(3)
X-Send-Pr-Version: www-1.0

>Number:         8998
>Category:       misc
>Synopsis:       Problem with alarm(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec  7 12:20:00 PST 1998
>Closed-Date:    Wed Dec 9 23:15:09 PST 1998
>Last-Modified:  Wed Dec  9 23:16:11 PST 1998
>Originator:     Zs
>Release:        FreeBSD 2.2.7
>Organization:
>Environment:
FreeBSD <fqdn> 2.2.7-RELEASE FreeBSD 2.2.7-RELEASE #0: Wed Oct 21 15:42:
16 GMT 1998     z@<fqdn>:/usr/src/sys/compile/<HOSTNAME>-KERN i386
>Description:
The manual for alarm(3) states that the maximum number of seconds
allowed is 2147483647, but alarm() calls setitimer() which accepts
only 100000000 seconds.

>How-To-Repeat:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int
main(void)
{
	(void) alarm(100000001);
	if (sleep(1) != 0) {
		(void) fprintf(stderr, "Sleep got interrupted\n");
		return EXIT_FAILURE;
   	}

	(void) printf("Seconds left of the timer: %u\n", alarm(0));

	return EXIT_SUCCESS;
}
>Fix:
Change the limit stated in the man page to 100000000, and in
/usr/src/lib/libc/gen/alarm.c, check if the caller has specified
a larger value and return -1 if so.
>Release-Note:
>Audit-Trail:

From: Allen Campbell <allenc@verinet.com>
To: freebsd-gnats-submit@freebsd.org, z@rentaboat.se
Cc:  Subject: Re: misc/8998: Problem with alarm(3)
Date: Wed, 09 Dec 1998 23:59:03 -0700

 The alarm(3) man page was corrected in rev. 1.4.2.3.
 
 setitimer() returns EINVAL when an interval is out of range (i.e.
 >100000000) and alarm() returns -1.
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Wed Dec 9 23:15:09 PST 1998 
State-Changed-Why:  
As Allen stated this was merged into -stable by Jordan in revision 1.4.2.3. 
Thanks for pointing this out Allen! 
>Unformatted:
