missing parts to time64 switchover

Submitted by Rich Felker on Nov. 1, 2019, 2:56 p.m.

Details

Message ID 20191101145617.GN16318@brightrain.aerifal.cx
State New
Series "missing parts to time64 switchover"
Headers show

Commit Message

Rich Felker Nov. 1, 2019, 2:56 p.m.
The time64 switchover I had been testing and hoped to push yesterday
turned out to be missing the ioctl and sockopt bits, which I
eventually remembered I'd omitted in the late-summer i386-only draft
because making a bunch more archs have arch variants for these did not
seem fun. So, I've worked out some changes to allow top-level socket.h
to do a lot more. The msghdr move is pretty much orthogonal, aside
from interaction with x32.

It's probably not perfect at this point, but I think it's an
improvement, and short of errors good enough to commit. It brings
things closer to a state of only needing arch-specific bits for archs
that actually do weird things, rather than repeating things that are
universal to all 32-bit archs or all 64-bit archs on a per-arch basis.

These patches should apply ok on the last time64 switchover draft
posted to the list. But I'm posting them more for the sake of a (very
brief) comment period about what they're doing, and to have a record
of them as individual patches -- some of them will be squashed since
they yield ABI-inconsistent revisions if left split.

Rich
From d95f4ec080bafae7f154a475b90a7f0468aa3bf9 Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Thu, 31 Oct 2019 22:55:39 -0400
Subject: [PATCH 1/6] fix x32 msghdr struct by removing x32 bits/socket.h

being that it contains pointers and (from the kernel perspective,
which is wrong) size_t members, x32 uses the 32-bit version of the
structure, not a half-32-bit, half-64-bit layout like we had here. the
x86_64 definition was inadvertently copied when x32 was first added.

unlike errors in the opposite direction (missing padding), this error
was not easily detected breakage, because the layout of the commonly
used initial subset of members still matched. breakage could only be
observed in the presence of control messages or flags.
---
 arch/x32/bits/socket.h | 16 ----------------
 1 file changed, 16 deletions(-)
 delete mode 100644 arch/x32/bits/socket.h

Patch hide | download patch | download mbox

diff --git a/arch/x32/bits/socket.h b/arch/x32/bits/socket.h
deleted file mode 100644
index a4c89f3d..00000000
--- a/arch/x32/bits/socket.h
+++ /dev/null
@@ -1,16 +0,0 @@ 
-struct msghdr {
-	void *msg_name;
-	socklen_t msg_namelen;
-	struct iovec *msg_iov;
-	int msg_iovlen, __pad1;
-	void *msg_control;
-	socklen_t msg_controllen, __pad2;
-	int msg_flags;
-};
-
-struct cmsghdr {
-	socklen_t cmsg_len;
-	int __pad1;
-	int cmsg_level;
-	int cmsg_type;
-};