GNU and BSD portability issue