After input from Jesse Barnes, jbarnes@sgi.com here's a new patch. P.