From patchwork Mon Jun 16 12:46:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Riesch X-Patchwork-Id: 360125 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CC17A140082 for ; Mon, 16 Jun 2014 22:48:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbaFPMs2 (ORCPT ); Mon, 16 Jun 2014 08:48:28 -0400 Received: from smtprelay03.ispgateway.de ([80.67.31.41]:39250 "EHLO smtprelay03.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbaFPMs1 (ORCPT ); Mon, 16 Jun 2014 08:48:27 -0400 Received: from [212.183.10.3] (helo=ChrRie22.omicron.at) by smtprelay03.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1WwWKm-0003Ux-0c; Mon, 16 Jun 2014 14:48:24 +0200 From: Christian Riesch To: netdev@vger.kernel.org Cc: Christian Riesch , Richard Cochran Subject: [PATCH] ptp: In the testptp utility, use clock_adjtime from glibc when available Date: Mon, 16 Jun 2014 14:46:45 +0200 Message-Id: <1402922805-3664-1-git-send-email-christian.riesch@omicron.at> X-Mailer: git-send-email 1.7.9.5 X-Df-Sender: Y2hyaXN0aWFuQHJpZXNjaC5hdA== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org clock_adjtime was included in glibc 2.14. _GNU_SOURCE must be defined to make it available. Signed-off-by: Christian Riesch Cc: Richard Cochran Acked-by: Richard Cochran --- Documentation/ptp/testptp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/ptp/testptp.c b/Documentation/ptp/testptp.c index f1ac2da..ba1d502 100644 --- a/Documentation/ptp/testptp.c +++ b/Documentation/ptp/testptp.c @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define _GNU_SOURCE #include #include #include @@ -46,12 +47,14 @@ #define CLOCK_INVALID -1 #endif -/* When glibc offers the syscall, this will go away. */ +/* clock_adjtime is not available in GLIBC < 2.14 */ +#if !__GLIBC_PREREQ(2, 14) #include static int clock_adjtime(clockid_t id, struct timex *tx) { return syscall(__NR_clock_adjtime, id, tx); } +#endif static clockid_t get_clockid(int fd) {