Skip to content

gh-124621: Emscripten: Fix __syscall_ioctl patch #136993

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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Python/emscripten_syscalls.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "emscripten.h"
#include "stdio.h"

// All system calls: return nonnegative number on success, return -errno on
// failure. Negative results get stored back into errno here:
// https://github.com/emscripten-core/emscripten/blob/main/system/lib/libc/musl/src/internal/syscall_ret.c#L7

// If we're running in node, report the UID of the user in the native system as
// the UID of the user. Since the nodefs will report the uid correctly, if we
// don't make getuid report it correctly too we'll see some permission errors.
Expand Down Expand Up @@ -302,7 +306,7 @@ int __syscall_ioctl(int fd, int request, void* varargs) {
int flags = fcntl(fd, F_GETFL, 0);
int nonblock = **((int**)varargs);
if (flags < 0) {
return errno;
return -errno;
}
if (nonblock) {
flags |= O_NONBLOCK;
Expand All @@ -311,7 +315,7 @@ int __syscall_ioctl(int fd, int request, void* varargs) {
}
int res = fcntl(fd, F_SETFL, flags);
if (res < 0) {
return errno;
return -errno;
}
return res;
}
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy