466
|
1 <chapter>
|
|
2 <title>C System Calls</title>
|
|
3 <para>
|
|
4 This section of the C compiler manual is a guide to the system
|
|
5 calls available from C programs.
|
|
6 </para>
|
|
7 <para>
|
531
|
8 It is <emphasis>not</emphasis> intended as a definitive description of OS-9 service
|
|
9 requests as these are described in the OS-9 System Programmer's
|
|
10 Manual. However, for most calls, enough information is available
|
466
|
11 here to enable the programmer to write systems calls into programs
|
|
12 without looking further.
|
|
13 </para>
|
468
|
14 <para>
|
|
15 The names used for the system calls are chosen so that programs
|
|
16 transported from other machines or operating systems should compile
|
|
17 and run with as little modification as possible. However, care
|
|
18 should be taken as the parameters and returned values of some calls
|
|
19 may not be compatible with those on other systems. Programmers that
|
|
20 are already familiar with OS-9 names and values should take
|
|
21 particular care. Some calls do not share the same names as the OS-9
|
|
22 assembly language equivalents. The assembly language equivalent
|
|
23 call is shown, where there is one, on the relevant page of the C
|
|
24 call description, and a cross-reference list is provided for those
|
|
25 already familiar with OS-9 calls.
|
|
26 </para>
|
|
27 <para>
|
|
28 The normal error indication on return from a system call is a
|
|
29 returned value of -1. The relevant error will be found in the
|
|
30 predefined int "errno". Errno always contains the error from the last
|
|
31 erroneous system call. Definitions for the errors for inclusion in
|
|
32 the programs are in "<errno.h>".
|
|
33 </para>
|
|
34 <para>
|
531
|
35 In the "See Also" sections on the following pages, unless
|
468
|
36 otherwise stated, the references are to other system calls.
|
|
37 </para>
|
|
38 <para>
|
|
39 Where "#include" files are shown, it is not mandatory to include
|
|
40 them, but it might be convenient to use the manifest constants
|
|
41 defined in them rather than integers; it certainly makes for
|
|
42 more readable programs.
|
|
43 </para>
|
466
|
44 &abortref;
|
|
45 &absref;
|
|
46 &accessref;
|
|
47 &chainref;
|
|
48 &chdirref;
|
|
49 &chmodref;
|
|
50 &chownref;
|
|
51 &closeref;
|
|
52 &crcref;
|
|
53 &creatref;
|
|
54 &defdriveref;
|
|
55 &dupref;
|
|
56 &exitref;
|
|
57 &getpidref;
|
|
58 &getstatref;
|
|
59 &getuidref;
|
|
60 &interceptref;
|
|
61 &killref;
|
|
62 &lseekref;
|
|
63 &mknodref;
|
|
64 &modloadref;
|
|
65 &munlinkref;
|
|
66 &os9ref;
|
|
67 &openref;
|
|
68 &os9forkref;
|
|
69 &pauseref;
|
|
70 &prerrref;
|
|
71 &readref;
|
|
72 &sbrkref;
|
|
73 &setprref;
|
|
74 &setimeref;
|
|
75 &setuidref;
|
|
76 &setstatref;
|
|
77 &signalref;
|
|
78 &stacksizeref;
|
|
79 &strassref;
|
|
80 &tsleepref;
|
|
81 &unlinkref;
|
|
82 &waitref;
|
|
83 &writeref;
|
|
84
|
|
85 </chapter>
|