简体   繁体   English

POSIX标准是否指定应遵循哪些调用约定函数(如read())?

[英]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.

相关问题 C 中的 printf() 使用什么调用约定? - What calling convention does printf() in C use? MSVC的C运行时中的POSIX函数是什么? - What are the POSIX like functions in MSVC's C runtime? 我应该使用什么调用约定来实现可移植性? - What calling convention should I use to make things portable? POSIX`read()`的`buf`应该被签名还是未签名? 有关系吗 - Should POSIX `read()`'s `buf` be `signed` or `unsigned`? Does it even matter? 我应该如何扩展标准功能,例如C语言中的字符串函数? - How should I extend standard functionality, like string functions in C? libgcc依赖哪些标准C函数? - What standard C functions does libgcc depend on? 管理程序与其 DLL 插件之间的调用约定兼容性的标准方法是什么? - What is the standard way to manage calling-convention compatibility between a program and its DLL plugins? POSIX标准对atexit()处理程序中的线程堆栈有何看法? 什么是操作系统的做法? - What does the POSIX standard say about thread stacks in atexit() handlers? What's the OS practice? clang 使用的调用约定是什么? - What is the calling convention that clang uses? x86调用约定:堆栈传递的参数应该是只读的吗? - x86 calling convention: should arguments passed by stack be read-only?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM