Skip to content

fix(mmap): support read-only - #10782

Merged
kripken merged 1 commit into
emscripten-core:masterfrom
petersalomonsen:fix-mmap-readonly
Mar 28, 2020
Merged

fix(mmap): support read-only#10782
kripken merged 1 commit into
emscripten-core:masterfrom
petersalomonsen:fix-mmap-readonly

Conversation

@petersalomonsen

Copy link
Copy Markdown
Contributor

only do msync on munmap if PROT_WRITE is set

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, thanks @petersalomonsen ! Just the one comment.

Comment thread src/library_syscall.js Outdated
#if FILESYSTEM && SYSCALLS_REQUIRE_FILESYSTEM
var stream = FS.getStream(info.fd);
SYSCALLS.doMsync(addr, stream, len, info.flags, info.offset);
if (info.prot & 0x02) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the constant can be {{{ cDefine('PROT_WRITE') }}}.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks for reviewing @kripken . Replaced with the constant now.

only do msync on munmap if PROT_WRITE is set

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perfect, thanks @petersalomonsen !

@kripken
kripken merged commit ea4b5cb into emscripten-core:master Mar 28, 2020
@petersalomonsen
petersalomonsen deleted the fix-mmap-readonly branch March 29, 2020 05:08
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