linux.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <?xml version="1.0" encoding="ISO8859-1"?>
  2. <!--
  3. $Id$
  4. This file is part of the FPC documentation.
  5. Copyright (C) 1997, by Michael Van Canneyt
  6. The FPC documentation is free text; you can redistribute it and/or
  7. modify it under the terms of the GNU Library General Public License as
  8. published by the Free Software Foundation; either version 2 of the
  9. License, or (at your option) any later version.
  10. The FPC Documentation is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Library General Public License for more details.
  14. You should have received a copy of the GNU Library General Public
  15. License along with the FPC documentation; see the file COPYING.LIB. If not,
  16. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. Boston, MA 02111-1307, USA.
  18. -->
  19. <fpdoc-descriptions>
  20. <package name="rtl">
  21. <module name="Linux">
  22. <short>Linux-specific operating system calls.</short>
  23. <descr>
  24. <p>
  25. The <file>linux</file> unit contains linux specific operating system calls.
  26. </p>
  27. <p>
  28. The platform independent functionality of the FPC 1.0.X version of the
  29. <file>linux</file> unit has been split out over the
  30. <link id="#rtl.unix">unix</link>, <link id="#rtl.baseunix">baseunix</link> and
  31. <link id="#rtl.unixutil">unixutil</link> units.
  32. </p>
  33. <p>
  34. The X86-specific parts have been moved to the <link id="#rtl.x86">X86</link>
  35. unit.
  36. </p>
  37. <p>
  38. People wanting to use the old version (FPC 1.0.X and before) of the
  39. <file>linux</file> can use the <link id="#rtl.oldlinux">oldlinux</link> unit
  40. instead.
  41. </p>
  42. </descr>
  43. <!-- record type Visibility: default -->
  44. <element name="TSysinfo">
  45. <short>Record with system information, used by the <link id="SysInfo"/> call.</short>
  46. </element>
  47. <!-- variable Visibility: default -->
  48. <element name="TSysinfo.uptime">
  49. <short>Number of seconds since boot.</short>
  50. </element>
  51. <!-- variable Visibility: default -->
  52. <element name="TSysinfo.loads">
  53. <short>1, 5 and 15 minute load averages.</short>
  54. </element>
  55. <!-- variable Visibility: default -->
  56. <element name="TSysinfo.totalram">
  57. <short>total amount of main memory.</short>
  58. </element>
  59. <!-- variable Visibility: default -->
  60. <element name="TSysinfo.freeram">
  61. <short>amount of free memory.</short>
  62. </element>
  63. <!-- variable Visibility: default -->
  64. <element name="TSysinfo.sharedram">
  65. <short>amount of shared memory.</short>
  66. </element>
  67. <!-- variable Visibility: default -->
  68. <element name="TSysinfo.bufferram">
  69. <short>amount of memory used by buffers.</short>
  70. </element>
  71. <!-- variable Visibility: default -->
  72. <element name="TSysinfo.totalswap">
  73. <short>total amount of swapspace.</short>
  74. </element>
  75. <!-- variable Visibility: default -->
  76. <element name="TSysinfo.freeswap">
  77. <short>amount of free swapspace.</short>
  78. </element>
  79. <!-- variable Visibility: default -->
  80. <element name="TSysinfo.procs">
  81. <short>number of current processes.</short>
  82. </element>
  83. <!-- variable Visibility: default -->
  84. <element name="TSysinfo.s">
  85. <short>?</short>
  86. </element>
  87. <!-- pointer type Visibility: default -->
  88. <element name="PSysInfo">
  89. <short>Pointer to <link id="TSysInfo"/> record.</short>
  90. </element>
  91. <!-- function Visibility: default -->
  92. <element name="Sysinfo">
  93. <short>Return kernel system information</short>
  94. <descr>
  95. <p>
  96. <var>SysInfo</var> returns system information in <var>Info</var>. Returned information
  97. in <var>Info</var> includes:
  98. </p>
  99. <dl>
  100. <dt>uptime</dt><dd>Number of seconds since boot.</dd>
  101. <dt>loads</dt><dd>1, 5 and 15 minute load averages.</dd>
  102. <dt>totalram</dt><dd>total amount of main memory.</dd>
  103. <dt>freeram</dt><dd>amount of free memory.</dd>
  104. <dt>sharedram</dt><dd>amount of shared memory.</dd>
  105. <dt>bufferram</dt><dd>amount of memory used by buffers.</dd>
  106. <dt>totalswap</dt><dd>total amount of swapspace.</dd>
  107. <dt>freeswap</dt><dd>amount of free swapspace.</dd>
  108. <dt>procs</dt><dd>number of current processes.</dd>
  109. </dl>
  110. </descr>
  111. <errors>
  112. None.
  113. </errors>
  114. <seealso>
  115. <link id="#rtl.baseunix.fpUname"/>
  116. </seealso>
  117. <example file="linuxex/ex64"/>
  118. </element>
  119. <!-- constant Visibility: default -->
  120. <element name="CSIGNAL">
  121. <short><link id="Clone"/> option: Signal mask to be sent at exit</short>
  122. </element>
  123. <!-- constant Visibility: default -->
  124. <element name="CLONE_VM">
  125. <short><link id="Clone"/> option: VM shared between processes</short>
  126. </element>
  127. <!-- constant Visibility: default -->
  128. <element name="CLONE_FS">
  129. <short><link id="Clone"/> option: fs info shared between processes</short>
  130. </element>
  131. <!-- constant Visibility: default -->
  132. <element name="CLONE_FILES">
  133. <short><link id="Clone"/> option: open files shared between processes</short>
  134. </element>
  135. <!-- constant Visibility: default -->
  136. <element name="CLONE_SIGHAND">
  137. <short><link id="Clone"/> option: signal handlers shared between processes</short>
  138. </element>
  139. <!-- constant Visibility: default -->
  140. <element name="CLONE_PID">
  141. <short><link id="Clone"/> option: PID shared between processes</short>
  142. </element>
  143. <!-- function type Visibility: default -->
  144. <element name="TCloneFunc">
  145. <short>Clone function prototype.</short>
  146. </element>
  147. <!-- function Visibility: default -->
  148. <element name="Clone">
  149. <short>Clone current process (create new thread)</short>
  150. <descr>
  151. <p>
  152. <var>Clone</var>
  153. creates a child process which is a copy of the parent process, just
  154. like <link id="#rtl.baseunix.FpFork">FpFork</link> does. In difference with <var>Fork</var>, however, the child
  155. process shares some parts of it's execution context with its parent, so it
  156. is suitable for the implementation of threads: many instances of a program
  157. that share the same memory.
  158. </p>
  159. <p>
  160. When the child process is created, it starts executing the function
  161. <var>Func</var>, and passes it <var>Args</var>. The return value of <var>Func</var> is
  162. either the explicit return value of the function, or the exit code of
  163. the child process.
  164. </p>
  165. <p>
  166. The <var>sp</var> pointer points to the memory reserved as stack space for the
  167. child process. This address should be the top of the memory block to be used
  168. as stack.
  169. </p>
  170. <p>
  171. The <var>Flags</var> determine the behaviour of the <var>Clone</var> call. The low
  172. byte of the Flags contains the number of the signal that will be sent to
  173. the parent when the child dies.
  174. This may be bitwise OR'ed with the following constants:
  175. </p>
  176. <dl>
  177. <dt>CLONE_VM</dt>
  178. <dd> Parent and child share the same memory space, including
  179. memory (un)mapped with subsequent <var>mmap</var> calls.</dd>
  180. <dt>CLONE_FS</dt>
  181. <dd> Parent and child have the same view of the filesystem;
  182. the <var>chroot</var>, <var>chdir</var> and <var>umask</var> calls affect both processes.</dd>
  183. <dt>CLONE_FILES</dt>
  184. <dd> the file descriptor table of parent and child is shared.</dd>
  185. <dt>CLONE_SIGHAND</dt>
  186. <dd> the parent and child share the same table of signal
  187. handlers. The signal masks are different, though.</dd>
  188. <dt>CLONE_PID</dt>
  189. <dd> PArent and child have the same process ID.</dd>
  190. </dl>
  191. <p>
  192. Clone returns the process ID in the parent process, and -1 if an error
  193. occurred.
  194. </p>
  195. </descr>
  196. <errors>
  197. <p>
  198. On error, -1 is returned to the parent, and no child is created.
  199. </p>
  200. <dl>
  201. <dt>sys_eagain</dt><dd>Too many processes are running.</dd>
  202. <dt>sys_enomem</dt><dd>Not enough memory to create child process.</dd>
  203. </dl>
  204. </errors>
  205. <seealso>
  206. <link id="#rtl.baseunix.FpFork"/>
  207. </seealso>
  208. <example file="linuxex/ex71"/>
  209. </element>
  210. </module> <!-- Linux -->
  211. </package>
  212. </fpdoc-descriptions>