I know that POSIX defines a set of functions that should be present in the compliant system. These include read()
, write()
, printf()
, and many other that we know as "libc" functions.
But does POSIX enforce a calling convention for them, or it is up to OS implementors to choose?
But does POSIX enforce a calling convention for them [...]?
No. POSIX aims to be portable. Calling conventions are heavily dependent on the architecture as they specify the way how stack and registers are used when calling subroutines. If POSIX made enforcements on certain calling conventions, it wouldn't be universally applicable any longer, or, alternatively, it would have to define calling conventions for each possible architecture, which is impossible.