Just want to add, that I think it's fine to have two different interfaces for communicating with OS: one for C and another one for C++, just as we use new(mem_root) in C++  and we have alloc_root for C. Same for atomics.

And if we'll have to support more (older) platforms, the library stuff is easily coverable with similar compatibility layers for C++.