Adapted to work on Linux.