From 9af93437456fda9e50a9d577315995900b868c92 Mon Sep 17 00:00:00 2001 From: Jan Scheer Date: Sun, 13 Jun 2021 10:12:00 +0200 Subject: [PATCH] uucore: entries: add documentation --- src/uucore/src/lib/features/entries.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/uucore/src/lib/features/entries.rs b/src/uucore/src/lib/features/entries.rs index b94abbe4f..2d5b44362 100644 --- a/src/uucore/src/lib/features/entries.rs +++ b/src/uucore/src/lib/features/entries.rs @@ -179,6 +179,13 @@ impl Passwd { self.inner } + /// This is a wrapper function for `libc::getgrouplist`. + /// + /// From: https://man7.org/linux/man-pages/man3/getgrouplist.3.html + /// If the user is a member of more than *ngroups groups, then + /// getgrouplist() returns -1. In this case, the value returned in + /// *ngroups can be used to resize the buffer passed to a further + /// call getgrouplist(). pub fn belongs_to(&self) -> Vec { let mut ngroups: c_int = 8; let mut groups = Vec::with_capacity(ngroups as usize);