From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91459 invoked by alias); 19 Jan 2020 11:37:00 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 91448 invoked by uid 89); 19 Jan 2020 11:36:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1358 X-HELO: mout.kundenserver.de MIME-Version: 1.0 References: <20200118072047.23071-1-lukma@denx.de> <20200118072047.23071-4-lukma@denx.de> In-Reply-To: From: Arnd Bergmann Date: Sun, 19 Jan 2020 15:22:00 -0000 Message-ID: Subject: Re: [PATCH 3/6] y2038: Introduce struct __timeval64 - new internal glibc type To: Alistair Francis Cc: Lukasz Majewski , Joseph Myers , Paul Eggert , Adhemerval Zanella , Samuel Thibault , Alistair Francis , GNU C Library , Siddhesh Poyarekar , Florian Weimer , Florian Weimer , Zack Weinberg , "Carlos O'Donell" , Andreas Schwab Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2020-01/txt/msg00423.txt.bz2 On Sat, Jan 18, 2020 at 11:48 PM Alistair Francis wrote: > > On Sat, Jan 18, 2020 at 5:21 PM Lukasz Majewski wrote: > > > > This type is a glibc's "internal" type similar to struct timeval but > > whose tv_sec field is a __time64_t rather than a time_t, which makes it > > Y2038-proof. This struct is NOT supposed to be passed to the kernel - > > instead it shall be converted to struct __timespec64 and clock_[sg]ettime > > syscalls shall be used (which are now Y2038 safe). > > > > Build tests: > > ./src/scripts/build-many-glibcs.py glibcs > > Looks good, I have the same thing in my tree :) I think it's slightly different: __suseconds_t on rv32 is 64 bit wide, while on all existing 32-bit architectures as well as sparc64 it is 32-bit wide. While almost all kernel interfaces based on timeval have been replaced by those based on timespec, there are a small number that need this to be compatible with the kernel's layout, or to have an explicit conversion: - Socket timestamps with SO_TIMESTAMP - Socket timeouts with SO_RCVTIMEO/SO_SNDTIMEO - pc-style parallel ports with the PPGETTIME/PPSETTIME ioctls - video4linux with the VIDIOC_QUERYBUF/VIDIOC_QBUF/VIDIOC_DQBUF VIDIOC_PREPARE_BUF and VIDIOC_OMAP3ISP_STAT_REQ ioctls Arnd