diff options
author | Christian Riesch <christian.riesch@omicron.at> | 2014-06-16 14:46:45 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-16 21:32:31 -0700 |
commit | 42e1358e103de0fe07d3e8ff40c16bb1fa844e26 (patch) | |
tree | 7f042f2a555185625f51f013fe0e1d3adbad60bf | |
parent | ddc6fbd83a22d35726e262a6c698376f3ca1654e (diff) | |
download | op-kernel-dev-42e1358e103de0fe07d3e8ff40c16bb1fa844e26.zip op-kernel-dev-42e1358e103de0fe07d3e8ff40c16bb1fa844e26.tar.gz |
ptp: In the testptp utility, use clock_adjtime from glibc when available
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>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/ptp/testptp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/ptp/testptp.c b/Documentation/ptp/testptp.c index f1ac2dae..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) { |