<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32, branch waitfor</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=waitfor</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=waitfor'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2026-07-16T13:09:16+00:00</updated>
<entry>
<title>ash: allow wait to handle more than 64 processes</title>
<updated>2026-07-16T13:09:16+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-07-16T12:46:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=d49a90b998ca8d381fead3ac8060071bec46c393'/>
<id>urn:sha1:d49a90b998ca8d381fead3ac8060071bec46c393</id>
<content type='text'>
WaitForMultipleObjects() can only handle 64 processes (actually,
MAXIMUM_WAIT_OBJECTS) in a single call.  Using the 'wait' shell
built-in after a command like:

   for i in $(seq 1 70); do echo $i; sleep 10 &amp; done

resulted in an uninterruptible 'wait'.

Handle processes in batches of MAXIMUM_WAIT_OBJECTS.

The problem was noted by Morgan Bartlett, who also supplied a
fix which I claim to have 'improved'.

Adds 32-48 bytes.

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>xargs: limit number of processes to 64</title>
<updated>2026-07-16T12:58:37+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-07-16T12:44:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=dfb473921952e6c049aa7a591efca78db7a4720d'/>
<id>urn:sha1:dfb473921952e6c049aa7a591efca78db7a4720d</id>
<content type='text'>
Upstream limits the number of processes invoked with the '-P 0'
option to 100.

On Windows the limit was set to MAXIMUM_WAIT_OBJECTS, as that's
the most WaitForMultipleObjects() can handle.  Apply the same
limit to user-supplied '-P' values. This avoids the need to loop
over blocks of MAXIMUM_WAIT_OBJECTS.

"64 processes ought to be enough for anyone."

Saves 64-80 bytes.

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32: code shrink procps_scan()</title>
<updated>2026-07-15T15:26:35+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-07-15T15:26:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=850b56c8a4c565bcf37b396580ca90e99da5d754'/>
<id>urn:sha1:850b56c8a4c565bcf37b396580ca90e99da5d754</id>
<content type='text'>
The principal change is to replace four separate arrays (one for
pids and three for time values) with a single array of structs.

There are some other minor adjustments.

Saves 96-144 bytes.

(GitHub PR #609)

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>fix: procps_scan: do not confirm a process to be parent if either creation time is unknown.</title>
<updated>2026-07-15T14:45:39+00:00</updated>
<author>
<name>Shun Zi</name>
<email>20991618+shunf4@users.noreply.github.com</email>
</author>
<published>2026-07-09T17:39:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=aeb72f4daf947013c40be50267405d9204bb5b82'/>
<id>urn:sha1:aeb72f4daf947013c40be50267405d9204bb5b82</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: procps_scan: compare process creation times to ensure ppid is real</title>
<updated>2026-07-15T14:45:39+00:00</updated>
<author>
<name>shunf4</name>
<email>shun1048576@gmail.com</email>
</author>
<published>2026-07-09T16:42:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=f5b004e242bcbe931454ff33c62e45ea1601c5de'/>
<id>urn:sha1:f5b004e242bcbe931454ff33c62e45ea1601c5de</id>
<content type='text'>
Windows aggressively reuses PIDs of exited processes. When a new irrelevant process gets assigned the former PID of the parent of an orphaned process, `pkill -P`, `pgrep -P`, `ps -o ppid` sees the new process as the parent of the orphaned process, and PPID of the orphan is no longer 1. So in theory, all `pkill -P`, `pgrep -P` calls are potentially dangerous and possible to kill an innocent process which outlives its parent.

This issue is already discussed in various Internet communities:

- https://stackoverflow.com/questions/6593003/how-can-i-reliably-check-whether-one-windows-process-is-the-parent-of-another-in

- https://web.archive.org/web/20140701081232/https://www.sapphiresteel.com/Blog/Killing-Trees-the-Windows-way

Comparing process creation times seems a feasible mitigation that should almost always work (though not theoretically sound).

The executable is added 512 bytes after the patch.
</content>
</entry>
<entry>
<title>win32: workaround for overflow of 8.3 short name (2)</title>
<updated>2026-07-14T07:49:19+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-07-14T07:49:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4274fef3f9f8470810110e134622f099e44de0a3'/>
<id>urn:sha1:4274fef3f9f8470810110e134622f099e44de0a3</id>
<content type='text'>
Replace a call to 'FindNextFileA()' in 'get_reparse_tag()'.

This has no effect on the standard builds.  Builds with the UTF-8
manifest included save 4-8 bytes as this removes the only remaining
call to 'FindNextFileA()'.

(GitHub issue #506)

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32: workaround for overflow of 8.3 short name</title>
<updated>2026-07-13T15:02:56+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-07-13T15:02:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5f76295bd1ac36ad512ff234877241dd2626b6a4'/>
<id>urn:sha1:5f76295bd1ac36ad512ff234877241dd2626b6a4</id>
<content type='text'>
In certain circumstances 'FindNextFileA()' can fail because the
legacy DOS 8.3 short name doesn't fit in the buffer supplied.

This can be avoided by using 'FindFirstFileExA()' instead, but
with a setting that isn't available on Windows XP.

- The problem doesn't arise in the standard 32 and 64 bit builds,
  so no change is required.

- Builds with full Unicode support target platforms which have the
  required setting.  They can use 'FindFirstFileExA()' unconditionally,
  at the cost of 36-56 bytes.

- Builds which include the UTF-8 manifest but which are allowed
  to run on systems prior to Windows 10 need to check whether they
  need to call 'FindFirstFileExA()' at runtime.  This adds 100 bytes.

(GitHub issue #506)

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>xxd: allow '-p -c 0' to cause a single line to be output</title>
<updated>2026-07-13T12:06:03+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-07-13T12:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3680eab2b9cca0c3844cadb9b31519a638b1b83b'/>
<id>urn:sha1:3680eab2b9cca0c3844cadb9b31519a638b1b83b</id>
<content type='text'>
Since 2022 the 'xxd' which comes with 'vim' has allowed the
combination of options '-p -c 0' as a way to request output on
a single line.  Details:

   https://github.com/vim/vim/pull/9524

Add this feature to the BusyBox 'xxd' applet.

Adds 64 bytes.

(GitHub issue #610)

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2026-07-08T13:32:00+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-07-08T13:32:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4afa250a0b2d9a5f20176b3a47b0a34bb87b7790'/>
<id>urn:sha1:4afa250a0b2d9a5f20176b3a47b0a34bb87b7790</id>
<content type='text'>
Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>join: code shrink by making some variables "global"</title>
<updated>2026-07-08T12:38:07+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2026-07-08T12:38:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=8f0533c576964c99e0d9d573942d845122d56863'/>
<id>urn:sha1:8f0533c576964c99e0d9d573942d845122d56863</id>
<content type='text'>
function                                             old     new   delta
readfields                                           442     437      -5
printfields                                          462     457      -5
join_main                                            843     760     -83
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-93)             Total: -93 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
