| ... | ... | @@ -1033,7 +1033,7 @@ fn dirMakePathPosix(userdata: ?*anyopaque, dir: Io.Dir, sub_path: []const u8, mo |
| 1033 | 1033 | _ = dir; |
| 1034 | 1034 | _ = sub_path; |
| 1035 | 1035 | _ = mode; |
| 1036 | | @panic("TODO"); |
| 1036 | @panic("TODO implement dirMakePathPosix"); |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | fn dirMakePathWindows(userdata: ?*anyopaque, dir: Io.Dir, sub_path: []const u8, mode: Io.Dir.Mode) Io.Dir.MakeError!void { |
| ... | ... | @@ -1042,7 +1042,7 @@ fn dirMakePathWindows(userdata: ?*anyopaque, dir: Io.Dir, sub_path: []const u8, |
| 1042 | 1042 | _ = dir; |
| 1043 | 1043 | _ = sub_path; |
| 1044 | 1044 | _ = mode; |
| 1045 | | @panic("TODO"); |
| 1045 | @panic("TODO implement dirMakePathWindows"); |
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | fn dirMakeOpenPathPosix( |
| ... | ... | @@ -1176,7 +1176,7 @@ fn dirMakeOpenPathWasi( |
| 1176 | 1176 | _ = dir; |
| 1177 | 1177 | _ = sub_path; |
| 1178 | 1178 | _ = mode; |
| 1179 | | @panic("TODO"); |
| 1179 | @panic("TODO implement dirMakeOpenPathWindows"); |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | fn dirStat(userdata: ?*anyopaque, dir: Io.Dir) Io.Dir.StatError!Io.Dir.Stat { |
| ... | ... | @@ -1184,7 +1184,7 @@ fn dirStat(userdata: ?*anyopaque, dir: Io.Dir) Io.Dir.StatError!Io.Dir.Stat { |
| 1184 | 1184 | try t.checkCancel(); |
| 1185 | 1185 | |
| 1186 | 1186 | _ = dir; |
| 1187 | | @panic("TODO"); |
| 1187 | @panic("TODO implement dirStat"); |
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | fn dirStatPathLinux( |
| ... | ... | @@ -1375,8 +1375,48 @@ fn fileStatLinux(userdata: ?*anyopaque, file: Io.File) Io.File.StatError!Io.File |
| 1375 | 1375 | fn fileStatWindows(userdata: ?*anyopaque, file: Io.File) Io.File.StatError!Io.File.Stat { |
| 1376 | 1376 | const t: *Threaded = @ptrCast(@alignCast(userdata)); |
| 1377 | 1377 | try t.checkCancel(); |
| 1378 | | _ = file; |
| 1379 | | @panic("TODO"); |
| 1378 | |
| 1379 | var io_status_block: windows.IO_STATUS_BLOCK = undefined; |
| 1380 | var info: windows.FILE_ALL_INFORMATION = undefined; |
| 1381 | const rc = windows.ntdll.NtQueryInformationFile(file.handle, &io_status_block, &info, @sizeOf(windows.FILE_ALL_INFORMATION), .FileAllInformation); |
| 1382 | switch (rc) { |
| 1383 | .SUCCESS => {}, |
| 1384 | // Buffer overflow here indicates that there is more information available than was able to be stored in the buffer |
| 1385 | // size provided. This is treated as success because the type of variable-length information that this would be relevant for |
| 1386 | // (name, volume name, etc) we don't care about. |
| 1387 | .BUFFER_OVERFLOW => {}, |
| 1388 | .INVALID_PARAMETER => unreachable, |
| 1389 | .ACCESS_DENIED => return error.AccessDenied, |
| 1390 | else => return windows.unexpectedStatus(rc), |
| 1391 | } |
| 1392 | return .{ |
| 1393 | .inode = info.InternalInformation.IndexNumber, |
| 1394 | .size = @as(u64, @bitCast(info.StandardInformation.EndOfFile)), |
| 1395 | .mode = 0, |
| 1396 | .kind = if (info.BasicInformation.FileAttributes & windows.FILE_ATTRIBUTE_REPARSE_POINT != 0) reparse_point: { |
| 1397 | var tag_info: windows.FILE_ATTRIBUTE_TAG_INFO = undefined; |
| 1398 | const tag_rc = windows.ntdll.NtQueryInformationFile(file.handle, &io_status_block, &tag_info, @sizeOf(windows.FILE_ATTRIBUTE_TAG_INFO), .FileAttributeTagInformation); |
| 1399 | switch (tag_rc) { |
| 1400 | .SUCCESS => {}, |
| 1401 | // INFO_LENGTH_MISMATCH and ACCESS_DENIED are the only documented possible errors |
| 1402 | // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/d295752f-ce89-4b98-8553-266d37c84f0e |
| 1403 | .INFO_LENGTH_MISMATCH => unreachable, |
| 1404 | .ACCESS_DENIED => return error.AccessDenied, |
| 1405 | else => return windows.unexpectedStatus(rc), |
| 1406 | } |
| 1407 | if (tag_info.ReparseTag & windows.reparse_tag_name_surrogate_bit != 0) { |
| 1408 | break :reparse_point .sym_link; |
| 1409 | } |
| 1410 | // Unknown reparse point |
| 1411 | break :reparse_point .unknown; |
| 1412 | } else if (info.BasicInformation.FileAttributes & windows.FILE_ATTRIBUTE_DIRECTORY != 0) |
| 1413 | .directory |
| 1414 | else |
| 1415 | .file, |
| 1416 | .atime = windows.fromSysTime(info.BasicInformation.LastAccessTime), |
| 1417 | .mtime = windows.fromSysTime(info.BasicInformation.LastWriteTime), |
| 1418 | .ctime = windows.fromSysTime(info.BasicInformation.ChangeTime), |
| 1419 | }; |
| 1380 | 1420 | } |
| 1381 | 1421 | |
| 1382 | 1422 | fn fileStatWasi(userdata: ?*anyopaque, file: Io.File) Io.File.StatError!Io.File.Stat { |
| ... | ... | @@ -2490,7 +2530,7 @@ fn fileSeekBy(userdata: ?*anyopaque, file: Io.File, offset: i64) Io.File.SeekErr |
| 2490 | 2530 | |
| 2491 | 2531 | _ = file; |
| 2492 | 2532 | _ = offset; |
| 2493 | | @panic("TODO"); |
| 2533 | @panic("TODO implement fileSeekBy"); |
| 2494 | 2534 | } |
| 2495 | 2535 | |
| 2496 | 2536 | fn fileSeekTo(userdata: ?*anyopaque, file: Io.File, offset: u64) Io.File.SeekError!void { |
| ... | ... | @@ -2571,7 +2611,7 @@ fn openSelfExe(userdata: ?*anyopaque, flags: Io.File.OpenFlags) Io.File.OpenSelf |
| 2571 | 2611 | |
| 2572 | 2612 | return dirOpenFileWindowsInner(t, .{ .handle = cwd_handle }, image_path_name, flags); |
| 2573 | 2613 | } |
| 2574 | | @panic("TODO"); |
| 2614 | @panic("TODO implement openSelfExe"); |
| 2575 | 2615 | } |
| 2576 | 2616 | |
| 2577 | 2617 | fn fileWritePositional( |
| ... | ... | @@ -2586,7 +2626,7 @@ fn fileWritePositional( |
| 2586 | 2626 | _ = file; |
| 2587 | 2627 | _ = buffer; |
| 2588 | 2628 | _ = offset; |
| 2589 | | @panic("TODO"); |
| 2629 | @panic("TODO implement fileWritePositional"); |
| 2590 | 2630 | } |
| 2591 | 2631 | } |
| 2592 | 2632 | |
| ... | ... | @@ -2596,7 +2636,7 @@ fn fileWriteStreaming(userdata: ?*anyopaque, file: Io.File, buffer: [][]const u8 |
| 2596 | 2636 | try t.checkCancel(); |
| 2597 | 2637 | _ = file; |
| 2598 | 2638 | _ = buffer; |
| 2599 | | @panic("TODO"); |
| 2639 | @panic("TODO implement fileWriteStreaming"); |
| 2600 | 2640 | } |
| 2601 | 2641 | } |
| 2602 | 2642 | |
| ... | ... | @@ -2922,7 +2962,7 @@ fn netListenUnixWindows( |
| 2922 | 2962 | try t.checkCancel(); |
| 2923 | 2963 | _ = address; |
| 2924 | 2964 | _ = options; |
| 2925 | | @panic("TODO"); |
| 2965 | @panic("TODO implement netListenUnixWindows"); |
| 2926 | 2966 | } |
| 2927 | 2967 | |
| 2928 | 2968 | fn posixBindUnix(t: *Threaded, fd: posix.socket_t, addr: *const posix.sockaddr, addr_len: posix.socklen_t) !void { |
| ... | ... | @@ -3122,7 +3162,7 @@ fn netConnectIpPosix( |
| 3122 | 3162 | options: IpAddress.ConnectOptions, |
| 3123 | 3163 | ) IpAddress.ConnectError!net.Stream { |
| 3124 | 3164 | if (!have_networking) return error.NetworkDown; |
| 3125 | | if (options.timeout != .none) @panic("TODO"); |
| 3165 | if (options.timeout != .none) @panic("TODO implement netConnectIpPosix with timeout"); |
| 3126 | 3166 | const t: *Threaded = @ptrCast(@alignCast(userdata)); |
| 3127 | 3167 | const family = posixAddressFamily(address); |
| 3128 | 3168 | const socket_fd = try openSocketPosix(t, family, .{ |
| ... | ... | @@ -3146,7 +3186,7 @@ fn netConnectIpWindows( |
| 3146 | 3186 | options: IpAddress.ConnectOptions, |
| 3147 | 3187 | ) IpAddress.ConnectError!net.Stream { |
| 3148 | 3188 | if (!have_networking) return error.NetworkDown; |
| 3149 | | if (options.timeout != .none) @panic("TODO"); |
| 3189 | if (options.timeout != .none) @panic("TODO implement netConnectIpWindows with timeout"); |
| 3150 | 3190 | const t: *Threaded = @ptrCast(@alignCast(userdata)); |
| 3151 | 3191 | const family = posixAddressFamily(address); |
| 3152 | 3192 | const socket_handle = try openSocketWsa(t, family, .{ |
| ... | ... | @@ -3220,7 +3260,7 @@ fn netConnectUnixWindows( |
| 3220 | 3260 | const t: *Threaded = @ptrCast(@alignCast(userdata)); |
| 3221 | 3261 | try t.checkCancel(); |
| 3222 | 3262 | _ = address; |
| 3223 | | @panic("TODO"); |
| 3263 | @panic("TODO implement netConnectUnixWindows"); |
| 3224 | 3264 | } |
| 3225 | 3265 | |
| 3226 | 3266 | fn netBindIpPosix( |
| ... | ... | @@ -3525,7 +3565,7 @@ fn netReadWindows(userdata: ?*anyopaque, handle: net.Socket.Handle, data: [][]u8 |
| 3525 | 3565 | _ = t; |
| 3526 | 3566 | _ = handle; |
| 3527 | 3567 | _ = data; |
| 3528 | | @panic("TODO"); |
| 3568 | @panic("TODO implement netReadWindows"); |
| 3529 | 3569 | } |
| 3530 | 3570 | |
| 3531 | 3571 | fn netSendPosix( |
| ... | ... | @@ -3569,7 +3609,7 @@ fn netSendWindows( |
| 3569 | 3609 | _ = handle; |
| 3570 | 3610 | _ = messages; |
| 3571 | 3611 | _ = flags; |
| 3572 | | @panic("TODO"); |
| 3612 | @panic("TODO netSendWindows"); |
| 3573 | 3613 | } |
| 3574 | 3614 | |
| 3575 | 3615 | fn netSendOne( |
| ... | ... | @@ -3872,7 +3912,7 @@ fn netReceiveWindows( |
| 3872 | 3912 | _ = data_buffer; |
| 3873 | 3913 | _ = flags; |
| 3874 | 3914 | _ = timeout; |
| 3875 | | @panic("TODO"); |
| 3915 | @panic("TODO implement netReceiveWindows"); |
| 3876 | 3916 | } |
| 3877 | 3917 | |
| 3878 | 3918 | fn netWritePosix( |
| ... | ... | @@ -3970,7 +4010,7 @@ fn netWriteWindows( |
| 3970 | 4010 | _ = header; |
| 3971 | 4011 | _ = data; |
| 3972 | 4012 | _ = splat; |
| 3973 | | @panic("TODO"); |
| 4013 | @panic("TODO implement netWriteWindows"); |
| 3974 | 4014 | } |
| 3975 | 4015 | |
| 3976 | 4016 | fn addBuf(v: []posix.iovec_const, i: *@FieldType(posix.msghdr_const, "iovlen"), bytes: []const u8) void { |
| ... | ... | @@ -4036,7 +4076,7 @@ fn netInterfaceNameResolve( |
| 4036 | 4076 | |
| 4037 | 4077 | if (native_os == .windows) { |
| 4038 | 4078 | try t.checkCancel(); |
| 4039 | | @panic("TODO"); |
| 4079 | @panic("TODO implement netInterfaceNameResolve for Windows"); |
| 4040 | 4080 | } |
| 4041 | 4081 | |
| 4042 | 4082 | if (builtin.link_libc) { |
| ... | ... | @@ -4055,15 +4095,15 @@ fn netInterfaceName(userdata: ?*anyopaque, interface: net.Interface) net.Interfa |
| 4055 | 4095 | |
| 4056 | 4096 | if (native_os == .linux) { |
| 4057 | 4097 | _ = interface; |
| 4058 | | @panic("TODO"); |
| 4098 | @panic("TODO implement netInterfaceName for linux"); |
| 4059 | 4099 | } |
| 4060 | 4100 | |
| 4061 | 4101 | if (native_os == .windows) { |
| 4062 | | @panic("TODO"); |
| 4102 | @panic("TODO implement netInterfaceName for windows"); |
| 4063 | 4103 | } |
| 4064 | 4104 | |
| 4065 | 4105 | if (builtin.link_libc) { |
| 4066 | | @panic("TODO"); |
| 4106 | @panic("TODO implement netInterfaceName for libc"); |
| 4067 | 4107 | } |
| 4068 | 4108 | |
| 4069 | 4109 | @panic("unimplemented"); |