-
Notifications
You must be signed in to change notification settings - Fork 13
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
Handle file descriptors as usize
#3
Comments
@saza-ku I'd like to try to fix that. |
Sure! |
@saza-ku I'd like to wait for those two Eventually they can be tested together. |
Now they are merged! |
@saza-ku I have a problem now. The previous
But at the moment I don't know what will happen. // old code
const fd1 = @as(*usize, @ptrFromInt(4 + linear_memory_offset));
// new code
const fd1 = @as(*usize, @ptrFromInt(8 + linear_memory_offset)); I'll have to keep testing it. |
Is this code in the integration tests? Are there any other codes which need some fixes about alignment? |
@saza-ku Yes, there are many areas that need to be modified. But now I have a problem, the test functions(testClientSocket、testServerSocket) seem to be running at the same time, because their logs seem to be printing at the same time: Lines 644 to 650 in 0c6724f
Is this normal? I don't quite understand this test now. My thought is that if they are running at the same time, will this cause the data to be overwritten. |
@dierbei Sorry for being late! I had a paper due.
Mewz is single thread, so it should be impossible. You debug it on Codespaces, right? I think #65 would be related. I'll investigate the issue first. |
It's okay, I'm always on. |
File descriptors are handled as
i32
in WASI functions arguments, like this.We pass them around as
i32
. But indices must be usize in Zig, so we must cast them every time we index the file descriptor table.To avoid it, we want to cast
fd
tousize
in WASI functions, and handle it asusize
instream
module.The text was updated successfully, but these errors were encountered: