Академический Документы
Профессиональный Документы
Культура Документы
UNIX History
Bell Labs Research
(Ken Thompson) Very simple,
PDP-11
MINIX 1990
“Standard”
UNIX
LINUX 1991
UNIX Design Principles
VI sh pico
open( ), read( ), close( )
a.out write( )
fork( )
hardware
who System
UNIX kernel calls
cc
Application C compiler
programs
Unix Interface
In Windows
System calls and C library functions
Subject Win32 UNIX C library Comments
System Calls
Layered Structure of UNIX
User programs
Library System
User Program
function call call
Interface to
library
functions Library
Without functions
Code of a trap to the
function kernel With a trap to
Interface the kernel
to kernel
Kernel
Main code of a
Hardware system call
Codes for
other system
calls
Example: getpid System Call
non-negative , if OK
Return Value =
-1 , not OK
#include <stdio.h>
extern int errno;
void perror(const char *message);
Section Contents
1 User commands (Shell commands)
2 OS services (system calls)
3 Library functions
4 Devices, networks, interfaces
5 System file formats
6 Demo programs
7 Miscellaneous (ASCII, etc )
8 System maintenance
Check the Man Pages (very helpful)
Exercise
1. Print all:
¾ Command line arguments
¾ Environment strings