<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/win32/dirent.c, 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-13T15:02:56+00:00</updated>
<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>win32: extend handling of virtual disks</title>
<updated>2026-06-08T13:02:15+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-06-08T13:02:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=1313ab2691128c2255ac1ccdeea7021dbb9b4fe4'/>
<id>urn:sha1:1313ab2691128c2255ac1ccdeea7021dbb9b4fe4</id>
<content type='text'>
Commit 62e4c5d29 (win32: special treatment for virtual hard disk)
added special treatment for mount points associated with virtual
hard disks.  One statement made there was incorrect:  a VHD without
a drive letter containing no files *does* have a '.' directory.
The error message for this case was misleading.

The changes made to handle VHDs were insufficiently general:

- lstat(2) only resolved symlinks for the explicit path '.'.
  It should also do so for paths of the form 'path/to/.'.

- opendir(3) only generated entries for '.' and '..' directories
  when FindFirstFileA() failed for the path '.'.  It should also
  do so for any path which resolves to a volume mount point.

Make the necessary changes.

Adds 64-80 bytes.

(GitHub issue #597)

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32: special treatment for virtual hard disk</title>
<updated>2026-06-07T14:23:48+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-06-07T14:23:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=62e4c5d291600a5f537d225ffdf22544bc74c8be'/>
<id>urn:sha1:62e4c5d291600a5f537d225ffdf22544bc74c8be</id>
<content type='text'>
Virtual hard disks (VHD) without a drive letter gave incorrect
results in 'ls' and 'stat'.  There were two problems:

- If the disk is empty it doesn't have a '.' directory.

- If it contains files the '.' directory is actually the mount
  point, which looks like a symbolic link and can't be opened
  as a directory.

Modify our 'stat(2)' and 'opendir(3)' implementations to handle
these quirks.

Adds 78-80 bytes.

(GitHub issue #597)

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32: add FAST_FUNC annotations</title>
<updated>2026-05-04T10:51:00+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-05-04T10:51:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=f26b970e4d22e1b2e3ca6209c3412fa0f683d953'/>
<id>urn:sha1:f26b970e4d22e1b2e3ca6209c3412fa0f683d953</id>
<content type='text'>
I've been far too lax in applying FAST_FUNC annotations.  These
can make function calls smaller and faster, but only on 32-bit
systems and for non-static, non-variadic functions with non-void
arguments.

Saves 4680 bytes in the 32-bit build; 64-bit builds are unaffected.
</content>
</entry>
<entry>
<title>win32: fake directories in readdir(2)</title>
<updated>2025-03-17T08:59:56+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2025-03-17T08:59:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3de63bc1739354df946c0b6dddd96058d8952bb7'/>
<id>urn:sha1:3de63bc1739354df946c0b6dddd96058d8952bb7</id>
<content type='text'>
The emulation of readdir(2) didn't include the '.' and '..'
directories in the root of a logical drive.  This resulted in
the 'ls' applet (and others) not matching the expected Unix
behaviour.

Alter the emulation of readdir(2) to include fake '.' and '..'
directories if necessary.

Adds 88-112 bytes.

(GitHub issue #487)
</content>
</entry>
<entry>
<title>win32: missing support for "app exec link" reparse points</title>
<updated>2023-09-18T10:35:11+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-09-18T10:35:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=1fcd57ab583a39f42b55f44d42472ea64e228c84'/>
<id>urn:sha1:1fcd57ab583a39f42b55f44d42472ea64e228c84</id>
<content type='text'>
Commit 603af9bb9 (win32: support "app exec link" reparse points)
added support for IO_REPARSE_TAG_APPEXECLINK reparse points by
pretending they're symbolic links.

One change was missed, in the implementation of dirent.

Costs 16 bytes.
</content>
</entry>
<entry>
<title>win32: always allow d_type member of struct dirent</title>
<updated>2022-12-22T11:38:39+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2022-12-22T11:38:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=67aec6403c80b8956b8b0f78f58e2b9664bd4f62'/>
<id>urn:sha1:67aec6403c80b8956b8b0f78f58e2b9664bd4f62</id>
<content type='text'>
The d_type member of struct dirent is required by the implementation
of glob(3).  As a result it isn't possible to build the make applet
unless FEATURE_EXTRA_FILE_DATA is configured.

Allow d_type unconditionally.
</content>
</entry>
<entry>
<title>win32: try to get link count for directories</title>
<updated>2022-05-15T07:52:26+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2022-05-15T07:52:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=7fb95a2a569ca6d68dad4cef5b7b299e9fe68e2b'/>
<id>urn:sha1:7fb95a2a569ca6d68dad4cef5b7b299e9fe68e2b</id>
<content type='text'>
On Unix the link count of a directory reflects the number of
subdirectories it contains.  Enhance readdir(3) to return file
types and use this to count subdirectories when stat(2) is called
for a directory.

As with other features that might slow down stat(2) this is
controlled by the build-time setting FEATURE_EXTRA_FILE_DATA.
(Commit d82db8e9a 'win32: make stat(2) fetch additional metadata').

(GitHub issue #254)
</content>
</entry>
<entry>
<title>win32: add local dirent implementation</title>
<updated>2021-06-13T07:13:25+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-06-13T07:13:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=f7e4fe39a69b82bcef1aaa68111ccfa68b209ada'/>
<id>urn:sha1:f7e4fe39a69b82bcef1aaa68111ccfa68b209ada</id>
<content type='text'>
Add a cut down version of the dirent implementation from git.
The git developers said:

  The mingw-runtime implemenation of opendir, readdir and closedir
  sets errno to 0 on success, something that POSIX explicitly
  forbids.

This also avoids having to link against libssp.a (commit 13eb34205)
and reduces the size of the binary by 2KB.
</content>
</entry>
</feed>
