Commit Graph

13025 Commits

Author SHA1 Message Date
Kenneth D. Merry
0183e01516 Add LTO-8 density codes.
lib/libmt/mtlib.c:
	Add the LTO-8 density code to the density table in libmt.

usr.bin/mt/mt.1:
	Add the LTO-8 density code, tracks, bpmm, and bpi to the density
	table in the mt(1) man page.

MFC after:	3 days
Sponsored by:	Spectra Logic
2017-05-11 13:46:30 +00:00
Enji Cooper
1ec87e7fc8 procstat(1): also reference icmp(4) and sctp(4)
This was missed in the previous commit by accident.

MFC after:	3 weeks
MFC with:	r318178
Sponsored by:	Dell EMC Isilon
2017-05-11 07:58:04 +00:00
Enji Cooper
316ccf01fd procstat(1): document all possible PRO (network protocol) values
Reference the appropriate section 4 manpages for networking
protocols.

MFC after:	3 weeks
Sponsored by:	Dell EMC Isilon
2017-05-11 07:55:38 +00:00
Enji Cooper
9c72afc9dd procstat(1): clarify the Signal Disposition section
- Fix a typo (SIGIGN -> SIG_IGN). Use .Dv when referencing SIG_IGN.
- Use semi-colons as soft breaks when separating sentences for
  the FLAGS section.
- Tweak wording for C slightly to flow better and to be a bit
  more technically correct (signals with handlers installed will
  be caught by the target program).
- Reference signal(3) in the SEE ALSO section.

