Skip to content

[FS] Make fstat work on file descriptors with no name in nodefs #23480

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

Merged

Conversation

hoodmane
Copy link
Collaborator

This makes fstat work on anonymous nodefs file descriptors. It is the last part of #23058.

This makes fstat work on anonymous nodefs file descriptors. It is
the last part of emscripten-core#23058.
@hoodmane
Copy link
Collaborator Author

@sbc100 would appreciate review on this one.

// For stream getatrr:
// - arg is a native file descriptor
// - chmod, utimes, truncate are fs.fchmodSync, fs.futimesSync, fs.ftruncateSync
setattr(arg, node, attr, chmod, utimes, truncate, stat) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I love this method of adding the opaque arg along with all the opts for it.. but I can't think of a nicer way, and I think its better than duplicating the logic.

@hoodmane hoodmane merged commit df91026 into emscripten-core:main Jan 28, 2025
29 checks passed
@hoodmane hoodmane deleted the anonymous-file-descriptors-nodefs branch January 28, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants