[英]Does POSIX standard specify what calling convention functions like read() should follow?
I know that POSIX defines a set of functions that should be present in the compliant system. 我知道POSIX定义了应在兼容系统中提供的一组功能。 These include
read()
, write()
, printf()
, and many other that we know as "libc" functions. 其中包括
read()
, write()
, printf()
以及我们称为“ libc”函数的许多其他功能。
But does POSIX enforce a calling convention for them, or it is up to OS implementors to choose? 但是POSIX是否为它们强制执行调用约定,还是由OS实现者选择?
But does POSIX enforce a calling convention for them [...]?
但是POSIX是否为它们强制执行调用约定?
No. POSIX aims to be portable. 不会。POSIX旨在便携式。 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.
如果POSIX对某些调用约定进行了强制实施,那么它将不再通用,或者必须为每种可能的体系结构定义调用约定,这是不可能的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.