path: root/sys/compat/linuxkpi
diff options
authorAlan Somers <asomers@FreeBSD.org>2018-07-30 15:46:40 +0000
committerAlan Somers <asomers@FreeBSD.org>2018-07-30 15:46:40 +0000
commit6040822c4e20fb46638ecaaad543fc56f6ec2b0f (patch)
tree133352663bf8c98c65abf581f6a4a8769325ca09 /sys/compat/linuxkpi
parent19fe43f796f3d962b3bf023a4484a82d7b2a5711 (diff)
Make timespecadd(3) and friends public
The timespecadd(3) family of macros were imported from NetBSD back in r35029. However, they were initially guarded by #ifdef _KERNEL. In the meantime, we have grown at least 28 syscalls that use timespecs in some way, leading many programs both inside and outside of the base system to redefine those macros. It's better just to make the definitions public. Our kernel currently defines two-argument versions of timespecadd and timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define three-argument versions. Solaris also defines a three-argument version, but only in its kernel. This revision changes our definition to match the common three-argument version. Bump _FreeBSD_version due to the breaking KPI change. Discussed with: cem, jilles, ian, bde Differential Revision: https://reviews.freebsd.org/D14725
Notes: svn path=/head/; revision=336914
Diffstat (limited to 'sys/compat/linuxkpi')
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/time.h b/sys/compat/linuxkpi/common/include/linux/time.h
index 9f69e95f6bf5..1c07c69a67a6 100644
--- a/sys/compat/linuxkpi/common/include/linux/time.h
+++ b/sys/compat/linuxkpi/common/include/linux/time.h
@@ -76,9 +76,7 @@ timespec_sub(struct timespec lhs, struct timespec rhs)
struct timespec ts;
- ts.tv_sec = lhs.tv_sec;
- ts.tv_nsec = lhs.tv_nsec;
- timespecsub(&ts, &rhs);
+ timespecsub(&lhs, &rhs, &ts);
return ts;