zig icon indicating copy to clipboard operation
zig copied to clipboard

std.os: getauxval wrapper

Open devnexen opened this issue 2 years ago • 3 comments

devnexen avatar May 22 '23 19:05 devnexen

cc @Vexu 🙂

devnexen avatar May 24 '23 16:05 devnexen

@devnexen what are you working on? are you using this for anything?

andrewrk avatar May 24 '23 18:05 andrewrk

  • This getauxval wrapper allows to query the auxiliary vector for both Linux and FreeBSD.
  • Other libraries tend to do the same like here.
  • Tested with the following `const std = @import("std");

pub fn main() !void { const key: u32 = std.c.AT.EXECPATH; var r = try std.os.getauxval(key); std.debug.print("{}\n", .{@intToPtr(*const u8, r)}); }`

devnexen avatar Jun 19 '23 19:06 devnexen