[PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r

Rich Felker dalias at libc.org
Thu Feb 5 18:46:01 UTC 2015


On Thu, Feb 05, 2015 at 02:09:36PM +0100, Denys Vlasenko wrote:
> On Fri, Apr 25, 2014 at 9:36 AM, Natanael Copa <ncopa at alpinelinux.org> wrote:
> > Prefer use POSIX getpwent over glibc extension getpwent_r. This fixes
> > building with musl libc with CONFIG_USE_BB_PWD_GRP disabled.
> 
> Sorry, I missed this patch.
> 
> How much static data ("data" or "bss" increase according to "size busybox")
> do these functions pull in in static build?
> 
> The comments specifically say they use getpwent_r because that avoids
> static data size penalty, usually about 1k.

The static size penalty on musl is a few bytes. We don't have full
static buffers for the strings but just use the buffer getline()
produces while reading the file, so only this pointer and the passwd
struct itself, not the strings it points to, have static storage.

Rich


More information about the busybox mailing list