From patchwork Wed May 29 16:18:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 32900 Received: (qmail 8057 invoked by alias); 29 May 2019 16:19:19 -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 7951 invoked by uid 89); 29 May 2019 16:19:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy= X-HELO: mail-out.m-online.net From: Lukasz Majewski To: libc-alpha@sourceware.org Cc: Stepan Golosunov , Arnd Bergmann , Paul Eggert , Joseph Myers , Lukasz Majewski Subject: [PATCH v5 1/3] y2038: Introduce internal for glibc struct __timespec64 Date: Wed, 29 May 2019 18:18:48 +0200 Message-Id: <20190529161850.30442-2-lukma@denx.de> In-Reply-To: <20190529161850.30442-1-lukma@denx.de> References: <20190529161850.30442-1-lukma@denx.de> This type is a glibc's type similar to struct timespec but whose tv_sec field is a __time64_t rather than a time_t, which makes it Y2038-proof and usable to pass syscalls between user code and Y2038-proof kernel. To support passing this structure to the kernel - the tv_pad, 32 bit int, has been introduced. The placement of it depends on endianness of the SoC. Tested on x86_64 and ARM. * include/time.h: Add struct __timespec64 definition --- Changes for v5: - Reword commit message - Add missing preprocessor condition for x32 (to use timespec instead of __timespec64). Changes for v4: - Change tv_pad's type from named bitfield to 32 bit int Changes for v3: - Replace __TIMESIZE with __WORDSIZE (as architectures with __TIMESIZE==64 will need to use this struct with 32 bit tv_nsec field). - Update in-code comment Changes for v2: - None --- include/time.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/time.h b/include/time.h index ac3163c2a5..33d0fcb0fe 100644 --- a/include/time.h +++ b/include/time.h @@ -5,6 +5,7 @@ # include # include # include