Why not a compile-time error, respectively only declare the function on operating systems that support it?