pwd_grp.c: unlocked functions [PATCH]

Rob Landley rob at landley.net
Fri Oct 7 22:54:53 UTC 2005


On Friday 07 October 2005 16:19, Shaun Jackman wrote:
> 2005/10/7, Rob Landley <rob at landley.net>:
> > We should be consistent.  Either tell me to remove all the _unlocked
> > occurrences or none of them.
>
> man getc_unlocked
>
> The four functions getc_unlocked(), getchar_unlocked(),
> putc_unlocked(), putchar_unlocked() are in POSIX.1. The nonstandard
> *_unlocked() variants occur on a few Unix systems, and are available
> in recent glibc. They should probably not be used.
>
> I removed only the uses of the *non-standard* functions.

Correct me if I'm wrong, but using _unlocked variants of anything is a 
sub-milisecond optimization in the runtime of the "passwd" command, correct?  
(We're going through an entirely unnecessary intermediate memory buffer, but 
we're going to avoid a futex in libc?)

Rob



More information about the busybox mailing list