read(2) is safe to call in a signal handler, I've checked W. Richard Stevens' Advanced Programming in the Unix Environment for confirmation. Of course, you would need the buffer to be allocated beforehand to use read in a perl signal handler to avoid a malloc.