Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/core/kernel/src/wasm/posix/stdio.zig
1068 views
1
pub fn keepalive() void {}
2
const stdio = @cImport(@cInclude("stdio.h"));
3
const std = @import("std");
4
const expect = std.testing.expect;
5
6
// These three functions are about locking files for *threads*, and we don't
7
// support threads in any nontrivial way yet, so these are no-ops.
8
export fn flockfile(filehandle: ?*stdio.FILE) void {
9
_ = filehandle;
10
}
11
12
test "flockfile" {
13
flockfile(null);
14
}
15
16
export fn ftrylockfile(filehandle: ?*stdio.FILE) c_int {
17
_ = filehandle;
18
return 0;
19
}
20
21
test "flockfile" {
22
try expect(ftrylockfile(null) == 0);
23
}
24
25
export fn funlockfile(filehandle: ?*stdio.FILE) void {
26
_ = filehandle;
27
}
28
29
test "funlockfile" {
30
funlockfile(null);
31
}
32
33
34