authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2020-11-04 22:23:59+11:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2020-11-04 22:23:59+11:00
log02252f3f078c82375857fb5642167ef0e3a72383
tree2ba32c5364a26c243da3ae1b59ef79387a220902
parent342ba960f77010fd195dfb319f97c7329e090a4d
signaturelock-open Commit is signed but in an unrecognized format.

std: workaround #280 in prctl


1 files changed, 4 insertions(+), 1 deletions(-)

lib/std/os.zig+4-1
...@@ -5643,7 +5643,10 @@ pub fn prctl(option: i32, args: anytype) PrctlError!u31 {...@@ -5643,7 +5643,10 @@ pub fn prctl(option: i32, args: anytype) PrctlError!u31 {
5643 @compileError("prctl takes a maximum of 4 optional arguments");5643 @compileError("prctl takes a maximum of 4 optional arguments");
56445644
5645 var buf: [4]usize = undefined;5645 var buf: [4]usize = undefined;
5646 inline for (args) |arg, i| buf[i] = arg;5646 {
5647 comptime var i = 0;
5648 inline while (i < args.len) : (i += 1) buf[i] = args[i];
5649 }
56475650
5648 const rc = system.prctl(option, buf[0], buf[1], buf[2], buf[3]);5651 const rc = system.prctl(option, buf[0], buf[1], buf[2], buf[3]);
5649 switch (errno(rc)) {5652 switch (errno(rc)) {