APIs and ABIs

Neal H. Walfield neal at cs.uml.edu
Sat May 15 17:18:29 UTC 2004

> Both the GNU and BSD C libraries offer the same API's eg; size_t 
> fread(void *buffer, size_t size, size_t count, FILE *stream). Both 
> use the same compiler (GCC) and so therefore that API will convert 
> into the same ABI eg; _fread using the same parameter to stack 
> conversion mechanism (the procedural call convention).

That is complete and utter crap.

The ABI has nothing to do with the compiler: calling conventions,
etc. are established by the operating system.  Nothing guarantees that
posix defined structures have the same layout or even size (and this
is very much part of the ABI).  Not all posix functions are actually
functions, many of them may be macros.  The list goes on and this does
not even consider versioning schemes, library dependencies or system
trap calling conventions.

More information about the Discussion mailing list