This function used to be perfectly functional, however has completely stopped functioning whatsoever.
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
const stdin = std.io.getStdIn().reader();
var sa: std.posix.Sigaction = .{
.handler = .{ .sigaction = usrSigHandler },
.mask = std.posix.empty_sigset,
.flags = std.posix.SA.RESTART,
};
std.posix.sigaction(std.posix.SIG.USR1, &sa, null);
std.posix.sigaction(std.posix.SIG.USR2, &sa, null);
//Trying to see if it was an issue with the sigaction
usrSigHandler(12, &std.posix.siginfo_t{ // random-ass values
.signo = 12,
.code = 0,
.errno = 0,
.fields = .{
.common = .{
.first = .{
.piduid = .{
.pid = 69,
.uid = 420
}
},
.second = .{
.sigchld = .{
.status = 0,
.stime = 1,
.utime = 1
}
}
}
}
},
[Random pointer here]
);
while (true) {
...
}
}
fn usrSigHandler(sig: i32, info: *const std.posix.siginfo_t, _: ?*anyopaque) callconv(.C) void {
//this shit aint running at all
std.debug.print("Signal {d} recieved\n", .{sig});
...