Portability fix for SunOS (untested)