From patchwork Fri Sep 27 23:41:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 34707 Received: (qmail 87391 invoked by alias); 27 Sep 2019 23:46:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 87378 invoked by uid 89); 27 Sep 2019 23:46:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=Seconds, HContent-Transfer-Encoding:8bit X-HELO: esa2.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1569627977; x=1601163977; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YQNxDgsVjCmK8yiMosG25z2H/0JpSK31LCkF9jKAy2w=; b=rMALWhjkIiUc8LhJVCElNXypXOS8kpGoLNOpIx/JgMl0H8Z44I1pFVUn CGD3RHXPPYWGPmDjeAa8NC6jPdaPGhy+Xq6M/xCXi/9xmGrSG0xm42hWB 6Laoy/ojlecGdsqQHH/CFDW3d1pmwPUfQJM4FmGXi2G+QRe2r5/XW+Exa 3G8hFPXrgL4KsQlq9RORJq+CCRkZNOWvPnKwoZ4Pu9M2XQFsOFeASv2SR QZjNOBKTs7ZWnVPpTSoZ2pZV+vgvB9bcZiszJPMBYozQFmXfj4dcSpVzn J22UZk7PWkdvl8nyUWtCQDIdFRAGyDTJISmK8a5PdG8ohaQk3voQ5LSdn A==; IronPort-SDR: fsS4z3W6uTi6gSJrs+E5yrij1cEOSZPFVwwQhfVYUQKXmZqq6JNuIY8J8Dv5iFtolACzciRGPY HGFEkILJ13a2eTrsc5OHiX2dOrSxCpTm0r0Y9EFk/pOMk0Kmfr9rkjXtsCCCi29i3DhhtytvA3 gtEWNkfMXKM/pj8/XTz4dmzonxErMYegUnx6lGf5XlBKdK2EWDnGo5up2D/rhhapPSKrGvaDjO HLuHlnrHFMW4LkThCVj7laWjjyC7fiwHBmIe+tiC4W+/k1nssupRTNsENl0WlcVAEMTzjY263j gIM= IronPort-SDR: B+ByoAo2GRSFawpkHwL4HttZpl7j3thY21LiwR5MU5FV4ZEsAcGrdPUdSU6bIwl8ReHgIX9k4X VPZUcoV6zz7QATlS1dAeuS49mlLLxOp4Oh97H6fT0SfxD8AWbxmy8Q5D1Dai3iShvNlNv+nA8T mai1ScsiopkQTkAz3ifnu5HYBiSyrXNiM2KRVRHFAD5O9pZo6LZSPgW3eKnDtvzrIWBovRcbwe Jl5jzi3xd8yDbtbG/Fe5nz9QrHgp8yZ+BRuPL2OTfKgZQZS5SWzJ7jnghMyoMfyLf6OviKG2S+ k5ES0cGfWGOGzNm9HUqsfJNi IronPort-SDR: VGqzRl1L9PX8spdvTP9WSuhZfdvvp33UUpaMxAIz0STxbu5w7c42cHGGRftQnQ1sOek8a3MNhL dqYhlkl+jcy10Cb8CzHuucny2tdTEzZUSz58U5vppvZeEHyLmSzh+BEJd+tbtoSZVypzVA8NhY 9RMj2I50whkDRhfQYc4yCCoP72RlsmQTc1/rQ9oeGxjGEDCCLvKHBbt4Av52+1uhfwZNvQDA2/ HrmJmB4J5lFOpApUbAunvi1V4cJjC30C0kkDTG1yWJiSQzPKo+xV/OdOlH6q54qsvIrljW47TZ Tp4= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v2 2/2] time: Add padding for the timespec if required Date: Fri, 27 Sep 2019 16:41:33 -0700 Message-Id: <20190927234133.1046-2-alistair.francis@wdc.com> In-Reply-To: <20190927234133.1046-1-alistair.francis@wdc.com> References: <20190927234133.1046-1-alistair.francis@wdc.com> MIME-Version: 1.0 If we are running on a 32-bit system with a 64-bit time_t we need to ensure there is padding around the tv_nsec variable. This is requried as the timespec is #defined to the __timespec64 struct. 2019-09-20 Alistair Francis * time/bits/types/struct_timespec.h: Add padding for the timespec if required. --- v2: - Fix style issues time/bits/types/struct_timespec.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h index 5b77c52b4f0..d11c69cfd32 100644 --- a/time/bits/types/struct_timespec.h +++ b/time/bits/types/struct_timespec.h @@ -3,13 +3,26 @@ #define _STRUCT_TIMESPEC 1 #include +#include /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ +#if __WORDSIZE == 64 \ + || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ + || __TIMESIZE == 32 __syscall_slong_t tv_nsec; /* Nanoseconds. */ +#else +# if __BYTE_ORDER == __BIG_ENDIAN + int: 32; /* Padding. */ + long int tv_nsec; /* Nanoseconds. */ +# else + long int tv_nsec; /* Nanoseconds. */ + int: 32; /* Padding. */ +# endif +#endif }; #endif