diff options
Diffstat (limited to 'docs/busybox.net/programming.html')
-rw-r--r-- | docs/busybox.net/programming.html | 20 |
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 |
28 | standard Linux command line tools. First and foremost, this means the | 28 | standard 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 | |||
31 | compliant</a>, minimize run-time memory usage (heap and stack), run fast, and | 31 | compliant</a>, minimize run-time memory usage (heap and stack), run fast, and |
32 | take over the world.</p> | 32 | take 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. |
37 | The busybox executable can act like many different programs depending on | 37 | The 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 | |||
53 | available as a shared library. Neither is ready yet at the time of this | 53 | available as a shared library. Neither is ready yet at the time of this |
54 | writing.</p> | 54 | writing.</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 |
61 | busybox.c), and several subdirectories containing the code for the individual | 61 | busybox.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 |
96 | information.</p> | 96 | information.</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 |
101 | directory. It's a mess that evolved over the years without much auditing | 101 | directory. 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 | |||
110 | and/or retry automatically, linked list management functions (llist.c), | 110 | and/or retry automatically, linked list management functions (llist.c), |
111 | command line argument parsing (getopt_ulflags.c), and a whole lot more.</p> | 111 | command 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 |
116 | a corresponding CONFIG_NAME. Then do this:</p> | 116 | a 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" |
157 | portion of the <a href=http://www.opengroup.org/onlinepubs/009695399/>Open | 157 | portion of the <a href="http://www.opengroup.org/onlinepubs/009695399/">Open |
158 | Group Base Standards</a> (also known as the Single Unix Specification version | 158 | Group Base Standards</a> (also known as the Single Unix Specification version |
159 | 3 or SUSv3). Note that paying attention isn't necessarily the same thing as | 159 | 3 or SUSv3). Note that paying attention isn't necessarily the same thing as |
160 | following it.</p> | 160 | following it.</p> |
@@ -330,7 +330,7 @@ return 0 unless it has hit the end of input, and an attempt to write 0 | |||
330 | bytes should be ignored by the OS.)</p> | 330 | bytes 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 |
333 | other on the command line (cat bigfile | gzip > out.gz) and suspend and | 333 | other on the command line (cat bigfile | gzip > out.gz) and suspend and |
334 | resume a few times (ctrl-z to suspend, "fg" to resume). The writer can | 334 | resume a few times (ctrl-z to suspend, "fg" to resume). The writer can |
335 | experience short writes, which are especially dangerous because if you don't | 335 | experience short writes, which are especially dangerous because if you don't |
336 | notice them you'll discard data. They can also happen when a system is under | 336 | notice 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 |
342 | same chunk sizes it was written in? Nope. Don't rely on that. For one | 342 | same chunk sizes it was written in? Nope. Don't rely on that. For one |
343 | counterexample, see <a href="http://www.faqs.org/rfcs/rfc896.html">rfc 896</p> | 343 | counterexample, see <a href="http://www.faqs.org/rfcs/rfc896.html">rfc 896 |
344 | for Nagle's algorithm</a>, which waits a fraction of a second or so before | 344 | for Nagle's algorithm</a>, which waits a fraction of a second or so before |
345 | sending out small amounts of data through a TCP/IP connection in case more | 345 | sending out small amounts of data through a TCP/IP connection in case more |
346 | data comes in that can be merged into the same packet. (In case you were | 346 | data comes in that can be merged into the same packet. (In case you were |