<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/libbb/copyfd.c, branch cron_changes</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=cron_changes</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=cron_changes'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2026-05-10T12:00:34+00:00</updated>
<entry>
<title>libbb: reverse performance regression in bb_copyfd_*</title>
<updated>2026-05-10T12:00:34+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-05-10T12:00:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=cc5bbc507aeefc3c5cf67e78930ebf715324d06e'/>
<id>urn:sha1:cc5bbc507aeefc3c5cf67e78930ebf715324d06e</id>
<content type='text'>
Commit c4f24ec9d (libbb: try to mitigate 'cat /dev/urandom')
resulted in a 'cat' to the terminal taking ~25% longer than
before.

Raising the isatty() call out of the loop reduces the penalty
to ~1%.

Adds 16 bytes in the 32-bit build.

(GitHub issue #585)
</content>
</entry>
<entry>
<title>libbb: try to mitigate 'cat /dev/urandom'</title>
<updated>2026-05-08T13:18:44+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-05-08T13:18:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=c4f24ec9d3a88346e416b11ac47144778aa01696'/>
<id>urn:sha1:c4f24ec9d3a88346e416b11ac47144778aa01696</id>
<content type='text'>
Now that '/dev/urandom' can be used directly, people with a sense
of curiosity and adventure have tried running 'cat /dev/urandom'
or 'cat &lt;/dev/urandom'.

The 'cat' applet in BusyBox is so efficient and ANSI escape
handling is so inefficient that this overwhelms the capabilities
of the Windows console or terminal to the extent that it's unable
to process Ctrl-C requests in a timely manner.

To give it a chance to catch up, force 'cat' to take a short nap
from time to time (very short, zero length) but only when it's
writing to a tty.

The call to Sleep() is in a separate function to avoid unnecessary
bloat in 32-bit builds, where its presence upsets the stack and
requires much larger code for stack access.

Adds 48 bytes.

(GitHub issue #585)
</content>
</entry>
<entry>
<title>libbb: create and use mmap() helpers</title>
<updated>2020-12-14T17:25:28+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2020-12-14T17:25:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=fd3c512f88d43e6633bd3c3110cfa0bb321adaa8'/>
<id>urn:sha1:fd3c512f88d43e6633bd3c3110cfa0bb321adaa8</id>
<content type='text'>
function                                             old     new   delta
mmap_anon                                              -      22     +22
mmap_read                                              -      21     +21
xmmap_anon                                             -      16     +16
rpm_gettags                                          465     447     -18
bb_full_fd_action                                    498     480     -18
uevent_main                                          337     310     -27
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63)             Total: -4 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>dpkg-deb: work around bogus error message when working with XZ compressed packages</title>
<updated>2019-10-11T12:11:44+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2019-10-11T12:11:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=42f454b13b8d972e85acd7f046065ec69af4d206'/>
<id>urn:sha1:42f454b13b8d972e85acd7f046065ec69af4d206</id>
<content type='text'>
function                                             old     new   delta
unpack_xz_stream                                    2309    2317      +8
bb_full_fd_action                                    464     472      +8

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libbb: reduce the overhead of single parameter bb_error_msg() calls</title>
<updated>2019-07-02T09:35:03+00:00</updated>
<author>
<name>James Byrne</name>
<email>james.byrne@origamienergy.com</email>
</author>
<published>2019-07-02T09:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6937487be73cd4563b876413277a295a5fe2f32c'/>
<id>urn:sha1:6937487be73cd4563b876413277a295a5fe2f32c</id>
<content type='text'>
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by
Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower
overhead call to bb_perror_msg() when only a string was being printed
with no parameters. This saves space for some CPU architectures because
it avoids the overhead of a call to a variadic function. However there
has never been a simple version of bb_error_msg(), and since 2007 many
new calls to bb_perror_msg() have been added that only take a single
parameter and so could have been using bb_simple_perror_message().

This changeset introduces 'simple' versions of bb_info_msg(),
bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and
bb_herror_msg_and_die(), and replaces all calls that only take a
single parameter, or use something like ("%s", arg), with calls to the
corresponding 'simple' version.

Since it is likely that single parameter calls to the variadic functions
may be accidentally reintroduced in the future a new debugging config
option WARN_SIMPLE_MSG has been introduced. This uses some macro magic
which will cause any such calls to generate a warning, but this is
turned off by default to avoid use of the unpleasant macros in normal
circumstances.

This is a large changeset due to the number of calls that have been
replaced. The only files that contain changes other than simple
substitution of function calls are libbb.h, libbb/herror_msg.c,
libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c,
networking/udhcp/common.h and util-linux/mdev.c additonal macros have
been added for logging so that single parameter and multiple parameter
logging variants exist.

The amount of space saved varies considerably by architecture, and was
found to be as follows (for 'defconfig' using GCC 7.4):

Arm:     -92 bytes
MIPS:    -52 bytes
PPC:   -1836 bytes
x86_64: -938 bytes

Note that for the MIPS architecture only an exception had to be made
disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h)
because it made these files larger on MIPS.

Signed-off-by: James Byrne &lt;james.byrne@origamienergy.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>whitespace and comment format fixes, no code changes</title>
<updated>2017-10-05T12:40:24+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2017-10-05T12:40:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ebe6d9d8758d36e03cf39b6587597c67ab778436'/>
<id>urn:sha1:ebe6d9d8758d36e03cf39b6587597c67ab778436</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>copyfd: guard use of munmap() with #if (windows builds need this)</title>
<updated>2017-07-15T09:44:13+00:00</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-07-14T14:11:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0'/>
<id>urn:sha1:e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0</id>
<content type='text'>
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libbb: use sendfile() to copy data between file descriptors</title>
<updated>2014-11-27T22:31:58+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartekgola@gmail.com</email>
</author>
<published>2014-11-27T12:20:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=8d75d794ea505003fddea8e757d43976db8d6861'/>
<id>urn:sha1:8d75d794ea505003fddea8e757d43976db8d6861</id>
<content type='text'>
Busybox already uses sendfile in httpd. This patch proposes to use it
globally to copy data between file descriptors.

It speeds up the copying on slow systems a lot - below are the times needed
to copy a 450Mb file with and without this option enabled on a BeagleBone
Black:

sendfile:
user    0m0.000s
sys     0m8.170s

read/write 4k:
user    0m0.470s
sys     0m16.300s

function                                             old     new   delta
bb_full_fd_action                                    394     474     +80

Signed-off-by: Bartosz Golaszewski &lt;bartekgola@gmail.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>*: make GNU licensing statement forms more regular</title>
<updated>2010-08-16T18:14:46+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2010-08-16T18:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0ef64bdb40c54681e8dd5ab8df42ac88e4ab1d4a'/>
<id>urn:sha1:0ef64bdb40c54681e8dd5ab8df42ac88e4ab1d4a</id>
<content type='text'>
This change retains "or later" state! No licensing _changes_ here,
only form is adjusted (article, space between "GPL" and "v2" and so on).

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libbb/copyfd.c: fix the case of copy buffer &lt;= 4kb</title>
<updated>2010-06-26T21:08:59+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2010-06-26T21:08:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=1eaf7e76bfff22646baf7d815650106e64ba0691'/>
<id>urn:sha1:1eaf7e76bfff22646baf7d815650106e64ba0691</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
