DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
C compilation system

System calls

UNIX operating system calls are the interface between the kernel and the user programs that run on top of it. read(S), write(S), and the other system calls (see Routines(S)) define the UNIX operating system. Everything else is built on their foundation. Strictly speaking, they are the only way to access such facilities as the file system, interprocess communication primitives, and multitasking mechanisms.

Of course, most programs do not need to invoke system calls directly to gain access to these facilities. If you are performing input/output, for example, you can use the standard I/O functions described earlier. When you use these functions, the details of their implementation on the UNIX operating system -- for example, that the system call read() underlies the fread() implementation in the standard C library -- are transparent to the program. Therefore, the program is generally be portable to any system with a conforming C implementation.

In contrast, programs that invoke system calls directly are portable only to other systems similar to the UNIX operating system. Therefore, you would not use read() in a program that performed a simple I/O operation. Other operations, however, including most multitasking mechanisms, do require direct interaction with the UNIX operating system kernel. For general discussion about UNIX operating systems see Advanced Programming in the UNIX Environment by W. Richard Stevens.


Next topic: Math library (libm)
Previous topic: Converting characters, integers, or strings

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003