From c55dca8d85b4585f3e72eb72a9c1164568a68472 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 16 Oct 2002 01:03:05 +0000 Subject: * sysdeps/gnu/bits/utmp.h: Include . (struct lastlog) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: Use int32_t for ll_time. (struct utmp) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: Use int32_t instead of long int for ut_session. Use an anonymous struct with 32-bit fields for ut_tv. * sysdeps/gnu/bits/utmpx.h: Include . (struct utmpx) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: Do the same here as in utmp.h for `struct utmp'. * sysdeps/unix/sysv/linux/powerpc/bits/utmp.h: File removed. * sysdeps/unix/sysv/linux/powerpc/bits/utmpx.h: File removed. * sysdeps/unix/sysv/linux/sparc/bits/utmp.h: File removed. * sysdeps/unix/sysv/linux/sparc/bits/utmpx.h: File removed. * sysdeps/unix/sysv/linux/x86_64/bits/utmp.h: File removed. * sysdeps/unix/sysv/linux/x86_64/bits/utmpx.h: File removed. * sysdeps/unix/sysv/linux/bits/resource.h: Replaced with the contents of the sysdeps/unix/sysv/linux/i386/bits/resource.h file. All the following files were identical or equivalent to it. * sysdeps/unix/sysv/linux/i386/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/arm/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/cris/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/hppa/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/ia64/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/m68k/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/powerpc/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/s390/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/sh/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/x86_64/bits/resource.h: File removed. * sysdeps/unix/sysv/linux/bits/socket.h (struct msghdr): Use size_t instead of int for msg_iovlen, instead of socklen_t for msg_controllen. Other than the previously incorrect sign of msg_iovlen, this is a no-op on 32-bit platforms. On 64-bit platforms it makes this header match their layouts as well, so the following are now identical to it. * sysdeps/unix/sysv/linux/s390/bits/socket.h: File removed. * sysdeps/unix/sysv/linux/sparc/bits/socket.h: File removed. * sysdeps/unix/sysv/linux/x86_64/bits/socket.h: File removed. * sysdeps/unix/sysv/linux/ia64/bits/socket.h: File removed. * sysdeps/unix/sysv/linux/alpha/bits/socket.h: File removed. --- sysdeps/gnu/bits/utmp.h | 21 ++++++++++++++++++++- sysdeps/gnu/bits/utmpx.h | 16 +++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) (limited to 'sysdeps/gnu/bits') diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h index 2ed29bbb45..e855ad73f8 100644 --- a/sysdeps/gnu/bits/utmp.h +++ b/sysdeps/gnu/bits/utmp.h @@ -1,5 +1,6 @@ /* The `struct utmp' type, describing entries in the utmp file. GNU version. - Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,6 +25,7 @@ #include #include #include +#include #define UT_LINESIZE 32 @@ -35,7 +37,11 @@ previous logins. */ struct lastlog { +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + int32_t ll_time; +#else __time_t ll_time; +#endif char ll_line[UT_LINESIZE]; char ll_host[UT_HOSTSIZE]; }; @@ -61,8 +67,21 @@ struct utmp char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */ struct exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ +/* The ut_session and ut_tv fields must be the same size when compiled + 32- and 64-bit. This allows data files and shared memory to be + shared between 32- and 64-bit applications. */ +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + int32_t ut_session; /* Session ID, used for windowing. */ + struct + { + int32_t tv_sec; /* Seconds. */ + int32_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ +#endif + int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __unused[20]; /* Reserved for future use. */ }; diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h index 99735370b2..c84cda6fe9 100644 --- a/sysdeps/gnu/bits/utmpx.h +++ b/sysdeps/gnu/bits/utmpx.h @@ -1,5 +1,5 @@ /* Structures and definitions for the user accounting database. GNU version. - Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,6 +23,7 @@ #include #include +#include #ifdef __USE_GNU @@ -62,8 +63,21 @@ struct utmpx char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ struct __exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ + +/* The fields ut_session and ut_tv must be the same size when compiled + 32- and 64-bit. This allows files and shared memory to be shared + between 32- and 64-bit applications. */ +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + __int32_t ut_session; /* Session ID, used for windowing. */ + struct + { + __int32_t tv_sec; /* Seconds. */ + __int32_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ +#endif __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __unused[20]; /* Reserved for future use. */ }; -- cgit 1.4.1