| ... | @@ -1131,7 +1131,7 @@ pub fn execve( | ... | @@ -1131,7 +1131,7 @@ pub fn execve( |
| 1131 | defer arena_allocator.deinit(); | 1131 | defer arena_allocator.deinit(); |
| 1132 | const arena = arena_allocator.allocator(); | 1132 | const arena = arena_allocator.allocator(); |
| 1133 | | 1133 | |
| 1134 | const argv_buf = try arena.allocSentinel(?[*:0]u8, argv.len, null); | 1134 | const argv_buf = try arena.allocSentinel(?[*:0]const u8, argv.len, null); |
| 1135 | for (argv, 0..) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr; | 1135 | for (argv, 0..) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr; |
| 1136 | | 1136 | |
| 1137 | const envp = m: { | 1137 | const envp = m: { |
| ... | @@ -1143,7 +1143,7 @@ pub fn execve( | ... | @@ -1143,7 +1143,7 @@ pub fn execve( |
| 1143 | } else if (builtin.output_mode == .Exe) { | 1143 | } else if (builtin.output_mode == .Exe) { |
| 1144 | // Then we have Zig start code and this works. | 1144 | // Then we have Zig start code and this works. |
| 1145 | // TODO type-safety for null-termination of `os.environ`. | 1145 | // TODO type-safety for null-termination of `os.environ`. |
| 1146 | break :m @ptrCast([*:null]?[*:0]u8, os.environ.ptr); | 1146 | break :m @ptrCast([*:null]?[*:0]const u8, os.environ.ptr); |
| 1147 | } else { | 1147 | } else { |
| 1148 | // TODO come up with a solution for this. | 1148 | // TODO come up with a solution for this. |
| 1149 | @compileError("missing std lib enhancement: std.process.execv implementation has no way to collect the environment variables to forward to the child process"); | 1149 | @compileError("missing std lib enhancement: std.process.execv implementation has no way to collect the environment variables to forward to the child process"); |