MFC after:	3 weeks
Sponsored by:	Dell EMC Isilon
2017-05-11 06:35:23 +00:00
Enji Cooper
83fbc8857f procstat(1): fix a typo (it's -> its)
MFC after:	3 weeks
Sponsored by:	Dell EMC Isilon
2017-05-11 06:24:57 +00:00
Simon J. Gerraty
cac6fd1154 Merge bmake-20170510
No-op change other than version update.
2017-05-10 22:45:05 +00:00
Alan Somers
0ce59aa848 Don't depend on assert(3) getting evaluated
Reported by:	imp
MFC after:	3 weeks
X-MFC-With:	318141, 318143
Sponsored by:	Spectra Logic Corp
2017-05-10 16:06:22 +00:00
Alan Somers
5cbe126a6d strcpy => strlcpy
Reported by:	Coverity
CID:		1352771
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
2017-05-10 15:27:36 +00:00
Edward Tomasz Napierala
50bc66f437 Revert to pre-r318116 wording to not give the false impression
that setting the kernels' idea of terminal size is somehow an
alternative to environment variables.

Reported by:	kib
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-10 14:54:32 +00:00
Emmanuel Vadot
2dcfca637d mkimg: Add -C argument to specify maximum capacity
Add a -C option to specify a maximum capacity for the final image file.
It is useful to control the size of the generated image for sdcard or
when we will add dynamic size partition.

Add --capacity which is a shorthand to define min and max capacity at
the same time.

Reviewed by:	bapt, marcel, wblock (manpages)
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D10509
2017-05-10 09:36:34 +00:00
Edward Tomasz Napierala
df2a34c016 Random updates to resizewin(1) man page.
Reviewed by:	cem, Daniel O'Connor <darius@dons.net.au>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D10640
2017-05-09 20:45:21 +00:00
Bryan Drewery
07676084ec DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-05-09 01:48:23 +00:00
Bryan Drewery
6106a50ee6 DIRDEPS_BUILD: Connect new directories.
Sponsored by:	Dell EMC Isilon
2017-05-09 01:48:14 +00:00
Conrad Meyer
48b644192d csplit(1): Fix extraneous output in edge case
When the input to csplit contains fewer lines than the number of matches
specified, extra output was mistakenly included in some output files.

Fix the bug and add a simple ATF regression test.

PR:		219024
Submitted by:	J.R. Oldroyd <fbsd at opal.com>
2017-05-08 15:51:29 +00:00
Danilo G. Baio
f83d9358c2 Add myself (dbaio) as a new ports committer
Approved by:	garga (mentor)
Differential Revision:	https://reviews.freebsd.org/D10633
2017-05-08 14:33:38 +00:00
Edward Tomasz Napierala
bd274cceae Sort variable declarations; no functional changes.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-08 09:14:41 +00:00
Edward Tomasz Napierala
f1504c0c26 Add resizewin -z. It makes resizewin not do anything if the terminal
size is already set to something other than zero. It's supposed to be
called from eg /etc/profile - it's not neccessary to query terminal
size when logging in over the network, because the protocol used already
takes care of this, but it's neccessary when logging over a serial line.

Reviewed by:	cem, Daniel O'Connor <darius@dons.net.au>
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10637
2017-05-08 08:58:51 +00:00
Edward Tomasz Napierala
048fd859ce Use tcflush(3) instead of (nonstandard) TIOCFLUSH.
Reported by:	kib
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-08 08:34:50 +00:00
Edward Tomasz Napierala
7ffc8a5418 Make resizewin(1) discard the terminal queues, to lower the chance
for "unable to parse response" error which happens when youre typing
too fast for the machine you're running it on.

Reviewed by:	cem, Daniel O'Connor <darius@dons.net.au>
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10624
2017-05-07 17:21:22 +00:00
Edward Tomasz Napierala
31cf65bbf8 Rename a variable, hopefully fixing build after r317901.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-07 12:08:41 +00:00
Edward Tomasz Napierala
46f44afb63 Improve error reporting in resizewin(1).
Reviewed by:	cem (earlier version)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10624
2017-05-07 09:19:42 +00:00
Baptiste Daroussin
1fc317e374 Build zstandard with threading enabled 2017-05-06 10:59:10 +00:00
Baptiste Daroussin
c3b26e0c47 Add a zstdmt which is equivalent as running zstd -T0 2017-05-06 10:28:57 +00:00
Baptiste Daroussin
d5f16c6603 Import Zstandard 1.2.0
Among new things it is now threaded by default, use zstd -T# to chose the
number of threads not that -T0 will automatically determine the number of
threads based on the number of CPU online.
2017-05-06 10:26:40 +00:00
Kenneth D. Merry
64409eeee7 Add basic programmable early warning error injection to the sa(4) driver.
This will help application developers simulate end of tape conditions.

To inject an error in sa0:

sysctl kern.cam.sa.0.inject_eom=1

This will return the next read or write request queued with 0 bytes
written.  Any subsequent writes or reads will go along as usual.

This will also cause the early warning position flag to get set
for the next position query.  So, 'mt status' will show the BPEW
(Beyond Programmable Early Warning) flag on the first query after
an error injection.  After that, the position flags will be as they
are in the underlying tape drive.

Also, update the sa(4) man page to describe tape parameters,
which can be set via 'mt param'.

sys/cam/scsi/scsi_sa.c:
	In saregister(), create the inject_eom sysctl variable.

	In sastart(), check to see whether inject_eom is set.  If
	so, return the read or write with 0 bytes written to
	indicate EOM.  Set the set_pews_status flag so that we
	fake PEWS status in the next position call for reads, and the
	next 3 calls for writes.  This allows the user to see the BPEW
	flag one time via 'mt status'.

	In sagetpos(), check the set_pews_status flag and fake
	PEWS status and decrement the counter if it is set.

share/man/man4/sa.4:
	Document the inject_eom sysctl variable.

	Document all of the parameters currently supported via
	'mt param'.

usr.bin/mt/mt.1:
	Point the user to the sa(4) man page for more details on
	supported parameters.

MFC after:	3 days
Sponsored by:	Spectra Logic
2017-05-05 20:00:53 +00:00
Ed Maste
e2127de812 bsdgrep: don't ouptut matches with -c, -l, -L
Refactoring done in r317703 broke -c, -l, and -L flags implying
suppression of match printing.  Fortunately this is just a matter of not
doing any printing of the resulting matches and context printing was not
broken in this refactoring.

Add some regression tests since this area may still see further
refactoring, include different context flags as well even though they
were not broken in this case.

PR:		219077
Submitted by:	Kyle kevans91@ksu.edu
Reported by:	markj
Reviewed by:	cem, ngie
Differential Revision:	https://reviews.freebsd.org/D10607
2017-05-05 17:35:05 +00:00
Xin LI
f6b74a7d16 MFV r317581: less v491.
MFC after:	1 month
2017-05-05 14:33:39 +00:00
Michael Tuexen
c0b72375d8 Add support for sctp_generic_sendmsg() and sctp_generic_recvmsg(). 2017-05-03 16:03:33 +00:00
Ed Maste
83fd8885c4 bsdgrep: correct uninitialized variable introduced in r317703
CID:		1374747
Submitted by:	Kyle Evans <kevans91@ksu.edu>
2017-05-03 13:47:02 +00:00
Michael Tuexen
fca08fe6a2 Add support for sendmsg() and recvmsg(). 2017-05-03 12:26:16 +00:00
Michael Tuexen
8b429b6569 Decode the fourth argument of sendto and recvfrom call. 2017-05-03 12:23:58 +00:00
Michael Tuexen
832af45715 Add support for [gs]etsockopt(). 2017-05-03 12:18:09 +00:00
Michael Tuexen
ecac235bb0 Decode the third argument of socket(). 2017-05-03 09:23:13 +00:00
Michael Tuexen
58227c6061 Add Socklent for handling args of type socklen_t. 2017-05-03 09:20:36 +00:00
Michael Tuexen
e8d2c81d5b Add support for listen() call. 2017-05-03 09:09:34 +00:00
Jilles Tjoelker
daa379c5af csplit: Fix check of fputs() return value, making csplit work again.
As of r295638, fputs() returns the number of bytes written (if not more than
INT_MAX). This broke csplit completely, since csplit assumed only success
only for the return value 0.

PR:		213510
Submitted by:	J.R. Oldroyd
MFC after:	1 week
Relnotes:	yes
2017-05-02 21:56:20 +00:00
Brooks Davis
517b671957 Use MAN=<empty> rather than MK_MAN=no to not install a manpage.
MFC after:	1 week
2017-05-02 21:09:07 +00:00
Ed Maste
476d209821 bsdgrep: avoid use of magic number for REG_NOSPEC
Submitted by:	Kyle Evans <kevans91 at ksu.edu>
Differential Revision:	https://reviews.freebsd.org/D10420
2017-05-02 21:08:38 +00:00
Ed Maste
41e04e8c77 bsdgrep: fix escape map building for multibyte strings
In BSD grep, fix escape map building in the regex parser. It was
previously using memory not explicitly initialized, and the MBS escape
map was being built based on a version of the pattern with escapes
already parsed out.

This is Kyle's change, but I restored the broken style that already
exists in this file.

Submitted by:	Kyle Evans <kevans91 at ksu.edu>
Reviewed by:	cem, Kyle Evans (my style changes)
Differential Revision:	https://reviews.freebsd.org/D10098
2017-05-02 20:44:06 +00:00
Ed Maste
a4f3f02be6 bsdgrep: fix -w flag matching with an empty pattern
-w flag matching with an empty pattern was generally 'broken', allowing
matches to occur on any line whether or not it actually matches -w
criteria.

This fix required a good amount of refactoring to address.  procline()
is altered to *only* process the line and return whether it was a match
or not, necessary to be able to short-circuit the whole function in case
of this matchall flag. -m flag handling is moved out as well because it
suffers from the same fate as context handling if we bypass any actual
pattern matching.

The matching context (matches, mostly) didn't previously exist outside
of procline(), so we go ahead and create context object for file
processing bits to pass around.  grep_printline() was created due to
this, for the scenarios where the matches don't actually matter and we
just want to print a line or two, a la flushing the context queue and
no -o or --color specified.

Damage from this broken behavior would have been mitigated by the fact
that it is unlikely users would invoke grep -w with an empty pattern.

This was identified while checking PR 105221 for problems it this may
cause in BSD grep, but PR 105221 is *not* a report of this behavior.

Submitted by:	Kyle Evans <kevans91 at ksu.edu>
Differential Revision:	https://reviews.freebsd.org/D10433
2017-05-02 20:39:33 +00:00
Ed Maste
a535623c78 bsdgrep: correct test sense from r317700
Kyle's change in review D10098 was correct. I introduced the error when
extracting a portion of that change.
2017-05-02 20:08:04 +00:00
Ed Maste
e0780d5479 bsdgrep: use calloc where appropriate in grep's tre-fastmatch
Also apply style(9) to a related NULL check.

Submitted by:	Kyle Evans <kevans91 at ksu.edu> (D10098)
2017-05-02 19:56:42 +00:00
Ed Maste
f76958b1c2 bsdgrep: correct nls usage data after r317049
r317049 added -z/--null-data to BSD grep but missed the update to nls
catalogs.

Submitted by:	Kyle Evans <kevans91 at ksu.edu>
Differential Revision:	https://reviews.freebsd.org/D10456
2017-05-02 13:47:15 +00:00
Ed Maste
cc41ba26bb bsdgrep: Add GNU compatible version string indicator
As reported in r218614 it's useful to have an indication of whether or not
BSD grep was built with GNU_GREP_COMPAT.

Submitted by:	Kyle Evans <kevans91 at ksu.edu>
Reported by:	mandree
Differential Revision:	https://reviews.freebsd.org/D10451
2017-05-02 13:38:20 +00:00
Ed Maste
945fc991b2 bsdgrep: fix -w -v matching improperly with certain patterns
-w and -v flag matching was mostly functional but had some minor
problems:

1. -w flag processing only allowed one iteration through pattern
   matching on a line. This was problematic if one pattern could match
   more than once, or if there were multiple patterns and the earliest/
   longest match was not the most ideal, and

2. Previous work "fixed" things to not further process a line if the
   first iteration through patterns produced no matches. This is clearly
   wrong if we're dealing with the more restrictive -w matching.

#2 breakage could have also occurred before recent broad rewrites, but
it would be more arbitrary based on input patterns as to whether or not
it actually affected things.

Fix both of these by forcing a retry of the patterns after advancing
just past the start of the first match if we're doing more restrictive
-w matching and we didn't get any hits to start with. Also move -v flag
processing outside of the loop so that we have a greater change to match
in the more restrictive cases. This wasn't strictly wrong, but it could
be a little more error prone.

While here, introduce some regressions tests for this behavior and fix
some excessive wrapping nearby that hindered readability. GNU grep
passes these new tests.

PR:		218467, 218811
Submitted by:	Kyle Evans <kevans91 at ksu.edu>
Reviewed by:	cem, ngie
Differential Revision:	https://reviews.freebsd.org/D10329
2017-05-02 02:32:10 +00:00
Bryan Drewery
9f665e12ce Redo r288270: Hookup mkcsmapper_static and mkesdb_static for 'make clean'
These are only built as part of the top-level 'build-tools' call for
'make buildworld'.  They still need to be cleaned during the 'make clean'
treewalks though.

Reported by:	markj
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-01 19:34:15 +00:00
Jilles Tjoelker
342b089bca printf: Output formatted data directly, instead of via asprintf.
Long ago, sh used to have its own optimized and restricted string formatting
implementation, which the printf builtin had to bypass via asprintf() to a
temporary buffer. Since sh has used libc's string formatting implementation
for a long time, remove the workaround.

Add a check to keep  printf %c ''  working the same way (output nothing);
POSIX allows both outputting nothing and outputting a NUL byte.

Also, this change avoids silently discarding format directives for whose
output asprintf() cannot allocate memory.
2017-04-29 21:48:11 +00:00
Pedro F. Giffuni
336c5fb5cd Fix some cases where an index was used before its limits check.
Obtained from:	DragonFlyBSD (git 799ba435)
MFC after:	5 days
2017-04-29 06:41:51 +00:00
Brooks Davis
b4e2ab78df Remove NATM configuration bits and assorted NATM and ATM remnants.
Reported by:	ak
Reviewed by:	ngie (first version)
Differential Revision:	https://reviews.freebsd.org/D10497
2017-04-25 21:59:34 +00:00
Brooks Davis
5f20d1ae1b Clean up Makefile.
Prefer SRCTOP vs .CURDIR relative paths.

Find libnetbsd using LIBADD infrastructure rather than manual hackery.

Reviewed by:	ngie, bapt
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10461
2017-04-24 21:31:27 +00:00