From patchwork Sat Aug 10 01:00:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 34034 Received: (qmail 73325 invoked by alias); 10 Aug 2019 01:03:27 -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 73253 invoked by uid 89); 10 Aug 2019 01:03:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=west X-HELO: esa6.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=1565399006; x=1596935006; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JNK0qZggMinBKdggWahCyMtwVL0CVl3QfnGN5hMUHBk=; b=BEIxE2pXIT0r2AV+OgIoBF+phkD44Ch0b3J4M3mqf5ofbIfAtc06T5kL 2Y2DfLXAtpKBcIZIxjR2cJYaJ+3QmuA5UMxt5+WfLo79Oi3bTUGM7Qzjf 7Kta6cicbR9jgeePdt393p0aFiuYTDZC3XZZYJdpR/NbdOXQuIwKSLEwo axYz8yZ91ze2TYqz/ImVnu6+TNDwXsC3X2lV9koZbi+nP7+OgOhEiSQ3y Emyr9mlMZbOdyVeMflgqUCfMf/u53e2bzKawTcr/5X65Q6ORKVEbKIxI6 w7524FJtSlDFms/p4TsSqfjkow93seDZdjXpkiEkcFG/BMREVdAMEBF36 g==; IronPort-SDR: Ytb/kL0AWlmatp1laClgbccDe/cONWq3NNzvsJm6P5p4PcvzvXWHszeGq9grrq3WvDOvWqpEcc L+oJ862Yvos7TDYcnug/qJjDr8BXekBPrTFX7DjiMlt2cWUdokRvC7vAO0XJPqW9+k6xQ4kV8Y BpDAXWa/OvV3cS9Fk33OgP6AVKQiXQVU1Lla+jWlowxjIjH6iEp+5OaIHbRNkg+168/BCOIPoJ s7Yw0ukdRzim3rO0qZtMX09tp0i1G2soHMWgUBl1pA1PfdiDE7DiCjHpcW1HayxI8kqb86rCcw 3kM= IronPort-SDR: Xu9UPjVBORHdXeCFr1uwA2elZn4ML+oU/AkGURy8+aE8m/oaccZo1Gvl6d1Z3d73O1ojHOmQta 9Nyp6UAexzedP8Km8ReMiPWG+upbQalQu6Sd5XNSITqHuVmQkWM5d6+a8DuNvxu58Y8auY+LN7 5A0PWnvEwo11g3OOLRc2GtEjYlNggK5OQzBDC2BgByu12UOIadm2XKBxT5Vo4eMDSDQwBJhOBS uo9Nwv8IeLHI+nlMQJOY1DTLzpYaJwreOZK6Zv3OAdwuSUBf8FDYybAhMUgRPmjWuJ3nyVkrRy nhdNLdPqORg/xrWuq+02YOGj IronPort-SDR: 0oHWlj9wulQym83j1idjtWMA+aP2f82olefc63jsyYXtgm4N4zHZF3m6F6K2blTGS8wsQifTlV 3md48xBm6RgWW2uVKAISXdjmTN91bzdI7JDw4hdMJY7so9h9beapHL8N6mhIwKQWqfntNUhgG7 uSxPrhMr/Si5ySkUPn7E5WeT6eTgU4k6AZz7eTH0+o9sTBn9aG8OD02AUnw7Aub2J5Z6v8igXk YF9WyG4yMJn5Jz62hZgw3ukD8NqFZQk5txsLU1O8Lrpy2+OAHsWx3sijsFh1PXdFO9V5fODwxa 8Tw= From: Alistair Francis To: libc-alpha@sourceware.org Cc: arnd@arndb.de, adhemerval.zanella@linaro.org, fweimer@redhat.com, palmer@sifive.com, macro@wdc.com, zongbox@gmail.com, alistair.francis@wdc.com, alistair23@gmail.com Subject: [RFC v4 07/24] time: Deprecate struct timezone members Date: Fri, 9 Aug 2019 18:00:05 -0700 Message-Id: <53894e78c91ed5e037077f7249b85cefe635ae1f.1565398513.git.alistair.francis@wdc.com> In-Reply-To: References: MIME-Version: 1.0 Append the struct timezone members with '_dep'. This indicates that these members are deprecated and will cause build failures on code that is currently using the members. The struct timezone *tz variable contaions information on the current timezone, in this structure: struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of DST correction */ }; The members are being renamed to create compilation failures for anyone who is using them. This is being done for the following reasons. On 32-bit systems with __ARCH_WANT_TIME32_SYSCALLS not defined there is no way way to get the struct timezone via a syscall. AFAIK there are no plans to add suppor to a future kernel. The Linux documentation says that "The use of the timezone structure is obsolete; the tz argument should normally be specified as NULL." Most callers of gettimeofday() don't use the timezone data, see example code from Debian below. If __ASSUME_TIME64_SYSCALLS and __NR_clock_gettime64 are not defined then struct timezone *tz will be set as usual. Example code from Debian: struct timeval my_gettime(void) { struct timezone tz_ignored; struct timeval tv; gettimeofday(&tv, &tz_ignored); return tv; } Signed-off-by: Alistair Francis --- sysdeps/unix/bsd/ftime.c | 4 ++-- time/sys/time.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/bsd/ftime.c b/sysdeps/unix/bsd/ftime.c index 3a1c6e9b01c..bc4dfdab945 100644 --- a/sysdeps/unix/bsd/ftime.c +++ b/sysdeps/unix/bsd/ftime.c @@ -34,7 +34,7 @@ ftime (struct timeb *timebuf) ++timebuf->time; timebuf->millitm = 0; } - timebuf->timezone = tz.tz_minuteswest; - timebuf->dstflag = tz.tz_dsttime; + timebuf->timezone = tz.tz_minuteswest_dep; + timebuf->dstflag = tz.tz_dsttime_dep; return 0; } diff --git a/time/sys/time.h b/time/sys/time.h index 5dbc7fc627f..a35ccb7a58b 100644 --- a/time/sys/time.h +++ b/time/sys/time.h @@ -51,8 +51,8 @@ __BEGIN_DECLS This is obsolete and should never be used. */ struct timezone { - int tz_minuteswest; /* Minutes west of GMT. */ - int tz_dsttime; /* Nonzero if DST is ever in effect. */ + int tz_minuteswest_dep; /* Minutes west of GMT. */ + int tz_dsttime_dep; /* Nonzero if DST is ever in effect. */ }; typedef struct timezone *__restrict __timezone_ptr_t;