lib 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. .TH LIB 9
  2. .SH NAME
  3. lib \- C library functions used by the kernel
  4. .SH SYNOPSIS
  5. .B
  6. #include "../port/lib.h"
  7. .SH DESCRIPTION
  8. A small collection of functions from the normal Plan 9 C
  9. library is used in the kernel.
  10. Only a subset is made available by declarations in
  11. .BR lib.h ,
  12. which must be included instead of the usual
  13. .BR <libc.h> .
  14. Here is a list of the manual pages, and the functions from them declared
  15. by
  16. .B lib.h
  17. for kernel use:
  18. .IR
  19. .TP
  20. .IR abs (2)
  21. .br
  22. .I abs
  23. .TP
  24. .IR atof (2)
  25. .br
  26. .IR atoi ,
  27. .IR strtol ,
  28. .IR strtoul ,
  29. .IR strtoll ,
  30. and
  31. .I strtoull
  32. .TP
  33. .IR cleanname (2)
  34. .br
  35. .I cleanname
  36. .TP
  37. .IR encode (2)
  38. .IR dec64
  39. and
  40. .I encodefmt
  41. .TP
  42. .IR fmtinstall (2)
  43. .br
  44. .BR Fmt ,
  45. .IR fmtinstall ,
  46. .IR fmtprint
  47. and
  48. .IR fmtstrcpy
  49. .TP
  50. .IR getbe (2)
  51. .IR getbe ,
  52. .IR putbe ,
  53. .IR getle ,
  54. and
  55. .I putle
  56. .TP
  57. .IR getcallerpc (2)
  58. .br
  59. .I getcallerpc
  60. .TP
  61. .IR getfields (2)
  62. .br
  63. .I getfields
  64. and
  65. .I tokenize
  66. (see also
  67. .IR parsecmd (9))
  68. .TP
  69. .IR quote (2)
  70. .br
  71. for
  72. .IR quotefmtinstall
  73. .TP
  74. .IR print (2)
  75. .br
  76. .IR print ,
  77. .IR seprint ,
  78. .IR snprint ,
  79. .IR sprint ,
  80. .IR vseprint
  81. and
  82. .IR vsnprint ,
  83. .TP
  84. .IR memory (2)
  85. .br
  86. .IR memccpy ,
  87. .IR memchr ,
  88. .IR memcmp ,
  89. .IR memmove
  90. and
  91. .IR memset
  92. .TP
  93. .IR rune (2)
  94. .br
  95. .IR chartorune ,
  96. .IR runetochar ,
  97. .IR runelen ,
  98. .IR utflen
  99. and
  100. .IR utfrune
  101. .TP
  102. .IR open (2)
  103. .br
  104. values
  105. .BR OCEXEC ,
  106. .BR OEXCL ,
  107. .BR OEXEC ,
  108. .BR ORCLOSE ,
  109. .BR ORDWR ,
  110. .BR OREAD ,
  111. .BR OTRUNC
  112. and
  113. .BR OWRITE ,
  114. .TP
  115. .IR stat (2)
  116. .br
  117. data structures
  118. .BR Dir
  119. and
  120. .BR Qid ,
  121. and values
  122. .B DMDIR
  123. etc.
  124. and
  125. .B QTDIR
  126. etc.
  127. .TP
  128. .IR strcat (2)
  129. .br
  130. .IR strcat ,
  131. .IR strchr ,
  132. .IR strcmp ,
  133. .IR strcpy ,
  134. .IR strecpy ,
  135. .IR strlen ,
  136. .IR strncat ,
  137. .IR strncmp ,
  138. .IR strncpy ,
  139. .IR strrchr
  140. and
  141. .IR strstr
  142. .TP
  143. .IR wait (2)
  144. .br
  145. data structure
  146. .B Waitmsg
  147. .PP
  148. .B lib.h
  149. also defines
  150. .B ERRMAX
  151. (the limit in bytes for error strings)
  152. and
  153. .B KNAMELEN
  154. (fixed-length limit in bytes for device driver file names)
  155. .PP
  156. A few other libraries such as
  157. .IR memdraw (2)
  158. and
  159. .IR mp (2)
  160. are called by specialised kernel components and drivers but they use
  161. the normal include file for each library.