1
0

lib 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 atoi (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. .I getcallerpc (2)
  51. .br
  52. .I getcallerpc
  53. .TP
  54. .I getfields (2)
  55. .br
  56. .I getfields
  57. and
  58. .I tokenize
  59. (see also
  60. .IR parsecmd (9))
  61. .TP
  62. .IR quote (2)
  63. .br
  64. for
  65. .IR quotefmtinstall
  66. .TP
  67. .IR print (2)
  68. .br
  69. .IR print ,
  70. .IR seprint ,
  71. .IR snprint ,
  72. .IR sprint ,
  73. .IR vseprint
  74. and
  75. .IR vsnprint ,
  76. .TP
  77. .IR memory (2)
  78. .br
  79. .IR memccpy ,
  80. .IR memchr ,
  81. .IR memcmp ,
  82. .IR memmove
  83. and
  84. .IR memset
  85. .TP
  86. .IR rune (2)
  87. .br
  88. .IR chartorune ,
  89. .IR runetochar ,
  90. .IR runelen ,
  91. .IR utflen
  92. and
  93. .IR utfrune
  94. .TP
  95. .IR open (2)
  96. .br
  97. values
  98. .BR OCEXEC ,
  99. .BR OEXCL ,
  100. .BR OEXEC ,
  101. .BR ORCLOSE ,
  102. .BR ORDWR ,
  103. .BR OREAD ,
  104. .BR OTRUNC
  105. and
  106. .BR OWRITE ,
  107. .TP
  108. .IR stat (2)
  109. .br
  110. data structures
  111. .BR Dir
  112. and
  113. .BR Qid ,
  114. and values
  115. .B DMDIR
  116. etc.
  117. and
  118. .B QTDIR
  119. etc.
  120. .TP
  121. .IR strcat (2)
  122. .br
  123. .IR strcat ,
  124. .IR strchr ,
  125. .IR strcmp ,
  126. .IR strcpy ,
  127. .IR strecpy ,
  128. .IR strlen ,
  129. .IR strncat ,
  130. .IR strncmp ,
  131. .IR strncpy ,
  132. .IR strrchr
  133. and
  134. .IR strstr
  135. .TP
  136. .IR wait (2)
  137. .br
  138. data structure
  139. .B Waitmsg
  140. .PP
  141. .B lib.h
  142. also defines
  143. .B ERRMAX
  144. (the limit in bytes for error strings)
  145. and
  146. .B KNAMELEN
  147. (fixed-length limit in bytes for device driver file names)
  148. .PP
  149. A few other libraries such as
  150. .IR memdraw (2)
  151. and
  152. .IR mp (2)
  153. are called by specialised kernel components and drivers but they use
  154. the normal include file for each library.