Denis Vlasenko 57abf9e947 libbb: make history saving/loading concurrent-safe
* all history writers always append (not overwrite) history files
* they reload history if they detect that file length has changed since last
write
* they trim history file only when it grows 4 times longer than MAXLINES
* they do this atomically by creating new file and renaming it to old

Unfortunately, this comes at a price:

function                                             old     new   delta
load_history                                           -     346    +346
read_line_input                                     3155    3358    +203
new_line_input_t                                      17      31     +14
...irrelevant small jitter...
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/5 up/down: 573/-13)           Total: 560 bytes
2009-03-22 19:00:05 +00:00
..
2008-12-03 18:48:39 +00:00
2008-07-23 08:41:08 +00:00
2008-12-07 00:52:58 +00:00
2008-08-17 12:47:19 +00:00
2008-12-07 00:52:58 +00:00
2008-11-11 21:15:56 +00:00
2008-06-28 04:58:55 +00:00
2008-07-09 19:44:08 +00:00
2008-12-04 15:29:35 +00:00
2009-03-12 15:39:11 +00:00
2008-12-07 00:52:58 +00:00
2008-06-30 13:30:21 +00:00
2009-03-15 04:56:51 +00:00
2008-12-07 00:52:58 +00:00
2009-03-20 22:17:13 +00:00
2008-12-07 00:52:58 +00:00

Please see the LICENSE file for copyright information (GPLv2)

libbb is BusyBox's utility library.  All of this stuff used to be stuffed into
a single file named utility.c.  When I split utility.c to create libbb, some of
the very oldest stuff ended up without their original copyright and licensing
information (which is now lost in the mists of time).  If you see something
that you wrote that is mis-attributed, do let me know so we can fix that up.

	Erik Andersen
	<andersen@codepoet.org>