Strange AGI behavior on Mac OS X

First, I’m new to Mac OS X but have been working with Asterisk and AGI for a
while. I have an perl AGI script that uses the “alarm(timeout)” perl
command to set a timer and then calls $AGI->record(…). This has been
working great on Linux. The strange behavior is that on Mac OS X, when the
alarm SIG is received the AGI read from STDIN returns early with null which
the AGI module interprets as a “noresponse” and hangs up. On Intel/Linux
this works fine. I’ve been searching and searching and can’t seem to find
any indication that this shouldn’t work the same on the Mac as it does on
Linux. I’m wondering if anyone knows more about STDIN/STDOUT on the mac and
the alarm timer and why the alarm timer might interrupt the read from STDIN?