mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
c_types: make get_groups/get_group_list public
This commit is contained in:
parent
65c224fbf8
commit
c80fdc1a73
1 changed files with 2 additions and 2 deletions
|
@ -137,7 +137,7 @@ pub fn get_group(groupname: &str) -> Option<c_group> {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_group_list(name: *c_char, gid: gid_t) -> Result<Vec<gid_t>, int> {
|
||||
pub fn get_group_list(name: *c_char, gid: gid_t) -> Result<Vec<gid_t>, int> {
|
||||
let mut ngroups = 0 as c_int;
|
||||
|
||||
unsafe { getgrouplist(name, gid, 0 as *mut gid_t, &mut ngroups) };
|
||||
|
@ -151,7 +151,7 @@ fn get_group_list(name: *c_char, gid: gid_t) -> Result<Vec<gid_t>, int> {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_groups() -> Result<Vec<gid_t>, int> {
|
||||
pub fn get_groups() -> Result<Vec<gid_t>, int> {
|
||||
let ngroups = unsafe { getgroups(0, 0 as *mut gid_t) };
|
||||
if ngroups == -1 {
|
||||
return Err(os::errno());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue