This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] login: Use aliases for most utmpx functions
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Fri, 17 Aug 2018 13:33:27 -0300
- Subject: Re: [PATCH] login: Use aliases for most utmpx functions
- References: <20180817144459.8136E4028A980@oldenburg.str.redhat.com>
On 17/08/2018 11:44, Florian Weimer wrote:
> The existing implementations simply called the utmp functions,
> with casts if necessary (struct utmpx and struct utmp have the
> same layout).
>
> 2018-08-17 Florian Weimer <fweimer@redhat.com>
>
> [BZ #23518]
> * login/endutxent.c, login/getutxent.c, login/getutxid.c,
> login/getutxline.c, login/pututxline.c, login/updwtmpx.c,
> login/utmpxname.c,
> sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c,
> sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c,
> sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c,
> sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c,
> sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c: Remove files.
> * login/getutent.c (__getutent): Add getutxent, __getutxent
> aliases.
> * login/getutent_r.c (__setutent): Add setutxent, __setutxent
> aliases.
> (__pututline): Add pututxline, __pututxline aliases.
> (__endutent): Add endutxent, __endutxent aliases.
> * login/getutid.c (__getutid): Add getutxid, __getutxid aliases.
> * login/getutline.c (__getutline): Add getutxline, __getutxline
> aliases.
> * login/updwtmpx.c (__updwtmp): Add updwtmx, __updwtmpx aliases.
> * login/utmpname.c (__utmpname): Add utmpxname alias.
> * sysdeps/gnu/Makefile [$(subdir) == login] (sysdep_routines):
> Remove setutxent, getutxent, endutxent, getutxid, getutxline,
> pututxline, utmpxname, updwtmpx.
> * sysdeps/unix/sysv/linux/s390/s390-32/getutent.c (__getutxent):
> Add getutxent alias.
> * sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c
> (__setutent): Add setutxent alias.
> (__endutent): Add endutxent alias.
> (__pututxline): Add pututxline alias.
> * sysdeps/unix/sysv/linux/s390/s390-32/getutid.c (__getutxid): Add
> getutxid alias.
> * sysdeps/unix/sysv/linux/s390/s390-32/getutline.c (__getutxline):
> Add getutxline alias.
LGTM. I wonder if it is worth to add Static_assert to check for equality of
internal offsets from struct utmpx and struct utmp.