Add implementation of memfd_create - #100
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a WASI-specific implementation of memfd_create, a Linux system call that creates an anonymous file descriptor. Since WASI doesn't support the actual Linux syscall, this implementation emulates the behavior using temporary files created with mkstemp/mkostemp that are immediately unlinked.
Changes:
- Adds new implementation file for
memfd_createusing temporary files - Updates build files (Makefile and Makefile-eh) to include the new source
- Updates symbol definition lists for all WASI target variants
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| libc-top-half/musl/src/mman/memfd_create.c | New WASI-specific implementation using mkstemp/mkostemp and unlink |
| Makefile | Adds memfd_create.c to the build sources |
| Makefile-eh | Adds memfd_create.c to the exception handling build sources |
| expected/wasm64-wasi/defined-symbols.txt | Adds memfd_create to the list of defined symbols |
| expected/wasm32-wasi/defined-symbols.txt | Adds memfd_create to the list of defined symbols |
| expected/wasm32-wasi-threads/defined-symbols.txt | Adds memfd_create to the list of defined symbols |
| expected/wasm32-wasi-ehpic/defined-symbols.txt | Adds memfd_create to the list of defined symbols |
| expected/wasm32-wasi-eh/defined-symbols.txt | Adds memfd_create to the list of defined symbols |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
89e5db4 to
bbc2e8f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
01cd986 to
3860d9c
Compare
Currently, our headers declare
memfd_create, but we don't have an implementation for it. This PR adds a minimal implementation for it.