This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] ppc64 utmp changes
- From: "Steve Munroe" <sjmunroe at us dot ibm dot com>
- To: Martin_Schwidefsky/Germany/IBM%IBMDE <schwidefsky at de dot ibm dot com>
- Cc: aj at suse dot de, bcollins at debian dot org, Jakub Jelinek <jakub at redhat dot com>, libc-alpha at sources dot redhat dot com
- Date: Tue, 1 Oct 2002 09:51:19 -0500
- Subject: Re: [PATCH] ppc64 utmp changes
Martin Schwidefsky writes:
> Hmm, I checked utmp.h and utmpx.h on a 31 bit system 64 bit system. The
> files are identical but the structures have a different layout (__time_t
> and __suseconds_t have type unsigned long -> 4 vs. 8 byte). This makes
> the /var/log/wtmp format different on 31bit vs. 64bit. So 31 bit programs
> running on 64 bit may not access /var/log/wtmp. To make things worse we
> already have a 64 bit distro out there so we can't simply change utmp.h.
> Now it depends which programs do access /var/log/wtmp. For the standard
> stuff in a distribution we always use the 64 bit versions of the programs.
On Tue, Oct 01, 2002 at 03:44:58AM -0700, Roland McGrath wrote:
>
>
> Right, the always-64 platforms. I would be happier with a new sysdeps
> macro for 64-bit platforms saying whether they have 32-bit-compatible
file
> formats, just defined in some other file, and not having bits/utmp{x,}.h
> copied. It could be a macro just about utmp in an extra tiny bits/
header,
> or it could be in bits/wordsize.h something like __WORDSIZE_COMPAT32 and
> perhaps be used by other such cases if they come up. i.e.
>
> #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
> struct { __int32_t ... }
> #else
> struct timeval ...;
> #endif
Seems like we might need the full "cross product" (i.e. __WORDSIZE_COMPAT32
and __WORDSIZE_COMPAT64). This should allow s390 32-bit appplications to
use
getlogin(). for example:
#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
struct
{
__int32_t tv_sec; /* Seconds. */
__int32_t tv_usec; /* Microseconds. */
} ut_tv; /* Time entry was made. */
#else
# if __WORDSIZE == 32 && defined __WORDSIZE_COMPAT64
struct
{
__int32_t __pad_1
__int32_t tv_sec; /* Seconds. */
__int32_t __pad_2
__int32_t tv_usec; /* Microseconds. */
} ut_tv; /* Time entry was made. */
# else
struct timeval ut_tv; /* Time entry was made. */
# endif
#endif