Commit Graph

13537 Commits

Author SHA1 Message Date
wiz
696f76c399 Sort options.
-qv are not specific to -r, so separate them.
Add -q and -v descriptions to the general option table.
2017-10-02 08:23:23 +00:00
kre
329c11fb8f Remove some unnecessary words. 2017-10-01 22:35:23 +00:00
maya
9b177b90f0 Add arguments to tail:
-q: suppress filename headers when multiple files are used
  -v: print filename headers even when only one file is used

head already supports the same arguments, which originated in GNU head.
GNU tail also has the same flags.


Add tac, a hard link to 'tail -rq'.
Prints a file in reverse line order.

Similar to GNU tac, but lacking any options.

Add accompanying documentation.
2017-10-01 20:49:24 +00:00
jmcneill
28b7028865 add sh arch 2017-09-29 21:18:28 +00:00
agc
89894cf870 Also report versions of tcpdump, libpcap, and wpa_supplicant
Bump sys_info version to 20170928
2017-09-28 18:08:04 +00:00
joerg
d03e05b4e5 Force _GNU_SOURCE on Linux, otherwise strptime is not defined and more
restrictive macros result in even nastier fallout.
2017-09-24 09:43:27 +00:00
kre
3777c939b3 Handle the new %f (as an addition to the strftime format - -t arg)
correctly, in particular %%f does not contain the %f format, and like
all strftime conversions, %f can occur more than once (not that it is
likely to happen, but just in case...)
2017-09-21 22:53:19 +00:00
kre
79b3cfa2ed KNF, and since this gets compiled as a tool, avoid C99 declarations. 2017-09-21 18:50:08 +00:00
wiz
598b83d451 Sort options and their descriptions in man page and usage. 2017-09-21 07:07:28 +00:00
agc
c77bafde22 Update sys_info to 20170920
+ add a -d <destdir> option, which allows the versions of programs
in a directory tree rooted at "<destdir>" to be reported on, rather
than the programs and libraries rooted under /. This is useful, for
example, for finding out the versions of utilities and libraries
after a build.sh run:

	% sys_info
	awk-20121220
	bind-9.10.5pl2
	bozohttpd-20170201
	bzip2-1.0.6
	calendar-20160601
	dhcpcd-7.0.0-rc1
	dtc-1.4.4
	ftpd-20110904
	g++-5.4.0
	gcc-5.4.0
	grep-2.5.1anb1
	gzip-20170803
	libc-12.208
	...
	% sys_info -d /data/8/build/dest/x86_64
	awk-20121220
	bind-9.10.5pl1
	bozohttpd-20170201
	bzip2-1.0.6
	calendar-20160601
	dhcpcd-7.0.0-rc1
	ftpd-20110904
	g++-5.4.0
	gcc-5.4.0
	grep-2.5.1anb1
	gzip-20150113
	libc-12.207
	...
	%
2017-09-21 01:15:45 +00:00
kre
ac205bb2d4 Set the default time format for linux mode (-x) in the correct place,
so it only applies to -x (in particular, not to -s) and only if another
time format has not been explicitly selected (earlier in the arg list).

With luck, this will make lots of tests, which depended upon "stat -s"
actually generating correct sh assignment statements, go back to working again.
2017-09-20 17:45:25 +00:00
wiz
74d5645f3a whitespace fixes, use Xr. 2017-09-20 08:57:02 +00:00
christos
c5fdb5719f - add the sticky bits to mode
- fix linux Birth for the havenots
code review via email from @@@
2017-09-20 01:23:37 +00:00
christos
952c61b290 - if st_dev/st_rdev == NODEV print -1 instead of unsigned
- update to the latest linux stat(1) format for -x (kind of)
- add the ability to display nanoseconds, like linux does
- change u_intX_t -> uintX_t
2017-09-19 21:45:28 +00:00
wiz
2f78e4cca5 Sync usage with man page. 2017-09-10 10:09:40 +00:00
wiz
928632ef48 Sort flags in SYNOPSIS. Remove unnecessary .Tn. Remove trailing whitespace. 2017-09-10 10:09:34 +00:00
jmcneill
048928076f add dtc (Device Tree Compiler) version info 2017-09-09 14:12:09 +00:00
uwe
ed98c1eb1b Print negative time offsets correctly. Provide an exegetical quote
from riastradh@, slightly edited to fit the metre.
2017-09-08 21:45:08 +00:00
uwe
de9da0ab97 Option -E to display elapsed timestamps (time since beginning of trace).
Option name from FreeBSD.  While here, make it possible to use a
combination of -T -E and -R to display timestamps in several formats.
Idea also from FreeBSD.
2017-09-08 21:09:29 +00:00
uwe
fc62aa370e Drop support for KTRFACv0 (NetBSD 3) and KTRFACv1 (NetBSD 5).
Note that on 32-bit platforms it probably never worked anyway because
header size changed from v1 to v2 when time_t became 64 bit.

