Skip to content

Commit 5099ead

Browse files
committed
unistd::getgrouplist: Move error explanation to correct section
1 parent da2c8e8 commit 5099ead

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/unistd.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ pub enum Whence {
779779
SeekCur = libc::SEEK_CUR,
780780
/// Specify an offset relative to the end of the file.
781781
SeekEnd = libc::SEEK_END,
782-
/// Specify an offset relative to the next location in the file greater than or
782+
/// Specify an offset relative to the next location in the file greater than or
783783
/// equal to offset that contains some data. If offset points to
784784
/// some data, then the file offset is set to offset.
785785
#[cfg(any(target_os = "dragonfly", target_os = "freebsd",
@@ -788,7 +788,7 @@ pub enum Whence {
788788
target_arch = "mips64")))))]
789789
SeekData = libc::SEEK_DATA,
790790
/// Specify an offset relative to the next hole in the file greater than
791-
/// or equal to offset. If offset points into the middle of a hole, then
791+
/// or equal to offset. If offset points into the middle of a hole, then
792792
/// the file offset should be set to offset. If there is no hole past offset,
793793
/// then the file offset should be adjusted to the end of the file (i.e., there
794794
/// is an implicit hole at the end of any file).
@@ -1056,15 +1056,17 @@ pub fn setgroups(groups: &[Gid]) -> Result<()> {
10561056
/// groups that `user` is a member of. The additional group `group` is also
10571057
/// added to the list.
10581058
///
1059-
/// *Note:* Although the `getgrouplist()` call does not return any specific
1059+
/// [Further reading](http://man7.org/linux/man-pages/man3/getgrouplist.3.html)
1060+
///
1061+
/// # Errors
1062+
///
1063+
/// Although the `getgrouplist()` call does not return any specific
10601064
/// errors on any known platforms, this implementation will return a system
10611065
/// error of `EINVAL` if the number of groups to be fetched exceeds the
10621066
/// `NGROUPS_MAX` sysconf value. This mimics the behaviour of `getgroups()`
10631067
/// and `setgroups()`. Additionally, while some implementations will return a
10641068
/// partial list of groups when `NGROUPS_MAX` is exceeded, this implementation
10651069
/// will only ever return the complete list or else an error.
1066-
///
1067-
/// [Further reading](http://man7.org/linux/man-pages/man3/getgrouplist.3.html)
10681070
pub fn getgrouplist(user: &CString, group: Gid) -> Result<Vec<Gid>> {
10691071
let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) {
10701072
Ok(Some(n)) => n as c_int,

0 commit comments

Comments
 (0)