git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-compat-util: prefer poll.h to sys/poll.h

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 14, 2018, 01:43 UTC
Message-ID
<20181114014307.GM890086@genre.crustytoothpaste.net>
In-Reply-To
<20181114011043.27419-1-congdanhqx@gmail.com>
On Wed, Nov 14, 2018 at 08:10:43AM +0700, Đoàn Trần Công Danh wrote:
Show 10 quoted lines
> POSIX specifies that <poll.h> is the correct header for poll(2)
> whereas <sys/poll.h> is only needed for some old libc.
> 
> Let's follow the POSIX way by default.
> 
> This effectively eliminates musl's warning:
> 
>     warning redirecting incorrect #include <sys/poll.h> to <poll.h>
> 
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>

I think this patch is fine. This was in SUSv2, and I don't feel bad about siding with a spec that's at least 17 years old.

Show 6 quoted lines
> t0028, t1308.23, t3900.34 is failing under musl,
> Those test cases in question also fails without this patch.
> 
> - t0028 is failing because musl `iconv` output UTF-16 without BOM.
> I'm not sure if my installation is broken, or it's musl's default behavior.
> But, I think RFC2781, section 4.3 allows the missing BOM

While the spec may allow this, we cannot for practical reasons. There are a large number of broken Windows programs that don't honor the spec when it says to interpret UTF-16 byte sequences without a BOM as big-endian, and instead use little-endian. Since we cannot fix all the broken Windows programs people use, we need to emit the BOM in UTF-16 mode.

Show 5 quoted lines
> - t1308.23 is failing because musl `fopen` is success when open directory
> in readonly mode. POSIX allows this behavior:
> http://pubs.opengroup.org/onlinepubs/7908799/xsh/fopen.html
> [EISDIR]
> The named file is a directory and mode requires write access.
Does setting FREAD_READS_DIRECTORIES fix this?
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Đoàn Trần Công DanhNext: Junio C Hamano
Message 2 of 5 in “git-compat-util: prefer poll.h to sys/poll.h”
  1. git-compat-util: prefer poll.h to sys/poll.hĐoàn Trần Công Danh, Nov 14, 2018
  2. brian m. carlsonNov 14, 2018
  3. Junio C HamanoNov 14, 2018
  4. Danh DoanNov 14, 2018
  5. Junio C HamanoNov 14, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.