Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero-length read() should return immediately #975

Closed
ericeil opened this issue Aug 23, 2016 · 2 comments
Closed

zero-length read() should return immediately #975

ericeil opened this issue Aug 23, 2016 · 2 comments
Labels

Comments

@ericeil
Copy link

ericeil commented Aug 23, 2016

tested on rs_preview build 14905.

Run the following C++ program:

#include <unistd.h>

int main(void)
{
  int fds[2];
  pipe(fds);

  char buf[0];
  read(fds[0], buf, 0);

  return 0;
}

On "real" Linux, this returns immediately. On Windows, it hangs indefinitely.

Found this by running the .NET Core System.IO.Pipes tests; we have a test case that expects a zero-length read from an empty pipe to return immediately.

@sunilmut sunilmut added the bug label Aug 24, 2016
@sunilmut
Copy link
Member

@ericeil - Thanks for reporting the issue and providing simple repro steps. I have logged a bug internally to track it.

@russalex
Copy link
Contributor

Looks like @sunilmut's fix went out a few releases ago here. Marking this one as fixed and closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants