From patchwork Mon Oct 19 19:13:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 40756 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E45E8388EC28; Mon, 19 Oct 2020 19:13:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E45E8388EC28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603134794; bh=jPGVIuUiW2qUx8xFmfsIZLmjld81RtkEPpRjGafnCXg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=d+FumcF+QUV9GjBH6QnPLrmW6ncrqmstzS+jP5FAIYCn39o+pDXEVAAtp4MbAYFBY Vwm83v0P49VgSbgVmOpr0yjEAnt+5OCPx3d2CVyJxRFzYS34PQLgDOlNGQFn0a4sZm Pk28rqTzs4BuQregWTc6GoW9tqPvHh0HkqKDVH/o= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 8DCB1388EC16 for ; Mon, 19 Oct 2020 19:13:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8DCB1388EC16 Received: by mail-qt1-x843.google.com with SMTP id h12so635610qtu.1 for ; Mon, 19 Oct 2020 12:13:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jPGVIuUiW2qUx8xFmfsIZLmjld81RtkEPpRjGafnCXg=; b=EPyL3iZjZkz5+Zrk2E62jPbUgMFMwmEmmkfkdLenjpr36Qg/XJJ0TiyIBfy6IYOrEm 9gbkdc0vXcoAacuUbl1XhPkMmKEUe/ifDaLU/+a6VdBWfVHrmt2wpFnt2N11qDBdBaUM fDqN/2Jb50gi6Y90aG9xh+KKzf4eMn+WMARzfZAFNvvz9x0fwp6nIm5owRiccvBr86UC UY3pD+M0oewPt0GPTTYtSQvUHs3QktmHZIOgqj+6V/oA5tzyi1xuAsynLhIgR+LMaxNe i1xxSlFF4v6DmqUFlNpEzksBUhALE/HmhyJprNlA8dl2DD5qf2Gd7AM2qqELKPF7msTh vX3Q== X-Gm-Message-State: AOAM533RePbBKqPyRwcPXqZKvU+rCA3L+4ZgxFzuOFSycfvBsRFIWv3u wvHGSNciy3EQYaKD+PoPF87qE9/NAAszqg== X-Google-Smtp-Source: ABdhPJwmsnSE50tPNIqrcYQsnUJZ3+Qr3Qy0von+KF8ipEwOjhJuwmwi/O0k5N0t/3RvoWg7uq8CdQ== X-Received: by 2002:ac8:4c8f:: with SMTP id j15mr951630qtv.208.1603134789774; Mon, 19 Oct 2020 12:13:09 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id a20sm343404qtk.67.2020.10.19.12.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 12:13:09 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 1/2] Reinstate ftime and move define it for POSIX.1-2001 or older Date: Mon, 19 Oct 2020 16:13:03 -0300 Message-Id: <20201019191304.3471080-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This patch revert "Move ftime to a compatibility symbol" (commit 14633d3e568eb9770a7e5046eff257113e0453fb). The 'ftime' is handled similar to 'gets', where it is only exported if the program is built for POSIX.1-2001 or order (_POSIX_C_SOURCE=200112L). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Szabolcs Nagy --- NEWS | 6 +-- include/features.h | 10 ++++ include/sys/timeb.h | 1 + .../unix/sysv/linux/riscv/rv32/libc.abilist | 1 + time/Makefile | 5 +- time/ftime.c | 22 ++------- time/sys/timeb.h | 48 +++++++++++++++++++ time/tst-ftime.c | 40 ++++++---------- 8 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 include/sys/timeb.h create mode 100644 time/sys/timeb.h diff --git a/NEWS b/NEWS index 6eb577a669..6105eb0b3e 100644 --- a/NEWS +++ b/NEWS @@ -37,10 +37,8 @@ Deprecated and removed features, and other changes affecting compatibility: implementations from HWCAP subdirectories are no longer loaded. Instead, the default implementation is used. -* The deprecated header and the ftime function have been - removed. To support old binaries, the ftime function continue to exist - as a compatibility symbol (on those architectures which had it). All - programs should use gettimeofday or clock_gettime instead. +* The deprecated ftime function is now only declared for POSIX.1-2001 or + older standard. Changes to build and runtime requirements: diff --git a/include/features.h b/include/features.h index f3e62d3362..aec149ed10 100644 --- a/include/features.h +++ b/include/features.h @@ -143,6 +143,7 @@ #undef __GLIBC_USE_ISOC2X #undef __GLIBC_USE_DEPRECATED_GETS #undef __GLIBC_USE_DEPRECATED_SCANF +#undef __GLIBC_USE_DEPRECATED_FTIME /* Suppress kernel-name space pollution unless user expressedly asks for it. */ @@ -438,6 +439,15 @@ # define __GLIBC_USE_DEPRECATED_SCANF 0 #endif +/* The function 'ftime' appeared in Version 7 AT&T UNIX, it was marked + as LEGACY on IEEE 1003.1-2004, and removed on IEEE 1003.1-2008. */ +#if (defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) <= 200112L) \ + || defined _XOPEN_SOURCE_EXTENDED +# define __GLIBC_USE_DEPRECATED_FTIME 1 +#else +# define __GLIBC_USE_DEPRECATED_FTIME 0 +#endif + /* Get definitions of __STDC_* predefined macros, if the compiler has not preincluded this header automatically. */ #include diff --git a/include/sys/timeb.h b/include/sys/timeb.h new file mode 100644 index 0000000000..9f4509c35e --- /dev/null +++ b/include/sys/timeb.h @@ -0,0 +1 @@ +#include