The user-space implementation of alarm gives inflated return values. It should round to nearest, except when that means rounding down to zero.
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
Fixed in CVS.
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