diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-04 18:49:24 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-04 18:56:45 +0200 |
commit | a8cf9c5a3ffd1601872d1ab14c5be00fde29209c (patch) | |
tree | 20d9accf1cfeeea31a7252f6d12889160cf3aab0 /include | |
parent | 6a3bcf340aa9d7defc86f21d75fd9412c5b9f427 (diff) | |
download | busybox-w32-a8cf9c5a3ffd1601872d1ab14c5be00fde29209c.tar.gz busybox-w32-a8cf9c5a3ffd1601872d1ab14c5be00fde29209c.tar.bz2 busybox-w32-a8cf9c5a3ffd1601872d1ab14c5be00fde29209c.zip |
libbb: new function bb_getgroups() - allocating wrapper around getgroups()
function old new delta
bb_getgroups - 111 +111
nexpr 843 757 -86
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/1 up/down: 111/-86) Total: 25 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 557978e66..1c9de3af0 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1033,6 +1033,15 @@ void die_if_bad_username(const char* name) FAST_FUNC; | |||
1033 | #else | 1033 | #else |
1034 | #define die_if_bad_username(name) ((void)(name)) | 1034 | #define die_if_bad_username(name) ((void)(name)) |
1035 | #endif | 1035 | #endif |
1036 | /* | ||
1037 | * Returns (-1) terminated malloced result of getgroups(). | ||
1038 | * Reallocs group_array (useful for repeated calls). | ||
1039 | * ngroups is an initial size of array. It is rounded up to 32 for realloc. | ||
1040 | * ngroups is updated on return. | ||
1041 | * ngroups can be NULL: bb_getgroups(NULL, NULL) is valid usage. | ||
1042 | * Dies on errors (on Linux, only xrealloc can cause this, not internal getgroups call). | ||
1043 | */ | ||
1044 | gid_t *bb_getgroups(int *ngroups, gid_t *group_array) FAST_FUNC; | ||
1036 | 1045 | ||
1037 | #if ENABLE_FEATURE_UTMP | 1046 | #if ENABLE_FEATURE_UTMP |
1038 | void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname); | 1047 | void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname); |