authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2022-05-13 08:52:06-06:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2022-05-13 17:46:56+02:00
logaceb7e18bd1eb25affe8118e01e066c9e6bb0c04
treef2b9ed89bd245c8c4348db0df4380c9c9b42ca68
parent537f9052167a683c922c9815eb9fdce5b0778dc2

std.os.linux: fix signature of setgroups

the list parameter should be a multi-item pointer rather than a single-item pointer. see: https://linux.die.net/man/2/setgroups > setgroups() sets the supplementary group IDs for the calling process... > the size argument specifies the number of supplementary group IDs in the buffer pointed to by list.

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

lib/std/os/linux.zig+1-1
...@@ -1051,7 +1051,7 @@ pub fn getgroups(size: usize, list: *gid_t) usize {...@@ -1051,7 +1051,7 @@ pub fn getgroups(size: usize, list: *gid_t) usize {
1051 }1051 }
1052}1052}
10531053
1054pub fn setgroups(size: usize, list: *const gid_t) usize {1054pub fn setgroups(size: usize, list: [*]const gid_t) usize {
1055 if (@hasField(SYS, "setgroups32")) {1055 if (@hasField(SYS, "setgroups32")) {
1056 return syscall2(.setgroups32, size, @ptrToInt(list));1056 return syscall2(.setgroups32, size, @ptrToInt(list));
1057 } else {1057 } else {