Portability with older systems

(tested on SunOS 5.11)