System calls and libraries

System calls

System calls are the interface between the kernel and the user programs that run on top of it. The system kernel is the software on which everything else in the UnixWare operating system depends. The kernel manages system resources, maintains file systems and supports system calls. The system calls provide the basic system services upon which the entire system is built. Strictly speaking, they are the only way to access such facilities as the file system, interprocess communication primitives, and multitasking mechanisms.

Most programs do not need to invoke system calls directly to gain access to these facilities, but use library functions instead, which use the system calls to access system services. When you use such functions, the details of their implementation are transparent to the program. For example, the system call read underlies the fread implementation in the standard C library. Because of this, the program will generally be portable to any system with a conforming C implementation. (See the Programming in standard C and C++ guide for a discussion of the standard C library.)

In contrast, programs that invoke system calls directly are portable only to other UNIX or UNIX-like systems; for that reason, you would not use read in a program that performed a simple input/output operation. Other operations, however, including most multitasking mechanisms, do require direct interaction with the UnixWare system kernel. These operations are the subject of the first part of this topic. The following sections list the system calls in functional groups, and includes brief discussions of error handling.

A C program is automatically linked with the system calls you have invoked when you compile the program. The procedure may be different for programs written in other languages. Check the Programming in standard C and C++ guide for details on the language you are using.

Next topic: File and device I/O
Previous topic: Using command line arguments to set flags

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004