From patchwork Wed Feb 19 18:10:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 38242 Received: (qmail 5728 invoked by alias); 19 Feb 2020 18:18:11 -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 5585 invoked by uid 89); 19 Feb 2020 18:18:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy= 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=1582136311; x=1613672311; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mViIGMSof8HIJpKOU6OmvbOlXjzjFAbZzX3eETfwrgI=; b=m7mxSdgWbRrnzcsEVcGBRFDrARqSaz+47pkF5Vv/oNYKgtHgDyfip5Im T1A8syiwIbcj2IYCpnEc6SIMtZnyc0LXEKLPCihpDzlbyuTr6Z0OY2B6P K3uTuakCb/j7UB3NplKjR4Xcx3o2gaX84LU+JzWERWUyt+o/CaiZ2RTia jMHHzWyNzV2vaZJb5/8OHKSkAoD/R5Dqgt97ZUj2Dvm939i6cozzpnt8U wjLKkEH5tXm0sDkZu9W/QmWqzzaa6jx25KY3EymqHj7PtwljErAi6znlG EDT0eyqN9l8jIyXOYeg4MgOqE40+l3qLbqKnWrVQKlULyxzpFBn+pURhf g==; IronPort-SDR: Je2yaS8uIAK75kj+0g5VR16gmtTakK425i8ol7r2qaO1kADBYNuHe4LTr5bjP8FvvzytqRkxjO hINyKS/JXm35SJHg5+wjQa4++hI6qb5ENZlzX5r/2nfmX+zyKz0Q6FD0wvc+1RrXppUare6bCB sJP1DTOjFJWKibNun/ANYDOruFgSdG/0ODniXNv3UsulSN4p0hZk7QZTcT5WjrwEOuw3WUgoPW kfqANleHEISyvCdX0NzrbJyaAx/D62b9ds0b36to2UzY2c6X1yZDa6knlu9nKc55wMhtHQS3z3 zX4= X-URL-LookUp-ScanningError: 1 IronPort-SDR: fut9flY2nSYWwMK9fN7eKGCHtvHA5XjNvu6VbcAZlRasOI5k/ChKXJfbqbSqUffpM3mtFaM+F/ kylQH3umqPHUIvWhgyRpOIiWdy4QXm943VZE7J3OlUNCbzXILg72ox4nQwuvqGN94nXutClzfJ ry2jGdZGIZnfBTiowu/AgzkBJCD4gcatVDm+FlXpskzeCTZPtt2WyrEEAFrnOWEeMIE+Ow6hLL lvKKnNZUDOlFvRGaAtFYYzuHf7zhZBNFB+2uRi+HxBXlP7uOlry6Dykjc/KzWXG2N9g/MEqeg0 bp74fTNbZjV4gjX1h9preNJ6 IronPort-SDR: A8prfpJ/ed3ykF1N4sr44t/+q6lDg92jklNcT8Oij8BLa9ZHG8+Rd4V8wFmS6QxdtroyM5Pwf2 TmldnguO06v42kGq+YqpBfZeUl+6qdqlykH8gNhZoRLOTfkdpOdKmh5PT3VISpS14V6vwBdZp+ YnyKPgmMFkVBC5wjD4gpczW5J2rMN3uKeyDKlC/PrB9IJbdKdr6wLfwGp4NrEeJPJ4/0EYm+Xt DWsU4m8J67T8ecBX0Rqb2jh7sXNNs6NLtLoX3vRypKfwHeRaNQ1sGsQCbnaZkUOJJbPVS779PY MNI= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v4 5/8] linux: Use long time_t __getitimer/__setitimer Date: Wed, 19 Feb 2020 10:10:54 -0800 Message-Id: <20200219181057.10297-6-alistair.francis@wdc.com> In-Reply-To: <20200219181057.10297-1-alistair.francis@wdc.com> References: <20200219181057.10297-1-alistair.francis@wdc.com> MIME-Version: 1.0 The Linux kernel expects itimerval to use a 32-bit time_t, even on archs with a 64-bit time_t (like RV32). To address this let's convert itimerval to/from 32-bit and 64-bit to ensure the kernel always gets a 32-bit time_t. While we are converting these functions let's also convert them to be the y2038 safe versions. This means there is a *64 function that is called by a backwards compatible wrapper. Tested-by: Lukasz Majewski --- include/time.h | 15 +++++ sysdeps/unix/syscalls.list | 2 - sysdeps/unix/sysv/linux/getitimer.c | 59 +++++++++++++++++ sysdeps/unix/sysv/linux/setitimer.c | 95 +++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/tv32-compat.h | 31 +++++++++ 5 files changed, 200 insertions(+), 2 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/getitimer.c create mode 100644 sysdeps/unix/sysv/linux/setitimer.c create mode 100644 sysdeps/unix/sysv/linux/tv32-compat.h diff --git a/include/time.h b/include/time.h index 8a4abb159f..eaa536d5c0 100644 --- a/include/time.h +++ b/include/time.h @@ -6,6 +6,7 @@ # include # include # include