Added hopefully portable support for linux.