Skip to content

Commit 3a836b4

Browse files
authored
Merge pull request #19354 from ziglang/std.posix
extract std.posix from std.os
2 parents 7057bff + 8c94950 commit 3a836b4

File tree

114 files changed

+10447
-10510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+10447
-10510
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ set(ZIG_STAGE2_SOURCES
286286
"${CMAKE_SOURCE_DIR}/lib/std/multi_array_list.zig"
287287
"${CMAKE_SOURCE_DIR}/lib/std/os.zig"
288288
"${CMAKE_SOURCE_DIR}/lib/std/os/linux.zig"
289-
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/errno/generic.zig"
290289
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/x86_64.zig"
291290
"${CMAKE_SOURCE_DIR}/lib/std/os/linux.zig"
292291
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/IoUring.zig"

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ fn findConfigH(b: *std.Build, config_h_path_option: ?[]const u8) ?[]const u8 {
882882
return path;
883883
} else |_| {
884884
std.log.err("Could not open provided config.h: \"{s}\"", .{path});
885-
std.os.exit(1);
885+
std.process.exit(1);
886886
}
887887
}
888888

lib/compiler/objcopy.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ const ElfFileHelper = struct {
12851285
for (consolidated.items) |cmd| {
12861286
switch (cmd) {
12871287
.write_data => |data| {
1288-
var iovec = [_]std.os.iovec_const{.{ .iov_base = data.data.ptr, .iov_len = data.data.len }};
1288+
var iovec = [_]std.posix.iovec_const{.{ .iov_base = data.data.ptr, .iov_len = data.data.len }};
12891289
try out_file.pwritevAll(&iovec, data.out_offset);
12901290
},
12911291
.copy_range => |range| {

lib/compiler/resinator/main.zig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn main() !void {
2626

2727
if (args.len < 2) {
2828
try renderErrorMessage(stderr.writer(), stderr_config, .err, "expected zig lib dir as first argument", .{});
29-
std.os.exit(1);
29+
std.process.exit(1);
3030
}
3131
const zig_lib_dir = args[1];
3232
var cli_args = args[2..];
@@ -62,7 +62,7 @@ pub fn main() !void {
6262
var options = cli.parse(allocator, cli_args, &cli_diagnostics) catch |err| switch (err) {
6363
error.ParseError => {
6464
try error_handler.emitCliDiagnostics(allocator, cli_args, &cli_diagnostics);
65-
std.os.exit(1);
65+
std.process.exit(1);
6666
},
6767
else => |e| return e,
6868
};
@@ -117,7 +117,7 @@ pub fn main() !void {
117117
},
118118
}
119119
try error_handler.emitMessage(allocator, .note, "to disable auto includes, use the option /:auto-includes none", .{});
120-
std.os.exit(1);
120+
std.process.exit(1);
121121
},
122122
};
123123

@@ -153,16 +153,16 @@ pub fn main() !void {
153153
preprocess.preprocess(&comp, preprocessed_buf.writer(), argv.items, maybe_dependencies_list) catch |err| switch (err) {
154154
error.GeneratedSourceError => {
155155
try error_handler.emitAroDiagnostics(allocator, "failed during preprocessor setup (this is always a bug):", &comp);
156-
std.os.exit(1);
156+
std.process.exit(1);
157157
},
158158
// ArgError can occur if e.g. the .rc file is not found
159159
error.ArgError, error.PreprocessError => {
160160
try error_handler.emitAroDiagnostics(allocator, "failed during preprocessing:", &comp);
161-
std.os.exit(1);
161+
std.process.exit(1);
162162
},
163163
error.StreamTooLong => {
164164
try error_handler.emitMessage(allocator, .err, "failed during preprocessing: maximum file size exceeded", .{});
165-
std.os.exit(1);
165+
std.process.exit(1);
166166
},
167167
error.OutOfMemory => |e| return e,
168168
};
@@ -171,7 +171,7 @@ pub fn main() !void {
171171
} else {
172172
break :full_input std.fs.cwd().readFileAlloc(allocator, options.input_filename, std.math.maxInt(usize)) catch |err| {
173173
try error_handler.emitMessage(allocator, .err, "unable to read input file path '{s}': {s}", .{ options.input_filename, @errorName(err) });
174-
std.os.exit(1);
174+
std.process.exit(1);
175175
};
176176
}
177177
};
@@ -191,14 +191,14 @@ pub fn main() !void {
191191
const final_input = removeComments(mapping_results.result, mapping_results.result, &mapping_results.mappings) catch |err| switch (err) {
192192
error.InvalidSourceMappingCollapse => {
193193
try error_handler.emitMessage(allocator, .err, "failed during comment removal; this is a known bug", .{});
194-
std.os.exit(1);
194+
std.process.exit(1);
195195
},
196196
else => |e| return e,
197197
};
198198

199199
var output_file = std.fs.cwd().createFile(options.output_filename, .{}) catch |err| {
200200
try error_handler.emitMessage(allocator, .err, "unable to create output file '{s}': {s}", .{ options.output_filename, @errorName(err) });
201-
std.os.exit(1);
201+
std.process.exit(1);
202202
};
203203
var output_file_closed = false;
204204
defer if (!output_file_closed) output_file.close();
@@ -231,7 +231,7 @@ pub fn main() !void {
231231
output_file_closed = true;
232232
// Failing to delete is not really a big deal, so swallow any errors
233233
std.fs.cwd().deleteFile(options.output_filename) catch {};
234-
std.os.exit(1);
234+
std.process.exit(1);
235235
},
236236
else => |e| return e,
237237
};
@@ -247,7 +247,7 @@ pub fn main() !void {
247247
if (options.depfile_path) |depfile_path| {
248248
var depfile = std.fs.cwd().createFile(depfile_path, .{}) catch |err| {
249249
try error_handler.emitMessage(allocator, .err, "unable to create depfile '{s}': {s}", .{ depfile_path, @errorName(err) });
250-
std.os.exit(1);
250+
std.process.exit(1);
251251
};
252252
defer depfile.close();
253253

lib/std/Random/benchmark.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ pub fn main() !void {
144144
i += 1;
145145
if (i == args.len) {
146146
usage();
147-
std.os.exit(1);
147+
std.process.exit(1);
148148
}
149149

150150
filter = args[i];
151151
} else if (std.mem.eql(u8, args[i], "--count")) {
152152
i += 1;
153153
if (i == args.len) {
154154
usage();
155-
std.os.exit(1);
155+
std.process.exit(1);
156156
}
157157

158158
const c = try std.fmt.parseUnsigned(usize, args[i], 10);
@@ -170,7 +170,7 @@ pub fn main() !void {
170170
return;
171171
} else {
172172
usage();
173-
std.os.exit(1);
173+
std.process.exit(1);
174174
}
175175
}
176176

0 commit comments

Comments
 (0)