Skip to content

Commit 4400144

Browse files
fix(painting): make fd fb work
1 parent 1d703de commit 4400144

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/phantom/painting/fb/fd.zig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ pub fn create(alloc: Allocator, info: Base.Info, fd: std.os.fd_t) !*Base {
1616
self.* = .{
1717
.info = info,
1818
.fd = fd,
19-
.buffer = try std.os.mmap(null, info.res.value[0] * info.res.value[1] * @divExact(info.colorFormat.width(), 8), std.os.PROT.READ | std.os.PROT.WRITE, std.os.MAP.TYPE.SHARED, fd, 0),
19+
.buffer = try std.os.mmap(null, info.res.value[0] * info.res.value[1] * @divExact(info.colorFormat.width(), 8), std.os.PROT.READ | std.os.PROT.WRITE, .{
20+
.TYPE = .SHARED,
21+
}, fd, 0),
2022
.base = .{
2123
.allocator = alloc,
2224
.vtable = &.{
@@ -51,7 +53,9 @@ fn impl_dupe(ctx: *anyopaque) anyerror!*Base {
5153
d.* = .{
5254
.info = self.info,
5355
.fd = self.fd,
54-
.buffer = try std.os.mmap(null, self.info.res.value[0] * self.info.res.value[1] * @divExact(self.info.colorFormat.width(), 8), std.os.PROT.READ | std.os.PROT.WRITE, std.os.MAP.TYPE.SHARED, self.fd, 0),
56+
.buffer = try std.os.mmap(null, self.info.res.value[0] * self.info.res.value[1] * @divExact(self.info.colorFormat.width(), 8), std.os.PROT.READ | std.os.PROT.WRITE, .{
57+
.TYPE = .SHARED,
58+
}, self.fd, 0),
5559
.base = .{
5660
.ptr = d,
5761
.allocator = self.base.allocator,

0 commit comments

Comments
 (0)