1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 2. Basic C Library Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="index.html" title="The Linux Kernel API"><link rel="prev" href="API-hlist-for-each-entry-safe.html" title="hlist_for_each_entry_safe"><link rel="next" href="API-simple-strtoull.html" title="simple_strtoull"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Basic C Library Functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-hlist-for-each-entry-safe.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="API-simple-strtoull.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="libc"></a>Chapter 2. Basic C Library Functions</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="libc.html#idp1122555668">String Conversions</a></span></dt><dt><span class="sect1"><a href="ch02s02.html">String Manipulation</a></span></dt><dt><span class="sect1"><a href="ch02s03.html">Bit Operations</a></span></dt></dl></div><p> 2 When writing drivers, you cannot in general use routines which are 3 from the C Library. Some of the functions have been found generally 4 useful and they are listed below. The behaviour of these functions 5 may vary slightly from those defined by ANSI, and these deviations 6 are noted in the text. 7 </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1122555668"></a>String Conversions</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-simple-strtoull.html"><span class="phrase">simple_strtoull</span></a></span><span class="refpurpose"> — 8 convert a string to an unsigned long long 9 </span></dt><dt><span class="refentrytitle"><a href="API-simple-strtoul.html"><span class="phrase">simple_strtoul</span></a></span><span class="refpurpose"> — 10 convert a string to an unsigned long 11 </span></dt><dt><span class="refentrytitle"><a href="API-simple-strtol.html"><span class="phrase">simple_strtol</span></a></span><span class="refpurpose"> — 12 convert a string to a signed long 13 </span></dt><dt><span class="refentrytitle"><a href="API-simple-strtoll.html"><span class="phrase">simple_strtoll</span></a></span><span class="refpurpose"> — 14 convert a string to a signed long long 15 </span></dt><dt><span class="refentrytitle"><a href="API-vsnprintf.html"><span class="phrase">vsnprintf</span></a></span><span class="refpurpose"> — 16 Format a string and place it in a buffer 17 </span></dt><dt><span class="refentrytitle"><a href="API-vscnprintf.html"><span class="phrase">vscnprintf</span></a></span><span class="refpurpose"> — 18 Format a string and place it in a buffer 19 </span></dt><dt><span class="refentrytitle"><a href="API-snprintf.html"><span class="phrase">snprintf</span></a></span><span class="refpurpose"> — 20 Format a string and place it in a buffer 21 </span></dt><dt><span class="refentrytitle"><a href="API-scnprintf.html"><span class="phrase">scnprintf</span></a></span><span class="refpurpose"> — 22 Format a string and place it in a buffer 23 </span></dt><dt><span class="refentrytitle"><a href="API-vsprintf.html"><span class="phrase">vsprintf</span></a></span><span class="refpurpose"> — 24 Format a string and place it in a buffer 25 </span></dt><dt><span class="refentrytitle"><a href="API-sprintf.html"><span class="phrase">sprintf</span></a></span><span class="refpurpose"> — 26 Format a string and place it in a buffer 27 </span></dt><dt><span class="refentrytitle"><a href="API-vbin-printf.html"><span class="phrase">vbin_printf</span></a></span><span class="refpurpose"> — 28 Parse a format string and place args' binary value in a buffer 29 </span></dt><dt><span class="refentrytitle"><a href="API-bstr-printf.html"><span class="phrase">bstr_printf</span></a></span><span class="refpurpose"> — 30 Format a string from binary arguments and place it in a buffer 31 </span></dt><dt><span class="refentrytitle"><a href="API-bprintf.html"><span class="phrase">bprintf</span></a></span><span class="refpurpose"> — 32 Parse a format string and place args' binary value in a buffer 33 </span></dt><dt><span class="refentrytitle"><a href="API-vsscanf.html"><span class="phrase">vsscanf</span></a></span><span class="refpurpose"> — 34 Unformat a buffer into a list of arguments 35 </span></dt><dt><span class="refentrytitle"><a href="API-sscanf.html"><span class="phrase">sscanf</span></a></span><span class="refpurpose"> — 36 Unformat a buffer into a list of arguments 37 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtol.html"><span class="phrase">kstrtol</span></a></span><span class="refpurpose"> — 38 convert a string to a long 39 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoul.html"><span class="phrase">kstrtoul</span></a></span><span class="refpurpose"> — 40 convert a string to an unsigned long 41 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoull.html"><span class="phrase">kstrtoull</span></a></span><span class="refpurpose"> — 42 convert a string to an unsigned long long 43 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoll.html"><span class="phrase">kstrtoll</span></a></span><span class="refpurpose"> — 44 convert a string to a long long 45 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtouint.html"><span class="phrase">kstrtouint</span></a></span><span class="refpurpose"> — 46 convert a string to an unsigned int 47 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoint.html"><span class="phrase">kstrtoint</span></a></span><span class="refpurpose"> — 48 convert a string to an int 49 </span></dt></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-hlist-for-each-entry-safe.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="API-simple-strtoull.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">hlist_for_each_entry_safe</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">simple_strtoull</span></td></tr></table></div></body></html> 50