Resource Management
Communication
CIT 595
A view of OS Services
User Interface
System Call
CIT 595
CIT 595
S t
System
calls
ll are also
l quite
it complex
l
CIT 595
CIT 595
JJustt needs
d to
t obey
b API and
d understand
d t d
what OS will do as a result call
Most details of OS interface hidden from
programmer by API
Returns
R
t
tto the
th TRAP and
d
Returns to the library function and
Returns to you
CIT 595
CIT 595
File Descriptor
flags and
fl
d mode
d arguments
t specify
if how
h
you would
ld lik
like
to use it
Th
Three
file
fil d
descriptors
i t
predefined:
d fi d
CIT 595
10
CIT 595
CIT 595
11
CIT 595
12
CIT 595
13
CIT 595
14
15
Operations that are specific to a particular kind of device use a file descriptor
CIT 595
CIT 595
perror
man s# functionname
2: System calls
3: Library calls
fd = open("in1", O_RDONLY);
if (fd < 0) {
perror(open syscall failed because");
exit(1);
}
CIT 595
Keyword search:
man -k regexp
Examples:
man -k memory
man -k locate.*string
Unix Specification:
http://www.opengroup.org/onlinepubs/009695399/
17
CIT 595
18