I understand that the C language is an ISO standard, and I can see from Wikipedia that the standard includes 29 header files, and that conforming to these header files, a C application is theoretically 'portable'.
In practice, however, I recently tried doing a tutorial on a simple C HTTP server that uses header files that aren't part of the C standard. So in this case, the simplest of applications that I can think of - a C application comprising a single int main(void)
function, and that is less than 100 lines, with the aim of listening on a network interface goes beyond the C standard?
In this case what is the relationship between the C language as a specification and (assuming I'm writing an application for Linux) the POSIX specification as a language?
As far as I can tell, "man7.org" provides a list of the C header files that define the API of all Unix/Linux systems (I'm assuming this is the same as 'POSIX') systems, as well as a list of system calls for the Linux platform.
This includes 82 header files, of which the 29 C standard library headers are a subset, and some 10 000 system calls (at least I assume that everything in this list that is NOT a head file is a system call).
I would assume that any reasonably functional program written in C would go beyond the standard library and make use of OS specific header files. Would it not be more accurate to say that programming an application to run on Linux would actually be "POSIX programming"?
I guess it would also be possible to stick to the standard library, and define custom header files for portable logic implementation across POSIX & non-POSIX systems (including platform-specific assembly routines). Is this ever done?