On 5/1/2024 4:44 PM, Ken Brown wrote:
An Emacs bug report
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70415) has led me to look
at gnulib's boot-time, and I discovered a problem. I haven't studied
the code in detail, but I looked at get_windows_boot_time in
boot-time-aux.h and found two mistakes. First, there is a comment
saying that /var/run/utmp is empty on Cygwin. This is not true, at
least on my system. I'm running Cygwin 3.5.3, the latest stable
release. I don't know if this matters, i.e., if the knowledge that
/var/run/utmp is not empty would change anything elsewhere in the code.
I think I can answer my own question here: It doesn't matter. I've just
used gdb to step through the call to get_boot_time in the Emacs code,
and I've found that the code does read /var/run/utmp but finds that it
apparently doesn't contain the boot time. Specifically, in
boot-time.c:113, ut->ut_type != BOOT_TIME. As a result, get_boot_time
ends up calling get_windows_boot_time, which fails on my system because
of the cygdrive problem described in the next paragraph.
Second, and more serious, is the use of /cygdrive/c to refer to the C:
drive. In fact, users can set the "cygdrive prefix" to anything they
want in /etc/fstab. For example, I use /mnt as the cygdrive prefix, so
I would use /mnt/c for the C: drive. The correct way to use the
cygdrive prefix is to use /proc/cygdrive. For example, /proc/cygdrive
is a symlink to /mnt/ on my system.
Ken