Bug 626 - alarm return value rounds up rather than to nearest
Summary: alarm return value rounds up rather than to nearest
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.4
: P2 normal
Target Milestone: ---
Assignee: Roland McGrath
URL:
Keywords:
Depends on:
Blocks: libc235
  Show dependency treegraph
 
Reported: 2004-12-29 09:14 UTC by Roland McGrath
Modified: 2019-04-10 09:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland McGrath 2004-12-29 09:14:11 UTC
The user-space implementation of alarm gives inflated return values.
It should round to nearest, except when that means rounding down to zero.
Comment 1 Sourceware Commits 2004-12-29 09:17:43 UTC
Subject: Bug 626

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	roland@sources.redhat.com	2004-12-29 09:17:27

Modified files:
	sysdeps/unix   : alarm.c 

Log message:
	2004-12-29  Roland McGrath  <roland@redhat.com>
	
	[BZ #626]
	* sysdeps/unix/alarm.c (alarm): Round return value to nearest rather
	than always up; when nearest is zero, round up to one.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/alarm.c.diff?cvsroot=glibc&r1=1.5&r2=1.6

Comment 2 Jakub Jelinek 2005-01-11 10:22:49 UTC
Fixed in CVS.
Comment 3 Sourceware Commits 2005-02-16 09:26:56 UTC
Subject: Bug 626

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_3-branch
Changes by:	roland@sources.redhat.com	2005-02-16 09:26:39

Modified files:
	sysdeps/unix   : alarm.c 

Log message:
	2004-12-29  Roland McGrath  <roland@redhat.com>
	
	[BZ #626]
	* sysdeps/unix/alarm.c (alarm): Round return value to nearest rather
	than always up; when nearest is zero, round up to one.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/alarm.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.5&r2=1.5.4.1