File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1002,8 +1002,9 @@ pub fn getgroups() -> Result<Vec<Gid>> {
1002
1002
// now too small
1003
1003
let mut groups = Vec :: < Gid > :: with_capacity ( size as usize ) ;
1004
1004
loop {
1005
- // We can coerce a pointer to some `Gid`s as a pointer to some `gid_t`s
1006
- // as they have the same representation in memory.
1005
+ // FIXME: On the platforms we currently support, the `Gid` struct has
1006
+ // the same representation in memory as a bare `gid_t`. This is not
1007
+ // necessarily the case on all Rust platforms, though. See RFC 1785.
1007
1008
let ret = unsafe { libc:: getgroups ( size, groups. as_mut_ptr ( ) as * mut gid_t ) } ;
1008
1009
1009
1010
match Errno :: result ( ret) {
@@ -1043,8 +1044,9 @@ pub fn setgroups(groups: &[Gid]) -> Result<()> {
1043
1044
type setgroups_ngroups_t = size_t;
1044
1045
}
1045
1046
}
1046
- // We can coerce a pointer to some `Gid`s as a pointer to some `gid_t`s as
1047
- // they have the same representation in memory.
1047
+ // FIXME: On the platforms we currently support, the `Gid` struct has the
1048
+ // same representation in memory as a bare `gid_t`. This is not necessarily
1049
+ // the case on all Rust platforms, though. See RFC 1785.
1048
1050
let res = unsafe {
1049
1051
libc:: setgroups ( groups. len ( ) as setgroups_ngroups_t , groups. as_ptr ( ) as * const gid_t )
1050
1052
} ;
You can’t perform that action at this time.
0 commit comments