Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3454069imb; Tue, 5 Mar 2019 09:41:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxrg6623FADF+o2pMSG/neGPNlm03s2QfMpRFVySN/kwMHj67aC1OG5K52Oql+Ry42eqJOs X-Received: by 2002:a17:902:bcc7:: with SMTP id o7mr2427091pls.89.1551807669491; Tue, 05 Mar 2019 09:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551807669; cv=none; d=google.com; s=arc-20160816; b=WfNK4ye5nGfz14bQ7B6wDLvE8h8jjqsBbfSSZOnKmqTZOmkGAma5pZs47/+7Z8+UBl y7ZDiH6GZa8qpIG9L3zxK0kpq6GXa45bzfPL3iLnoytXK0azswPn7rjS2fzxJAmQmC5P hCx69HG7haW72Ul6xps5LIYRhrTkLaeeNDAIWJfKS0A1T6aa/to10kE2DVPJrQmIcrUM w9XpOTzLj9R+3RcVLDXE5nTmXe1aryspQJG5/V4ZRHhjmMC58ENV7qpJANzBsbDMetUN YCy8DygJrgsb8fgVHXAdTiYcowfnVV23fm6TC3iO7DYPAdg0u7jxBxRrjDk8uv1igG1o k18A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id; bh=kbp501SLTYMZNP8E3gEjojvKA/a0V5ga+uUg06GtYeA=; b=h7kCXRJ+BmDloOwD15mRku3oiZDUfY36VLS3n6Bug+whN3g0XrtqyA4gRmLkFoN1Iz AE8kbUlo3qDzhlyrtFSgCSbL9B2ETr6ir0cWCC0R224dYC/uEdmyu+CwndVM7ECih8qV fyf1ofOh0MXDMfu/gcFINJog+IgEsq3hp85VxcYqHls4Spvoop90cKC26SXgYOlZ7ckC 0hGrVBKBdbYpa2I3itDRgRO/9nFjysdp6H15/pRy9au3Gf4vDDK9EcIyEmTdBccC9S3j AfMoREZm/CndckF9XhXrEWW4pUI2aKlqHcK4yTQktOYwGyzfL8d4QnQn1D3LNEe9yXkU Li3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si8257181pgm.541.2019.03.05.09.40.53; Tue, 05 Mar 2019 09:41:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727213AbfCEQ4f (ORCPT + 99 others); Tue, 5 Mar 2019 11:56:35 -0500 Received: from imap1.codethink.co.uk ([176.9.8.82]:50114 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727188AbfCEQ4f (ORCPT ); Tue, 5 Mar 2019 11:56:35 -0500 Received: from [167.98.27.226] (helo=xylophone) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1h1DMk-00057N-Fp; Tue, 05 Mar 2019 16:56:30 +0000 Message-ID: <1551804989.2925.283.camel@codethink.co.uk> Subject: Re: [Y2038] Question regarding support of old time interfaces beyond y2038 From: Ben Hutchings To: Zack Weinberg , Lukasz Majewski Cc: Arnd Bergmann , Linux Kernel Mailing List , Joseph Myers , GNU C Library Date: Tue, 05 Mar 2019 16:56:29 +0000 In-Reply-To: References: <20190305162351.5aadde66@jawa> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-03-05 at 11:05 -0500, Zack Weinberg wrote: > > On Tue, Mar 5, 2019 at 10:24 AM Lukasz Majewski wrote: > > From other discussion [4] - regarding the following system calls: > >  time, stime, gettimeofday, settimeofday, adjtimex, nanosleep, alarm, > >  getitimer, setitimer, select, utime, utimes, futimesat, and > >  {old,new}{l,f,}stat{,64}. > > > > "These all pass 32-bit time_t arguments on 32-bit > >  architectures and are replaced by other interfaces (e.g. posix > >  timers and clocks, statx). C libraries implementing 64-bit time_t in > >  32-bit architectures have to implement the handles by wrapping > >  around the newer interfaces." > > 1) We should be clear that most of these will continue to be supported > as C library interfaces even if they are not system calls.  Some of > them are obsolete enough and/or rarely used enough that we might not > bother (the older ways to set the system clock, for instance). > > 2) I know of one case where the new interfaces don't cover all of the > functionality of the old ones: timers started by setitimer continue to > run after an execve, timers started by timer_create don't.  This means > setitimer(ITIMER_VIRTUAL) can be used to impose a CPU time limit on a > program you didn't write, and timer_create can't.  If new kernels are > not going to have setitimer as a primitive, we need some other way of > getting the same effect. {get,set}itimer() are still implemented on all architectures, and I don't see any sign that that's going to change. There aren't 64-bit versions on 32-bit architectures though. This is explained in the message for commit 48166e6ea47d23984f0b481ca199250e1ce0730a: "...these can all be safely implemented in the C library by wrapping around the existing system calls because the 32-bit time_t they pass only counts elapsed time, not time since the epoch." Ben. -- Ben Hutchings, Software Developer   Codethink Ltd https://www.codethink.co.uk/ Dale House, 35 Dale Street Manchester, M1 2HF, United Kingdom