From patchwork Fri Feb 14 16:31:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 38075 Received: (qmail 68671 invoked by alias); 14 Feb 2020 16:39:35 -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 63361 invoked by uid 89); 14 Feb 2020 16:38:37 -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: esa4.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=1581698314; x=1613234314; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Cm3hfp0NEJZUQUjmthiEeB6k8+Wo1wH3NwiFDvC3OV4=; b=jFtPWggdiNpPST4NEGnBc4fB+ylto7ZHmav9IWXZD8Yn2cHBc1yAsoeI ezy5Yx57KGnadZ2ZVW4bPVv/05zyRTdNbxuuvpCRQtn/KUcs2VQxX6M1U PfJmF+jGLgw+rYeVF6BcUz1+DXH7TcYKsCyhcyIzC+1mD0U3DHwsyxjBA sxUh3flEV8fdBCiPsDGjr7tZkwA+IsQZgOYzUEhLe1iqUcMpxNQf1BBRt AOiFho7NFvQT9edo43c1EuoqRTIkTSZpD6M9TFQlMKaklotkPidTYgoU5 Aru0PwtH3SpIAvVIP9RjeduF1vI8gfWBjMgTaou+UJHHfCxU255ed3orr g==; IronPort-SDR: yNDBWMFPiR1NIc8Xr7ZkGhyC/XBkkNI043Q0miq1bx45mpb+mIbq+Luy2c+Fp2Jq4i3urfdpw2 GX8H3znOArqOYPZRV8ezf4zTqHRE20SoHE8Lls2/kc1pl6PRF+X11fxwc1ddI5no/iY7sx1OYG +2YJIYzRsc6di+S6a+hWG/cq9sbZjs5BGXCj7VCkYHWcCT9s15cxX7J6rem+Snlpxk/Nk030+a XR6UN/QDWucoxofzLyZqRfKeJL4EMTPowV912PgMvjgx4NADsfdrdsYVbniXW2l1VsRaWQVXJW XU0= IronPort-SDR: ugLIQrJKrdX53w2sDTIWQOmbEryqtdgOnzAwxDhbUAGfEqVUL9qwJB1ZF+Bs2IaThwAuXATVOC 4z9uAMI7PQz+AJf82zlSB0gZWFvWX8abmH6rFvsP7VghzAIR78vJ4IUjhTZPHIx278RUSIQJNu CxmxWkF8PDCieG9a142wLzhqjcYNFiSZ3Bdfp6xpddAqJvwnBIDI9UVokKeGTZvXZZ5S6ogwC5 DYM4pZVpCZuDzKmqaNR68H6/bRHY3woVzQsdErGlJHYU3mRGNZM01CWWqpHNQ2JIQhriVNQXr7 IAoSiuRkuQbK04XJ0Efx/Sa3 IronPort-SDR: shg3ZWf2GT3bACFaLQbh8muAxupW+lUTRorrQPAdRZs/rdUQFvj1038ij55y+6LON84q39KmOE tWX8NBlSsK9Q3ykAwjdPFc28jwcQ2w90OUvwc6RnmP/kJuQS9iJET+rVMjGU0uG7uCKRcGGgoj 1Rs2l6UCH1kkzWvpKWn3Mjqxpff8OiIS3J0P8uHL/sQJcPwz0qvCQCXFBU9X+t+1f7gATeoSCN svkjt5mplfQdOcuGJizAu8/utBDRSgcmIHNLKSWWP6aQ81xqMMPygT+dFjZvhYbIL8oVx6BjCY 5RQ= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 5/8] linux: Use long time_t __getitimer/__setitimer Date: Fri, 14 Feb 2020 08:31:31 -0800 Message-Id: <20200214163134.31601-6-alistair.francis@wdc.com> In-Reply-To: <20200214163134.31601-1-alistair.francis@wdc.com> References: <20200214163134.31601-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/sysv/linux/getitimer.c | 61 +++++++++++++++++ sysdeps/unix/sysv/linux/setitimer.c | 95 +++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/tv32-compat.h | 35 ++++++++++ 4 files changed, 206 insertions(+) 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 34dffaf95f..cdaf461c3f 100644 --- a/include/time.h +++ b/include/time.h @@ -6,6 +6,7 @@ # include # include # include