ok christos@
CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?
2017-09-08 20:36:56 +00:00
mlelstv
809af110e7 Don't print "nan" when there is no disk activity. 2017-09-06 06:05:23 +00:00
wiz
b595ba67a1 Sync usage with man page. 2017-08-27 20:40:22 +00:00
wiz
76fb9e13aa Use Nm. 2017-08-27 20:39:26 +00:00
wiz
acc8606ccd Fix xref. 2017-08-27 20:38:39 +00:00
kre
9f2931ceb6 Get rid of the arg sorting - it doesn't work properly, and makes it
impossible to support component names containing embedded \n's (the
similar embedded space problem would have been trivial to fix.)
Deleting the sorting makes those issues moot, the args are no longer
processed, hence can be anything.

An alternative would be to sort the results - but that would separate
the -v output from the real output (-v stuff is not rationally sortable)
and also makes it much more difficult to get the error code for an
unknown component (like one containing an embedded \n !) as the pipe
to strt that would be used would cause the while loop to run in a sub-shell
(effectively.)
2017-08-24 01:43:42 +00:00
agc
da4a8c85c5 Move back to a simple version string for sys_info. The way of using
CVS's $ Date $ expansion to calculate the date, whilst being more
accurate, runs into issues with reproducible builds, and alternate
repository software. Simplicity wins here.

Add yacc to the list of utilities to report on
2017-08-23 21:18:57 +00:00
kre
fa98c4d014 Add a \ -- allows sys_info -v pkg_install to tell us who the version info
is obtained, rather than just how we go about printing the result.
2017-08-23 19:18:38 +00:00
agc
dc6cab8695 add pkg_install to the list of programs reported
don't throw a warning if tcsh is not found in the path
2017-08-23 18:15:53 +00:00
christos
13a9a3bb6f now that we are processing SIGINFO write can be interrupted and return
partial results (well, it could before too but it was harder to trigger);
provide write_fully like we have read_fully already.
2017-08-23 13:04:17 +00:00
kre
e5c13d3e3e Put back getopts - it is easier to get correct than hand rolled code.
Add -L and -P flags to allow the library/cmd search paths to be set.
Add support for getting vers info from sh, dhcpcd, and userland (/etc/release).
Stop abusing "sh -x" to support -v - do it properly.  Get rid of the duplicate
list of components used when there are no args, instead make better use of sh
capabilities to just process everything.  Better use of what sh can do for us
other places too.   Add a (more or less random) set of libraries to include
in output when no args are given.

OK agc (well, earlier version...)
2017-08-23 01:17:46 +00:00
agc
3e7391255c also add tzdata versioning information 2017-08-21 19:51:32 +00:00
agc
82610a7d71 restore martin's change for tcsh versioning which got lost in the last update 2017-08-21 19:36:57 +00:00
agc
8df5d7616d Changes to sys_info (20170821)
+ get rid of -a argument, which was superfluous since no arguments
means provide information on everything known

+ add the shell function to check for the path of a program. Taken
from pkgsrc bootstrap script, modified for return values, and "not
found" action

+ use this shell function for tcsh and unbound, both of which may not
exist on systems

+ go back to using standard shell construct for parsing options now,
since there is only 1 option with no optargs

+ from a suggestion from Paul Goyette, run the provided arguments
through sort | uniq

