There's even a handy table to express syscall compatibility across all of Cosmopolitan's targets - https://justine.lol/cosmopolitan/functions.html
A language can't direct the rest of the universe to ensure that something always works regardless of the environment or context.
But it can avoid adding it's own limitations and be agnostic itself. So c is very portable, even though c on machine A has acces to machine A features and not machine B features.
Libraries and frameworks and standards just help a little for a few common cases but they are just travel power plug adapters, not pprtability.
If this is some OOP propaganda then I'm sorry but you got duped and the c++/qt community should act more professionally.
Of course you can always say "real programmers do not write ... blablabla" (in other words No True Programmer fallacy) but this is not solving anything, isn't it? I mean, let's make a sufficient abstraction that will allow real cross-system development?
One might extend the goals a bit, and include POSIX, and even then, only works if the set of target systems support POSIX, and finally if the implementation defined semantics happen to agree, and not cause random surprises.
I started my professional career as a C++/Qt developer. There was this code to disallow multiple application instances using named pipes. It used named pipes under both Linux and Windows - just create a named pipe "my-program-pipe" and it was a signal for other starting up instances to communicate to it "please put the main app on top" and close.
On linux it worked like a charm. On Windows it worked like a charm...
...only first time. The code was written to "try create a named pipe and if failed - then it means it exists, so write to it instead and exit". This "try create" operation on windows failed but also removed the original existing pipe, thus allowing the third instance to coexist with the first one.
What I mean - Operating Systems are more than this, you cannot write a truly portable application without knowing them all. And especially those quirks that differ...