Skip to content

Commit

Permalink
coro/aio: x86 support
Browse files Browse the repository at this point in the history
There is no x86 context switch on zefi yet though
  • Loading branch information
Cloudef committed Jun 28, 2024
1 parent bd96fa9 commit 8b027ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/aio/IoUring.zig
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ inline fn uring_queue(io: *std.os.linux.IoUring, op: anytype, user_data: u64) ai
.close_file => try io.close(user_data, op.file.handle),
.close_dir => try io.close(user_data, op.dir.fd),
.timeout => blk: {
const ts: std.os.linux.timespec = .{
const ts: std.os.linux.kernel_timespec = .{
.tv_sec = @intCast(op.ns / std.time.ns_per_s),
.tv_nsec = @intCast(op.ns % std.time.ns_per_s),
};
Expand Down
4 changes: 2 additions & 2 deletions src/aio/posix.zig
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ pub inline fn perform(op: anytype, readiness: Readiness) Operation.Error!void {
switch (comptime Operation.tagFromPayloadType(@TypeOf(op.*))) {
.fsync => _ = try std.posix.fsync(op.file.handle),
.read_tty => op.out_read.* = try readTty(op.tty.handle, op.buffer, op.mode),
.read => op.out_read.* = try readUring(op.file.handle, op.buffer, op.offset),
.read => op.out_read.* = try readUring(op.file.handle, op.buffer, @intCast(op.offset)),
.write => {
const written = try writeUring(op.file.handle, op.buffer, op.offset);
const written = try writeUring(op.file.handle, op.buffer, @intCast(op.offset));
if (op.out_written) |w| w.* = written;
},
.accept => op.out_socket.* = try std.posix.accept(op.socket, op.addr, op.inout_addrlen, 0),
Expand Down

0 comments on commit 8b027ea

Please sign in to comment.