From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61694 invoked by alias); 10 Sep 2019 17:20:13 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 61677 invoked by uid 9943); 10 Sep 2019 17:20:13 -0000 Date: Tue, 10 Sep 2019 17:20:00 -0000 Message-ID: <20190910172013.61676.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/y2038-preliminaries] Use clock_gettime to implement time. X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/y2038-preliminaries X-Git-Oldrev: 68700415e7c8fac44c730dc315f3832bf4f6c041 X-Git-Newrev: 95062ebe070a05a9afd2bfa76f13af47128dec15 X-SW-Source: 2019-q3/txt/msg00502.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=95062ebe070a05a9afd2bfa76f13af47128dec15 commit 95062ebe070a05a9afd2bfa76f13af47128dec15 Author: Adhemerval Zanella Date: Wed Sep 4 18:12:24 2019 +0000 Use clock_gettime to implement time. Consolidate generic time implementation to use clock_gettime. Linux ports that still use either time or gettime syscall or vDSO are not changed. * time/time.c (time): No longer a stub implementation. Call __clock_gettime. * sysdeps/unix/sysv/linux/powerpc/time.c: Use new generic implementation. * sysdeps/posix/time.c * sysdeps/unix/sysv/linux/sparc/sparc64/time.c * sysdeps/unix/sysv/linux/time.c: Remove file. Diff: --- sysdeps/posix/time.c | 40 --------------------------- sysdeps/unix/sysv/linux/powerpc/time.c | 2 +- sysdeps/unix/sysv/linux/sparc/sparc64/time.c | 1 - sysdeps/unix/sysv/linux/time.c | 41 ---------------------------- time/time.c | 12 ++++---- 5 files changed, 6 insertions(+), 90 deletions(-) diff --git a/sysdeps/posix/time.c b/sysdeps/posix/time.c deleted file mode 100644 index e1b3bc8..0000000 --- a/sysdeps/posix/time.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1991-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include /* For NULL. */ -#include -#include - - -/* Return the current time as a `time_t' and also put it in *T if T is - not NULL. Time is represented as seconds from Jan 1 00:00:00 1970. */ -time_t -time (time_t *t) -{ - struct timeval tv; - time_t result; - - if (__gettimeofday (&tv, (struct timezone *) NULL)) - result = (time_t) -1; - else - result = (time_t) tv.tv_sec; - - if (t != NULL) - *t = result; - return result; -} -libc_hidden_def (time) diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c index cb3e8b9..cfb1644 100644 --- a/sysdeps/unix/sysv/linux/powerpc/time.c +++ b/sysdeps/unix/sysv/linux/powerpc/time.c @@ -79,6 +79,6 @@ libc_hidden_def (time) #else -#include +#include