aboutsummaryrefslogtreecommitdiff
path: root/docs/busybox.net/programming.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/busybox.net/programming.html')
-rw-r--r--docs/busybox.net/programming.html20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/busybox.net/programming.html b/docs/busybox.net/programming.html
index f54f018ed..f5433f519 100644
--- a/docs/busybox.net/programming.html
+++ b/docs/busybox.net/programming.html
@@ -22,7 +22,7 @@
22 <li><a href="#who">Who are the BusyBox developers?</a></li> 22 <li><a href="#who">Who are the BusyBox developers?</a></li>
23</ul> 23</ul>
24 24
25<h2><b><a name="goals" />What are the goals of busybox?</b></h2> 25<h2><b><a name="goals">What are the goals of busybox?</a></b></h2>
26 26
27<p>Busybox aims to be the smallest and simplest correct implementation of the 27<p>Busybox aims to be the smallest and simplest correct implementation of the
28standard Linux command line tools. First and foremost, this means the 28standard Linux command line tools. First and foremost, this means the
@@ -31,7 +31,7 @@ and cleanest implementation we can manage, be <a href="#standards">standards
31compliant</a>, minimize run-time memory usage (heap and stack), run fast, and 31compliant</a>, minimize run-time memory usage (heap and stack), run fast, and
32take over the world.</p> 32take over the world.</p>
33 33
34<h2><b><a name="design" />What is the design of busybox?</b></h2> 34<h2><b><a name="design">What is the design of busybox?</a></b></h2>
35 35
36<p>Busybox is like a swiss army knife: one thing with many functions. 36<p>Busybox is like a swiss army knife: one thing with many functions.
37The busybox executable can act like many different programs depending on 37The busybox executable can act like many different programs depending on
@@ -53,9 +53,9 @@ binaries for each applet, and a "libbb.so" to make the busybox common code
53available as a shared library. Neither is ready yet at the time of this 53available as a shared library. Neither is ready yet at the time of this
54writing.</p> 54writing.</p>
55 55
56<a name="source" /> 56<a name="source"></a>
57 57
58<h2><a name="source_applets" /><b>The applet directories</b></h2> 58<h2><a name="source_applets"><b>The applet directories</b></a></h2>
59 59
60<p>The directory "applets" contains the busybox startup code (applets.c and 60<p>The directory "applets" contains the busybox startup code (applets.c and
61busybox.c), and several subdirectories containing the code for the individual 61busybox.c), and several subdirectories containing the code for the individual
@@ -95,7 +95,7 @@ html, txt, and man page formats) in the docs directory. See
95<a href="#adding">adding an applet to busybox</a> for more 95<a href="#adding">adding an applet to busybox</a> for more
96information.</p> 96information.</p>
97 97
98<h2><a name="source_libbb" /><b>libbb</b></h2> 98<h2><a name="source_libbb"><b>libbb</b></a></h2>
99 99
100<p>Most non-setup code shared between busybox applets lives in the libbb 100<p>Most non-setup code shared between busybox applets lives in the libbb
101directory. It's a mess that evolved over the years without much auditing 101directory. It's a mess that evolved over the years without much auditing
@@ -110,7 +110,7 @@ of open(), close(), read(), and write() that test for their own failures
110and/or retry automatically, linked list management functions (llist.c), 110and/or retry automatically, linked list management functions (llist.c),
111command line argument parsing (getopt_ulflags.c), and a whole lot more.</p> 111command line argument parsing (getopt_ulflags.c), and a whole lot more.</p>
112 112
113<h2><a name="adding" /><b>Adding an applet to busybox</b></h2> 113<h2><a name="adding"><b>Adding an applet to busybox</b></a></h2>
114 114
115<p>To add a new applet to busybox, first pick a name for the applet and 115<p>To add a new applet to busybox, first pick a name for the applet and
116a corresponding CONFIG_NAME. Then do this:</p> 116a corresponding CONFIG_NAME. Then do this:</p>
@@ -151,10 +151,10 @@ bugs. Be sure to try both "allyesconfig" and "allnoconfig" (and
151 151
152</ul> 152</ul>
153 153
154<h2><a name="standards" />What standards does busybox adhere to?</a></h2> 154<h2><a name="standards">What standards does busybox adhere to?</a></h2>
155 155
156<p>The standard we're paying attention to is the "Shell and Utilities" 156<p>The standard we're paying attention to is the "Shell and Utilities"
157portion of the <a href=http://www.opengroup.org/onlinepubs/009695399/>Open 157portion of the <a href="http://www.opengroup.org/onlinepubs/009695399/">Open
158Group Base Standards</a> (also known as the Single Unix Specification version 158Group Base Standards</a> (also known as the Single Unix Specification version
1593 or SUSv3). Note that paying attention isn't necessarily the same thing as 1593 or SUSv3). Note that paying attention isn't necessarily the same thing as
160following it.</p> 160following it.</p>
@@ -330,7 +330,7 @@ return 0 unless it has hit the end of input, and an attempt to write 0
330bytes should be ignored by the OS.)</p> 330bytes should be ignored by the OS.)</p>
331 331
332<p>As for short writes, play around with two processes piping data to each 332<p>As for short writes, play around with two processes piping data to each
333other on the command line (cat bigfile | gzip > out.gz) and suspend and 333other on the command line (cat bigfile | gzip &gt; out.gz) and suspend and
334resume a few times (ctrl-z to suspend, "fg" to resume). The writer can 334resume a few times (ctrl-z to suspend, "fg" to resume). The writer can
335experience short writes, which are especially dangerous because if you don't 335experience short writes, which are especially dangerous because if you don't
336notice them you'll discard data. They can also happen when a system is under 336notice them you'll discard data. They can also happen when a system is under
@@ -340,7 +340,7 @@ text console scrolling...)</p>
340 340
341<p>So will data always be read from the far end of a pipe at the 341<p>So will data always be read from the far end of a pipe at the
342same chunk sizes it was written in? Nope. Don't rely on that. For one 342same chunk sizes it was written in? Nope. Don't rely on that. For one
343counterexample, see <a href="http://www.faqs.org/rfcs/rfc896.html">rfc 896</p> 343counterexample, see <a href="http://www.faqs.org/rfcs/rfc896.html">rfc 896
344for Nagle's algorithm</a>, which waits a fraction of a second or so before 344for Nagle's algorithm</a>, which waits a fraction of a second or so before
345sending out small amounts of data through a TCP/IP connection in case more 345sending out small amounts of data through a TCP/IP connection in case more
346data comes in that can be merged into the same packet. (In case you were 346data comes in that can be merged into the same packet. (In case you were