-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fcntl DUPFD doesn't work on pipes #14640
Comments
There's another bug here which is that instead of
From
Existing behavior uses the lowest-numbered available file descriptor less than arg. |
hoodmane
pushed a commit
to hoodmane/emscripten
that referenced
this issue
Mar 20, 2022
This fixes two problems with the `dup` system calls: 1. `dup` expects that every file descriptor has a corresponding file (so pipes and (emscripten-core#14640) files that have been unlinked (emscripten-core#15012) cannot be duplicated ). 2. The dup'd file descriptor does not share flags and position with the original file desciptor. This is a simplification of an upstream pull request that would fix this problem. https://github.com/emscripten-core/emscripten/pull/9396/files This patch is simpler than the upstream one but leaves NODERAWFS broken.
hoodmane
pushed a commit
to hoodmane/emscripten
that referenced
this issue
Mar 22, 2022
This fixes two problems with the `dup` system calls: 1. `dup` expects that every file descriptor has a corresponding file (so pipes and (emscripten-core#14640) files that have been unlinked (emscripten-core#15012) cannot be duplicated ). 2. The dup'd file descriptor does not share flags and position with the original file desciptor. This is a simplification of an upstream pull request that would fix this problem. https://github.com/emscripten-core/emscripten/pull/9396/files This patch is simpler than the upstream one but leaves NODERAWFS broken.
kripken
pushed a commit
that referenced
this issue
Apr 4, 2022
This fixes two problems with the `dup` system calls: 1. `dup` expects that every file descriptor has a corresponding file (so pipes and (#14640) files that have been unlinked (#15012) cannot be duplicated ). 2. The dup'd file descriptor does not share flags and position with the original file desciptor. This is a simplification of an upstream pull request that would fix this problem. https://github.com/emscripten-core/emscripten/pull/9396/files This patch is simpler than the upstream one but leaves NODERAWFS broken.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a problem in the implementation of DUPFD for pipes. The implementation assumes that
stream.path
is a valid path. However, for pipes,stream.path
looks likepipe[n]
.The issue is here:
emscripten/src/library_syscall.js
Line 1111 in fea2ac8
I think if instead it said:
that should fix the problem? Or maybe it should say
Object.assign({}, stream)
instead ofstream
as the argument? This seems less brittle to me than the current approach.The text was updated successfully, but these errors were encountered: