-
Notifications
You must be signed in to change notification settings - Fork 21
(Incorrect?) size of utmp records #140
Comments
The fundamental cause is that |
That implies this is probably a Debian aarch64 "thing" rather than a 64-bit Raspberry Pi OS "thing"? 🤷 (both Raspberry Pi OS and Ubuntu are built on top of Debian) On my 64-bit Ubuntu 18.04 laptop (on which I'm currently writing this reply),
ping @waveform80 in case he has any "Ubuntu 64-bit aarch64 for Raspberry Pi" knowledge he'd like to share 😉 |
Thanks for the response. It looks like a glibc aarch64 "thing", so further up the tree than Debian. I'll live with it and write separate code for aarch64. It's odd, though, that the comment about "must be the same size when compiled 32- and 64-bit" is still present in aarch64 glibc, although ignored in the code. |
When dealing with large, old codebases, it's not uncommon to find mismatches between comments/documentation and what the code is actually doing 😉 I'm sure the glibc maintainers would appreciate a patch (or even just a bug report). |
I've noticed that the latest 64-bit Raspberry Pi OS writes utmp records (to /var/run/utmp and /var/log/wtmp) of 400 bytes and I'm wondering whether this is intentional or a build error.
On almost all modern Linux systems, utmp records are 384 bytes in length. The extra 16 bytes are accounted for by the size of the ut_session, ut_tv.tv_sec and ut_tv.tv_usec fields. utmp.h says that these fields should each be 32 bits and they are 32 bits on almost all systems, regardless of whether the system is 32-bit or 64-bit. On Raspberry Pi OS 64-bit, these fields are all 64 bits.
utmp.h states that "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."
I've found one other system where utmp records are 400 bytes and that's Ubuntu 20.10 64-bit aarch64 for Raspberry Pi. But Ubuntu 20.10 64-bit x86_64 implements the normal 384-byte records.
So is the use of 64-bit fields in these three utmp fields a bug or a feature?
The text was updated successfully, but these errors were encountered: