read behaves different on linux