Skip to content

Add implementation of memfd_create - #100

Open
zebreus wants to merge 10 commits into
mainfrom
implement-missing-thing-for-dash
Open

Add implementation of memfd_create#100
zebreus wants to merge 10 commits into
mainfrom
implement-missing-thing-for-dash

Conversation

@zebreus

@zebreus zebreus commented Feb 13, 2026

Copy link
Copy Markdown

Currently, our headers declare memfd_create, but we don't have an implementation for it. This PR adds a minimal implementation for it.

Copilot AI review requested due to automatic review settings February 13, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_create using 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.

Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated
Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated
Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated
Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated
Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated
Comment thread libc-top-half/musl/src/mman/memfd_create.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread libc-top-half/musl/src/mman/memfd_create.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread libc-top-half/musl/src/mman/memfd_create.c
zebreus and others added 3 commits February 13, 2026 14:28
@zebreus
zebreus force-pushed the implement-missing-thing-for-dash branch from 01cd986 to 3860d9c Compare February 13, 2026 13:29
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