#!/usr/bin/perl use Fcntl; use strict; $| = 1; my $fifo = shift; die "no fifo specified" if (not defined $fifo); sysopen(F,$fifo,O_NONBLOCK|O_WRONLY) or die "error opening fifo: $!"; print "filling up the fifo..."; my ($bytes, $total_bytes); do { $bytes = syswrite(F,"x"x1024,1024); $total_bytes += $bytes; } while ( $bytes == 1024 ); print "done. wrote $total_bytes into fifo\n"; print "now sleeping for 120 seconds... "; my $time; while ( $time < 120 ) { sleep(10); $time += 10; print "$time "; } print "done.\n"; print "checking to see if we can write to the fifo... "; print syswrite(F,"x",1) == 1 ? "yes, looks good\n" : "NO! PROBLEM!\n";