Skip to content

Commit

Permalink
fix arm64 alignment issues in signal()
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanschneider committed Oct 27, 2022
1 parent 41264cb commit 6b38f54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cstd.zig
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,12 @@ export fn strerror(errnum: c_int) callconv(.C) [*:0]const u8 {
// --------------------------------------------------------------------------------
const SignalFn = switch (builtin.zig_backend) {
.stage1 => fn(c_int) callconv(.C) void,
else => *const fn(c_int) callconv(.C) void,
else => *align(1) const fn(c_int) callconv(.C) void,
};
export fn signal(sig: c_int, func: SignalFn) callconv(.C) ?SignalFn {
if (builtin.os.tag == .linux) {
var action = std.os.Sigaction{
.handler = .{ .handler = func },
.handler = .{ .handler = @alignCast(@alignOf(fn(c_int) callconv(.C) void), func) },
.mask = std.os.linux.empty_sigset,
.flags = std.os.SA.RESTART,
.restorer = null,
Expand Down

0 comments on commit 6b38f54

Please sign in to comment.