From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6089 invoked from network); 3 Sep 2020 19:36:37 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 3 Sep 2020 19:36:37 -0000 Received: (qmail 11606 invoked by uid 550); 3 Sep 2020 19:36:34 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 11585 invoked from network); 3 Sep 2020 19:36:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=WLj8k6Bdax0gR1t789uH11/XI++QMKs Igd6VPpY3Jnw=; b=oGnNSVqd6kNidbIG6sy/iezvAKr8Y827UbrWnfkd5Y8fVhv EfaG1KCUXc6ELebMP3Q1yEaFaa3bFH0YyFZxQEszqOfq3tirhUQfmnXqr2g+ce0a ZqagiWtZzdYTIlb/DtO8RwIge/06JOja9g1OX4VgcPKLXqaIUNOQfmrSH14NxrQs tvQBBwMY/x5NR88YZWgCJaxICZfwQcYkIbhhF/0+lDuhY6fEqFwiEVqtrs9oThDn Mrh8ElTt69NpCDFUClfaGd4hOXbbyn/rjFgETnM4GVShR48oKrwRKxt8uakm7l7E AyWZ9CiAJCe24kgcem53wNEgoKOih5erd4jRCyg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=WLj8k6 Bdax0gR1t789uH11/XI++QMKsIgd6VPpY3Jnw=; b=hqqDerzmHhkdVVrgKhx1lX 3AR3Ic1N56/SkTDqYjMe2iLEHczaLuBSSuQhpFJLCaiblYnMqru5o1TkZFNWRskx NXEM4E2yQ8Sm7TLI/WHHW0FallbHo/wxGx4CQbDhe0iN7IxdTFrdljxDG9+YwC1C rPdWzWzRecwYmQ0P1HPEcKLckpY1DtNEYSS+VGebq/KlZ9wVht2RBuVSbz24ceDE bhM/fHDLa4hI7VBgqGS8irHe+bK6E1C9NbGbYn+kY9hU6AqGmoI7JFUB1bpOOf6t Ke6pj5iF63jOcB96Se5T1qZR/7VoKdHZwivi5q0zhaI63S2DMqvqxOsZ3xXX/kWw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeguddgudegudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesth dtredtreerjeenucfhrhhomhepfdfuthgvfhgrnhcuqfdktfgvrghrfdcuoehsohhrvggr rhesfhgrshhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpefhgeekteduieethf ejgeeifeegkedtudeigfffffdvudefveekheefhfdtgeeiudenucffohhmrghinhepmhhu shhlqdhlihgstgdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehsohhrvggrrhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-259-g88fbbfa-fm-20200903.003-g88fbbfa3 Mime-Version: 1.0 Message-Id: <05292d85-1bcf-4967-8c48-276d5d82e91b@www.fastmail.com> In-Reply-To: <20200903155615.GC3265@brightrain.aerifal.cx> References: <20200903112309.102601-1-sorear@fastmail.com> <20200903112309.102601-3-sorear@fastmail.com> <20200903155615.GC3265@brightrain.aerifal.cx> Date: Thu, 03 Sep 2020 15:36:00 -0400 From: "Stefan O'Rear" To: musl@lists.openwall.com Content-Type: text/plain Subject: =?UTF-8?Q?Re:_[musl]_[PATCH_02/14]_time64:_Don't_make_aliases_to_nonexis?= =?UTF-8?Q?tent_syscalls?= On Thu, Sep 3, 2020, at 11:56 AM, Rich Felker wrote: > On Thu, Sep 03, 2020 at 07:22:57AM -0400, Stefan O'Rear wrote: > > riscv32 and future architectures lack the _time32 variants entirely, so > > don't try to use their numbers. > > --- > > src/internal/syscall.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/src/internal/syscall.h b/src/internal/syscall.h > > index d5f294d4..66fc4e5c 100644 > > --- a/src/internal/syscall.h > > +++ b/src/internal/syscall.h > > @@ -201,6 +201,7 @@ static inline long __alt_socketcall(int sys, int sock, int cp, long a, long b, l > > #define SYS_sendfile SYS_sendfile64 > > #endif > > > > +#ifdef SYS_timer_settime32 > > #ifndef SYS_timer_settime > > #define SYS_timer_settime SYS_timer_settime32 > > #endif > > @@ -240,6 +241,7 @@ static inline long __alt_socketcall(int sys, int sock, int cp, long a, long b, l > > #ifndef SYS_settimeofday > > #define SYS_settimeofday SYS_settimeofday_time32 > > #endif > > +#endif > > The existing expectation internally in musl is that archs that lack > legacy time32 syscalls have both the unadorned and _time64 macros > defined to the same value. The public headers don't have to be like > that but the internal ones do. See arch/x32/syscall_arch.h which does > it but in the opposite direction. This logic is all tested for x32 and > a big part of the point of that was preparing for rv32 and future > 32-bit archs. > > I'm actually missing how this patch worked as-written, since for > example timer_settime.c unconditionally assumes SYS_timer_settime is > defined, and if it's defined to anything other than the same value as > the time64 version, it will use the value as a fallback. src/internal/syscall.h has two groups of conditional definitions of unadorned syscall numbers, the first of which sets undefined syscalls to the _time32 version, the second of which sets to the _time64 version. So for instance I see no way for the #define SYS_clock_gettime SYS_clock_gettime64 (https://git.musl-libc.org/cgit/musl/tree/src/internal/syscall.h#n250) to execute. -s