+ add sys_info itself to the list of programs to report
2017-08-21 19:22:31 +00:00
martin
090bfffa53 Use tcsh --version instead of an echo $version -- the old way did not
work for me (not quite sure why not).
2017-08-20 10:17:55 +00:00
agc
65b09bb66d Parse the arguments to sys_info(1) a bit differently, using getopts(1)
Thanks to Paul Goyette for the nudge
2017-08-19 18:36:31 +00:00
agc
f2db8c00aa + don't assume that tcsh is always installed, pointed out by jmcneill - thanks!
+ a "sys_info" invocation without any args is now the equivalent of sys_info -a,
just like pkg_info
2017-08-19 03:06:50 +00:00
ginsbach
6361925b16 Remove spurious error(1) inserted compiler error message comments. 2017-08-11 20:32:34 +00:00
sjg
f20013011f Avoid full path meta file names for subdir of .OBJDIR 2017-08-10 21:07:48 +00:00
mrg
5e22a92ec6 add SIGINFO support. 2017-08-04 07:27:08 +00:00
cheusov
ea1a131a00 Compare return value of fputs(3) with EOF instead of 0.
This is POSIX-ly correct and fixes csplit(1) on non-NetBSD systems.
2017-07-30 23:02:53 +00:00
dholland
8a66658e44 The proper way to validate a condition that's expected to be true is
to assert it, not to bolt it into the program logic in a way that will
cause strange behavior if it accidentally isn't true at some point.
2017-07-30 20:37:35 +00:00
riastradh
76d4b81251 Clarify compile-time and run-time arithmetic safety assertions.
This is an experiment with a handful of macros for writing the
checks, most of which are compile-time:

MUL_OK(t, a, b)         Does a*b avoid overflow in type t?
ADD_OK(t, a, b)         Does a + b avoid overflow in type t?
TOOMANY(t, x, b, m)     Are there more than m b-element blocks in x in type t?
                        (I.e., does ceiling(x/b) > m?)

Addenda that might make sense but are not needed here:

MUL(t, a, b, &p)        Set p = a*b and return 0, or return ERANGE if overflow.
ADD(t, a, b, &s)        Set s = a+b and return 0, or return ERANGE if overflow.

Example:

	uint32_t a = ..., b = ..., y = ..., z = ..., x, w;

        /* input validation */
        error = MUL(size_t, a, b, &x);
        if (error)
                fail;
        if (TOOMANY(uint32_t, x, BLKSIZ, MAX_NBLK))
                fail;
        y = HOWMANY(x, BLKSIZ);
        if (z > Z_MAX)
                fail;
        ...
        /* internal computation */
        __CTASSERT(MUL_OK(uint32_t, Z_MAX, MAX_NBLK));
        w = z*y;

Obvious shortcomings:

1. Nothing checks your ctassert matches your subsequent arithmetic.
   (Maybe we could have BOUNDED_MUL(t, x, xmax, y, ymax) with a
   ctassert inside.)

2. Nothing flows the bounds needed by the arithmetic you use back
   into candidate definitions of X_MAX/Y_MAX.

But at least the reviewer's job is only to make sure that (a) the
MUL_OK matches the *, and (b) the bounds in the assertion match the
bounds on the inputs -- in particular, the reviewer need not derive
the bounds from the context, only confirm they are supported by the
paths to it.

This is not meant to be a general-purpose proof assistant, or even a
special-purpose one like gfverif <http://gfverif.cryptojedi.org/>.
Rather, it is an experiment in adding a modicum of compile-time
verification with a simple C API change.

This also is not intended to serve as trapping arithmetic on
overflow.  The goal here is to enable writing the program with
explicit checks on input and compile-time annotations on computation
to gain confident that overflow won't happen in the computation.
2017-07-29 21:04:07 +00:00
sjg
a5cccb4af8 Make compat.c handle SIGINT etc more like job.c
If there is a running child, pass the signal on, and
wait for it to exit before we self-terminate.

Reviewed by: christos
2017-07-20 19:29:54 +00:00
wiz
1c4feb4ef6 Simplify. 2017-07-15 14:40:36 +00:00
christos
59fa4f31ea Allow the user to specify the output format on the command line. 2017-07-15 14:34:08 +00:00
wiz
edd62e729c Remove unnecessary macros. Use standard headers. 2017-07-15 12:10:31 +00:00
jmcneill
c3934401dc Add support for "kernel_noload" image types. This type is the same as the
"kernel" type, except it can run from any load address.
2017-07-15 11:13:08 +00:00
mlelstv
9368f38e90 Use I/O timestamps to compute disk statistics for better precisison. 2017-07-15 08:22:23 +00:00
wiz
6595bf8f10 Sort sections. Fix macro usage. 2017-07-13 10:59:53 +00:00
maxv
138795e97b Update. 2017-07-12 17:38:15 +00:00