netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ptp: In the testptp utility, use clock_adjtime from glibc when available
@ 2014-06-16 12:46 Christian Riesch
  2014-06-16 16:26 ` Richard Cochran
  2014-06-17  4:32 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Riesch @ 2014-06-16 12:46 UTC (permalink / raw)
  To: netdev; +Cc: Christian Riesch, Richard Cochran

clock_adjtime was included in glibc 2.14. _GNU_SOURCE must be defined
to make it available.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Richard Cochran <richardcochran@gmail.com>
---
 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 <errno.h>
 #include <fcntl.h>
 #include <inttypes.h>
@@ -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 <sys/syscall.h>
 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)
 {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ptp: In the testptp utility, use clock_adjtime from glibc when available
  2014-06-16 12:46 [PATCH] ptp: In the testptp utility, use clock_adjtime from glibc when available Christian Riesch
@ 2014-06-16 16:26 ` Richard Cochran
  2014-06-17  4:32 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Cochran @ 2014-06-16 16:26 UTC (permalink / raw)
  To: Christian Riesch; +Cc: netdev

On Mon, Jun 16, 2014 at 02:46:45PM +0200, Christian Riesch wrote:
> clock_adjtime was included in glibc 2.14. _GNU_SOURCE must be defined
> to make it available.

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ptp: In the testptp utility, use clock_adjtime from glibc when available
  2014-06-16 12:46 [PATCH] ptp: In the testptp utility, use clock_adjtime from glibc when available Christian Riesch
  2014-06-16 16:26 ` Richard Cochran
@ 2014-06-17  4:32 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-06-17  4:32 UTC (permalink / raw)
  To: christian.riesch; +Cc: netdev, richardcochran

From: Christian Riesch <christian.riesch@omicron.at>
Date: Mon, 16 Jun 2014 14:46:45 +0200

> clock_adjtime was included in glibc 2.14. _GNU_SOURCE must be defined
> to make it available.
> 
> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>

Applied, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-17  4:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-16 12:46 [PATCH] ptp: In the testptp utility, use clock_adjtime from glibc when available Christian Riesch
2014-06-16 16:26 ` Richard Cochran
2014-06-17  4:32 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).