Changed non linux portable functions. Stupid Microsoft...