<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/win32/poll.c, branch long_paths</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=long_paths</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=long_paths'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2024-10-25T07:27:34+00:00</updated>
<entry>
<title>win32: update poll(2) to match latest gnulib version</title>
<updated>2024-10-25T07:27:34+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-25T07:27:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=a9cf4418d930ba38e3a9e000342fb7fcbd26e8ca'/>
<id>urn:sha1:a9cf4418d930ba38e3a9e000342fb7fcbd26e8ca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>win32: workaround for pipe writability in poll(2)</title>
<updated>2024-10-25T06:47:11+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-25T06:47:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=93678239bba121c8cb88c32aa5ea410b52c3f293'/>
<id>urn:sha1:93678239bba121c8cb88c32aa5ea410b52c3f293</id>
<content type='text'>
A CGI script was found to hang when a large amount of data was
posted:

   #!/bin/sh
   echo "Content-type: text/plain;"
   echo
   if [ "$REQUEST_METHOD" = "POST" ]; then
       dd of=my.dat bs=1 count=${CONTENT_LENGTH}
       echo -n "success."
   else
       echo -n "error!"
   fi

This appears to be due to problems determining whether a pipe is
writable on Windows.  The Git for Windows project has a workaround
in their copy of GNUlib's poll(2) implementation.  The details are
in the commit message:

   https://github.com/git-for-windows/git/commit/94f4d01932279c419844aa708bec31a26056bc6b

Apply the same workaround here.

Saves 220-272 bytes.

(GitHub issue #468)
</content>
</entry>
<entry>
<title>win32: avoid crashing the console with poll(2)</title>
<updated>2023-07-17T13:17:13+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-07-17T13:17:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=72b97c86c6c1a1902d6dcda3da7c38db13585cdc'/>
<id>urn:sha1:72b97c86c6c1a1902d6dcda3da7c38db13585cdc</id>
<content type='text'>
Commit 8e6991733 (ash: fix 'read' shell built-in (1)) introduced
the use of poll(2) in the shell 'read' built-in.  When the UTF8
code page is in use this results in the console crashing if a 3 or
more byte UTF8 character is entered.

The crash is caused by the use of PeekConsoleInputA() which, like
ReadConsoleInputA(), is broken.  It can be avoided by using
PeekConsoleInputW() instead.

The number of key events will differ but this doesn't matter in
this case as poll(2) effectively runs in a busy loop with a 1ms
sleep.
</content>
</entry>
<entry>
<title>ash: fix 'read' shell built-in (2)</title>
<updated>2023-07-12T10:52:06+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-07-12T10:52:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b2901ce8efa050da00e0f3a73f3be9bf9402deea'/>
<id>urn:sha1:b2901ce8efa050da00e0f3a73f3be9bf9402deea</id>
<content type='text'>
Enabling polling in the previous commit resulted in the following
incorrect behaviour:

   { echo -n te; sleep 3; echo st; } | (read -t 1 x; echo "$x")

An empty "$x" is echoed immediately, not after 1 second.

   { echo -n te; sleep 1; echo st; } | (read -t 3 x; echo "$x")

An empty "$x" is echoed immediately.  "test" should be echoed after
1 second.

This arises because poll(2) from gnulib is unable to handle anonymous
pipes properly due do deficiencies in Microsoft Windows.  These have
been acknowledged and fixed in relation to select(2):

   https://lists.gnu.org/archive/html/bug-gnulib/2014-06/msg00051.html

Apply a similar fix to poll(2).

Costs 104-156 bytes.
</content>
</entry>
<entry>
<title>win32: revise poll(2) for use in nc</title>
<updated>2023-03-03T11:29:58+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-03-03T11:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0678b843f10191abadc5f47cef9a8ab6a29b7326'/>
<id>urn:sha1:0678b843f10191abadc5f47cef9a8ab6a29b7326</id>
<content type='text'>
Upstream commit 5b3b468ec (nc: use poll() instead of select())
changed `nc` to use poll(2) instead of select(2), obviously.

In busybox-w32 select(2) had already been hacked to support `nc`.
To avoid hacking poll(2) too the upstream change was reverted
(c2002eae3).  Later `nc` was altered to include the code for both
poll and select (3c85cc0c4).

Make the changes necessary for poll(2) to work with `nc` on Windows.
These are all in the function windows_compute_revents().

  Treat a character file that isn't a console as a normal file.
  Without this `nc 127.0.0.1 1234 &lt;/dev/null` doesn't work.

  Return 0 instead of POLLHUP if GetNumberOfConsoleInputEvents()
  indicates no events are available.  Without this communication
  between two instances of `nc` which are both using keyboard
  input isn't as asynchronous as one would like.

  Only process key press events:  key releases are ignored.  Without
  this `nc 127.0.0.1 1234` won't receive anything from the server
  until the local user presses a key.

  In the default case, which now includes disk files and character
  files, detect polling for reads as well as writes.  Without this
  `nc 127.0.0.1 1234 &lt;local_file` doesn't work.
</content>
</entry>
<entry>
<title>win32: update poll(2) to match latest gnulib version</title>
<updated>2023-03-03T11:29:45+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-03-03T11:29:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e9ea698021018cb94e6075598eda0c01cf61b28e'/>
<id>urn:sha1:e9ea698021018cb94e6075598eda0c01cf61b28e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>win32: fixes to build on Windows/MSYS2/mingw-w64</title>
<updated>2021-02-21T09:51:08+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-02-20T13:07:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4bca7987f38b24867d93efc4a11a1ef661734056'/>
<id>urn:sha1:4bca7987f38b24867d93efc4a11a1ef661734056</id>
<content type='text'>
To investigate GitHub issue #200 it was necessary to perform
build on Window using the MSYS2/mingw-w64 toolchain.  This
threw up some issues:

- The settings for _WIN32_WINNT and __USE_MINGW_ANSI_STDIO differ
  from those in Fedora resulting in compiler errors and warnings.
  Force the defaults I'm used to.

- The workaround to allow native compilation of mconf.c was broken
  by a subsequent upstream change.  Make it work again.
</content>
</entry>
<entry>
<title>win32: update poll implementation to match latest gnulib version</title>
<updated>2018-02-13T13:11:57+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2018-02-13T13:11:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=054a022f7c9a5cdf5ed44ffcf48e214a5b11c913'/>
<id>urn:sha1:054a022f7c9a5cdf5ed44ffcf48e214a5b11c913</id>
<content type='text'>
</content>
</entry>
<entry>
<title>win32/poll: avoid assumption that pointers are equivalent to longs</title>
<updated>2017-08-31T08:14:17+00:00</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-06-27T21:37:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=97e7593785e4be972383d8018e33af7d3dd409b9'/>
<id>urn:sha1:97e7593785e4be972383d8018e33af7d3dd409b9</id>
<content type='text'>
This is a companion patch to 4319368c6 (Use gnulib poll, importing the
version from git, 2012-03-30) (Git's implementation of IsConsoleHandle()
was adjusted in the meantime).

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>Move mingw32 poll.h from sys</title>
<updated>2014-01-02T14:51:50+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2014-01-02T14:51:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3887443c201c8c296e660d70a81a1f35a1b061bc'/>
<id>urn:sha1:3887443c201c8c296e660d70a81a1f35a1b061bc</id>
<content type='text'>
</content>
</entry>
</feed>
