466
|
1 <refentry id="getstat">
|
|
2 <refnamediv>
|
468
|
3 <refname>Getstat</refname>
|
|
4 <refpurpose>get file status</refpurpose>
|
466
|
5 </refnamediv>
|
|
6
|
|
7 <refsynopsisdiv>
|
|
8 <funcsynopsis>
|
468
|
9 <funcsynopsisinfo>
|
|
10 #include <sgstat.h>
|
|
11 </funcsynopsisinfo>
|
570
|
12
|
|
13 <funcsynopsisinfo>
|
|
14 /* code 0 */
|
|
15 </funcsynopsisinfo>
|
|
16 <funcprototype>
|
|
17 <funcdef><function>getstat</function></funcdef>
|
|
18 <paramdef>int <parameter>code</parameter></paramdef>
|
|
19 <paramdef>int <parameter>filenum</parameter></paramdef>
|
|
20 <paramdef>char *<parameter>buffer</parameter></paramdef>
|
|
21 </funcprototype>
|
|
22
|
|
23 <funcsynopsisinfo>
|
|
24 /* codes 1 and 6 */
|
|
25 </funcsynopsisinfo>
|
466
|
26 <funcprototype>
|
|
27 <funcdef><function>getstat</function></funcdef>
|
570
|
28 <paramdef>int <parameter>code</parameter></paramdef>
|
|
29 <paramdef>int <parameter>filenum</parameter></paramdef>
|
|
30 </funcprototype>
|
|
31
|
|
32 <funcsynopsisinfo>
|
|
33 /* code 2 */
|
|
34 </funcsynopsisinfo>
|
|
35 <funcprototype>
|
|
36 <funcdef><function>getstat</function></funcdef>
|
|
37 <paramdef>int <parameter>code</parameter></paramdef>
|
|
38 <paramdef>int <parameter>filenum</parameter></paramdef>
|
|
39 <paramdef>long *<parameter>size</parameter></paramdef>
|
|
40 </funcprototype>
|
|
41
|
|
42 <funcsynopsisinfo>
|
|
43 /* code 5 */
|
|
44 </funcsynopsisinfo>
|
|
45 <funcprototype>
|
|
46 <funcdef><function>getstat</function></funcdef>
|
|
47 <paramdef>int <parameter>code</parameter></paramdef>
|
|
48 <paramdef>int <parameter>filenum</parameter></paramdef>
|
|
49 <paramdef>long *<parameter>pos</parameter></paramdef>
|
466
|
50 </funcprototype>
|
|
51 </funcsynopsis>
|
|
52
|
|
53 </refsynopsisdiv>
|
|
54
|
542
|
55 <refsect1><title>Assembler Equivalent</title>
|
|
56 <para>
|
|
57 os9 I$GETSTT
|
|
58 </para>
|
|
59 </refsect1>
|
|
60
|
466
|
61 <refsect1><title>Description</title>
|
|
62 <para>
|
599
|
63 A full description of getstat can be found in the OS-9 System
|
|
64 Programmer's Manual.
|
|
65 </para>
|
|
66 <para>
|
|
67 "Code" must be the value of one of the standard codes for the
|
|
68 getstat service request. "Filenum" must be the path number of
|
|
69 an open file.
|
|
70 </para>
|
|
71 <para>
|
|
72 The form of the call depends on the value of "code".
|
|
73 </para>
|
|
74 <informaltable frame="none">
|
|
75 <tgroup cols="2">
|
636
|
76 <colspec colwidth="1in"/>
|
|
77 <colspec colwidth="3in"/>
|
599
|
78 <tbody>
|
|
79 <row>
|
|
80 <entry>Code 0:</entry>
|
|
81 <entry>"Buffer" must be the address of a 32 byte
|
|
82 buffer into which the relevant status packet
|
|
83 is copied. The header file has the
|
|
84 definitions of the various file and device
|
|
85 structures for use by the program.</entry>
|
|
86 </row>
|
|
87 <row>
|
|
88 <entry>Code 1:</entry>
|
|
89 <entry>Code 1 only applies to SCF devices and to
|
|
90 test for data available. The return value is
|
|
91 zero if there is data available. -1 is
|
|
92 returned if there is no data.</entry>
|
|
93 </row>
|
|
94 <row>
|
|
95 <entry>Code 2:</entry>
|
|
96 <entry>"Size" should be the address of a long
|
|
97 integer into which the current file size is
|
|
98 placed. The return value of the function is
|
|
99 -1 on error and 0 on success.</entry>
|
|
100 </row>
|
|
101 <row>
|
|
102 <entry>Code 5:</entry>
|
|
103 <entry>"Pos" should be the address of a long integer
|
|
104 into which the current file position is
|
|
105 placed. The return value of the function is -1 on
|
|
106 error and 0 on success.</entry>
|
|
107 </row>
|
|
108 <row>
|
|
109 <entry>Code 6:</entry>
|
|
110 <entry>Returns -1 on EOF and error and 0 on success.</entry>
|
|
111 </row>
|
|
112 </tbody>
|
|
113 </tgroup>
|
|
114 </informaltable>
|
|
115 <para>
|
|
116 NOTE that when one of the previous calls returns -1, then
|
|
117 actual error is returned in errno.
|
466
|
118 </para>
|
|
119 </refsect1>
|
|
120 </refentry>
|