Hendrik Visage wrote: > > > >> 1. Can the system calls provided by the kernel be considered an API? > > > > > > > > System calls aren't strictly an *application* programming interface. > > > > Applications are supposed to use the libc functions. > > > > > > OK so is it at least a "programming interface"? > > > > Yes, although it's intended to be used solely by libc. > > I think the "more correct"(TM) explanation would be that: > > Each hardware architecture, and OS, will have different methods of > invoking the actual system call. So from memory Linux and FreeBSD uses > different methods to initiate a syscall. Althought > the man read(2) "api" from the libc "user"'s perspective are all the > same (specified by POSIX etc.) the nitty gritty of getting into the > kernel differs. There's slightly more to it than that. Some of the library functions which interface to system calls do more than just invoke the corresponding system call. E.g. some functions are overriden in the pthread library to add cancellation points. Also, readdir() has historically been a system call. Linux has a readdir system call, but the readdir() function is built atop the getdents system call for efficiency (getdents returns multiple entries at a time, which reduces the number of context switches required to scan a directory). -- Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx> - To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html