Skip to content

Commit 984e47d

Browse files
committed
Updated to use os.posix in latest zig dev
This change over occured in ziglang/zig#19354
1 parent 4d9a2d8 commit 984e47d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/flush.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const std = @import("std");
22

33
pub fn main() !void {
4-
std.os.sync();
4+
std.posix.sync();
55
const drop_caches = try std.fs.openFileAbsoluteZ("/proc/sys/vm/drop_caches", .{ .mode = .write_only });
66
defer drop_caches.close();
77
_ = try drop_caches.write("3");

src/pagey.zig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn squareSize(n: i32, x: i32, y: i32) i32 {
9595
}
9696

9797
fn flush() void {
98-
std.os.sync();
98+
std.posix.sync();
9999
const drop_caches = std.fs.openFileAbsoluteZ(
100100
"/proc/sys/vm/drop_caches",
101101
.{ .mode = .write_only },
@@ -199,15 +199,15 @@ pub fn main() !u8 {
199199

200200
///////////////////////////////////////////////////////////////////////////
201201
// Setup Memory Mapping
202-
const mapped_file = try std.os.mmap(
202+
const mapped_file = try std.posix.mmap(
203203
null,
204204
file_size,
205-
std.os.PROT.READ,
205+
std.posix.PROT.READ,
206206
.{.TYPE= .PRIVATE},
207207
file.handle,
208208
0,
209209
);
210-
defer std.os.munmap(mapped_file);
210+
defer std.posix.munmap(mapped_file);
211211

212212
// Setup mincore page vector
213213
const vec = try allocator.alloc(u8, pages);
@@ -293,7 +293,7 @@ pub fn main() !u8 {
293293
}
294294

295295
// Fetch Loaded Pages And Update Page Texture
296-
try std.os.mincore(mapped_file.ptr, file_size, vec.ptr);
296+
try std.posix.mincore(mapped_file.ptr, file_size, vec.ptr);
297297
ray.rlUpdateShaderBuffer(ssbo, vec.ptr, @intCast(vec.len), 0);
298298

299299
ray.BeginDrawing();
@@ -378,13 +378,13 @@ pub fn main() !u8 {
378378
}
379379

380380
if (ray.IsKeyPressed(ray.KEY_F1)) {
381-
try std.os.madvise(mapped_file.ptr, mapped_file.len, std.os.MADV.NORMAL);
381+
try std.posix.madvise(mapped_file.ptr, mapped_file.len, std.posix.MADV.NORMAL);
382382
msg = .{ .msg = .normal };
383383
} else if (ray.IsKeyPressed(ray.KEY_F2)) {
384-
try std.os.madvise(mapped_file.ptr, mapped_file.len, std.os.MADV.SEQUENTIAL);
384+
try std.posix.madvise(mapped_file.ptr, mapped_file.len, std.posix.MADV.SEQUENTIAL);
385385
msg = .{ .msg = .sequential };
386386
} else if (ray.IsKeyPressed(ray.KEY_F3)) {
387-
try std.os.madvise(mapped_file.ptr, mapped_file.len, std.os.MADV.RANDOM);
387+
try std.posix.madvise(mapped_file.ptr, mapped_file.len, std.posix.MADV.RANDOM);
388388
msg = .{ .msg = .random };
389389
} else if (ray.IsKeyPressed(ray.KEY_DELETE)) {
390390
flush();

0 commit comments

Comments
 (0)