After thinking more about this I think that the main question is why this OS dependent stuff is not abstracted away in a target-dependent class. But this must really be fixed in dmd....