diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2024-10-07 01:20:43 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2024-10-07 01:20:43 +0200 |
| commit | 748b1681549067f2e27ab2b9102ef9352cfa8a4c (patch) | |
| tree | 1b0bc13cd7a5297747ef600999a63dc0a97e8d06 /include | |
| parent | bb5525613ec109aa30d2cb1db84e18aa0b084576 (diff) | |
libbb: move is_in_supplementary_groups() from test to libbb
function old new delta
is_in_supplementary_groups - 54 +54
nexpr 766 721 -45
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 54/-45) Total: 9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 67e7bf7b9..e06aef08e 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1201,6 +1201,11 @@ void die_if_bad_username(const char* name) FAST_FUNC; * Dies on errors (on Linux, only xrealloc can cause this, not internal getgroups call). */ gid_t *bb_getgroups(int *ngroups, gid_t *group_array) FAST_FUNC; +/* + * True if GID is in our getgroups() result. + * getgroups() is cached in group_array[], to makse successive calls faster. + */ +int FAST_FUNC is_in_supplementary_groups(int *pngroups, gid_t **pgroup_array, gid_t gid); #if ENABLE_FEATURE_UTMP void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname); |
