161 lines · 2.0 KB · Text
RawDownload
.TH LIB 9.SH NAMElib \- C library functions used by the kernel.SH SYNOPSIS.B#include "../port/lib.h".SH DESCRIPTIONA small collection of functions from the normal Plan 9 Clibrary is used in the kernel.Only a subset is made available by declarations in.BR lib.h ,which must be included instead of the usual.BR <libc.h> .Here is a list of the manual pages, and the functions from them declaredby.B lib.hfor kernel use:.IR.TP.IR abs (2).br.I abs.TP.IR atof (2).br.IR atoi ,.IR strtol ,.IR strtoul ,.IR strtoll ,and.I strtoull.TP.IR cleanname (2).br.I cleanname.TP.IR encode (2).IR dec64and.I encodefmt.TP.IR fmtinstall (2).br.BR Fmt ,.IR fmtinstall ,.IR fmtprintand.IR fmtstrcpy.TP.IR getbe (2).IR getbe ,.IR putbe ,.IR getle ,and.I putle.TP.IR getcallerpc (2).br.I getcallerpc.TP.IR getfields (2).br.I getfieldsand.I tokenize(see also.IR parsecmd (9)).TP.IR quote (2).brfor.IR quotefmtinstall.TP.IR print (2).br.IR print ,.IR seprint ,.IR snprint ,.IR sprint ,.IR vseprintand.IR vsnprint ,.TP.IR memory (2).br.IR memccpy ,.IR memchr ,.IR memcmp ,.IR memmoveand.IR memset.TP.IR rune (2).br.IR chartorune ,.IR runetochar ,.IR runelen ,.IR utflenand.IR utfrune.TP.IR open (2).brvalues.BR OCEXEC ,.BR OEXCL ,.BR OEXEC ,.BR ORCLOSE ,.BR ORDWR ,.BR OREAD ,.BR OTRUNCand.BR OWRITE ,.TP.IR stat (2).brdata structures.BR Dirand.BR Qid ,and values.B DMDIRetc.and.B QTDIRetc..TP.IR strcat (2).br.IR strcat ,.IR strchr ,.IR strcmp ,.IR strcpy ,.IR strecpy ,.IR strlen ,.IR strncat ,.IR strncmp ,.IR strncpy ,.IR strrchrand.IR strstr.TP.IR wait (2).brdata structure.B Waitmsg.PP.B lib.halso defines.B ERRMAX(the limit in bytes for error strings)and.B KNAMELEN(fixed-length limit in bytes for device driver file names).PPA few other libraries such as.IR memdraw (2)and.IR mp (2)are called by specialised kernel components and drivers but they usethe normal include file for each library.