aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/truss/setup.c
diff options
context:
space:
mode:
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 /usr.bin/truss/setup.c
parent19fe43f796f3d962b3bf023a4484a82d7b2a5711 (diff)
downloadsrc-6040822c4e20fb46638ecaaad543fc56f6ec2b0f.tar.gz
src-6040822c4e20fb46638ecaaad543fc56f6ec2b0f.zip
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
Notes: svn path=/head/; revision=336914
Diffstat (limited to 'usr.bin/truss/setup.c')
-rw-r--r--usr.bin/truss/setup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c
index 092188a4b60c..cc28dda61e86 100644
--- a/usr.bin/truss/setup.c
+++ b/usr.bin/truss/setup.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/ptrace.h>
#include <sys/sysctl.h>
+#include <sys/time.h>
#include <sys/wait.h>
#include <assert.h>
@@ -522,12 +523,12 @@ print_line_prefix(struct trussinfo *info)
len += fprintf(info->outfile, ": ");
}
if (info->flags & ABSOLUTETIMESTAMPS) {
- timespecsubt(&t->after, &info->start_time, &timediff);
+ timespecsub(&t->after, &info->start_time, &timediff);
len += fprintf(info->outfile, "%jd.%09ld ",
(intmax_t)timediff.tv_sec, timediff.tv_nsec);
}
if (info->flags & RELATIVETIMESTAMPS) {
- timespecsubt(&t->after, &t->before, &timediff);
+ timespecsub(&t->after, &t->before, &timediff);
len += fprintf(info->outfile, "%jd.%09ld ",
(intmax_t)timediff.tv_sec, timediff.tv_nsec);
}