ktrace -C will return an error if you don't have a ktrace.out file because
sys_ktrace tries to open it whenever it has a filename, even if it won't be
used. I think it is more consistent to require it be null, so that we aren't
opening files we won't be using.
man page and utility diff below.
RCS file: /cvs/src/usr.bin/ktrace/ktrace.c,v
retrieving revision 1.34
diff -u -p -r1.34 ktrace.c
--- usr.bin/ktrace/ktrace.c 11 Jun 2017 17:32:19 -0000 1.34
+++ usr.bin/ktrace/ktrace.c 6 Dec 2018 20:23:52 -0000
@@ -110,6 +110,7 @@ main(int argc, char *argv)
clear = CLEARALL;
+ tracefile = NULL;
pidset = 1;
RCS file: /cvs/src/lib/libc/sys/ktrace.2,v
retrieving revision 1.36
diff -u -p -r1.36 ktrace.2
--- lib/libc/sys/ktrace.2 19 Jun 2018 15:39:01 -0000 1.36
+++ lib/libc/sys/ktrace.2 6 Dec 2018 20:30:07 -0000
@@ -61,11 +61,8 @@ If tracing points are being disabled (se
-may be -1.
+.Dv NULL .
Trace records are always appended to the file, ignoring the file offset,
so the caller will usually want to truncate the file before calling
On Thu, Dec 06, 2018 at 03:33:06PM -0500, Ted Unangst wrote:
> ktrace -C will return an error if you don't have a ktrace.out file because
> sys_ktrace tries to open it whenever it has a filename, even if it won't be
> used. I think it is more consistent to require it be null, so that we aren't
> opening files we won't be using.
> man page and utility diff below.
`ktrace -C' is shown twice as example in ktrace(1), once in DESCRIPTION
and at the end of EXAMPLES again.