Commit Graph

11725 Commits

Author SHA1 Message Date
Jilles Tjoelker
6ab1d4d9c3 env: Fix crash when -S string is not empty but no operand follows.
split_spaces() set argc in main() incorrectly, which caused trouble for
getopt().

Examples:
  env -S '\c'
  env -S -i

PR:		197769
MFC after:	1 week
2015-03-08 14:12:43 +00:00
Dimitry Andric
6404f697a0 Merging ^/head r279596 through r279758. 2015-03-07 23:01:27 +00:00
Pedro F. Giffuni
20254bfa69 rlogin(1): initialize term variable.
CID:		1011522
Obtained from:	NetBSD (CVS 1.18, partial)
2015-03-05 19:51:37 +00:00
Baptiste Daroussin
8ae63aa054 r* commands are not precious anymore 2015-03-04 22:01:44 +00:00
Baptiste Daroussin
e061f95e7b Rework calendar(1) parser
Support includes surrounded by '"' or '<' '>'
Print warnings about bad syntax
Correctly navigate through include directories to find calendar files
Correctly support multiple includes

Tested by:	gjb
MFC after:	1 week
2015-03-04 20:04:23 +00:00
Dimitry Andric
ca65be80fd Merge ^/head r279313 through r279595. 2015-03-04 19:47:33 +00:00
Marcel Moolenaar
315ca438f3 Fix typo in dropped-packets attribute (missing s).
Pointed-out by: allanjude (excellent catch!)
2015-03-04 02:56:32 +00:00
Kenneth D. Merry
5090c893b7 Add density code for DAT-72, and notes on DAT-160.
As it turns out, the density code for DAT-160 (0x48) is the same
as for SDLT220.  Since the SDLT values are already in the table,
we will leave them in place.

Thanks to Harald Schmalzbauer for confirming the DAT-72 density code.

lib/libmt/mtlib.c:
	Add DAT-72 density code, and commented out DAT-160 density
	code.  Explain why DAT-160 is commented out.  Add notes
	explaining where the bpi values for these formats came from.

usr.bin/mt/mt.1:
	Add DAT-72 density code, and add a note explaining that
	the SDLTTapeI(110) density code (0x48) is the same as
	DAT-160.

Sponsored by:	Spectra Logic
MFC after:	3 weeks
2015-03-03 22:49:07 +00:00
Baptiste Daroussin
849684b013 Update mandoc to cvs snaphot from 20150302
Use the new unsupp warning level to detect the unsupported manpages in man(1)
2015-03-02 16:58:57 +00:00
Jilles Tjoelker
22ea47ec90 sh: Fix compiler warnings related to duplicate or missing declarations. 2015-03-01 21:46:55 +00:00
Dimitry Andric
0d56a8cba1 Merge ^/head r279163 through r279308. 2015-02-26 07:26:56 +00:00
Hans Petter Selasky
39b86a6a6f Update to upstream version 2.10
The most notable new feature is support for definition files.

Obtained from:	http://dotat.at/prog/unifdef
MFC after:	1 week
2015-02-25 21:10:03 +00:00
Xin LI
3b557094a2 Explicitly crypt_set_format("des") and bail out if we
can't.  This would prevent problem when we changed the
default crypt(3) algorithm or removed it in the future.

PR:		bin/189958
MFC after:	1 month
2015-02-25 20:47:25 +00:00
Marcel Moolenaar
65f2833127 Fix "netstat -hdw 1" output.
Reported by: np@
2015-02-25 17:06:27 +00:00
Kenneth D. Merry
7b7c7a0533 Fix several problems found by Coverity.
lib/libmt/mtlib.c:
	In mt_start_element(), make sure we don't overflow the
	cur_sb array.  CID 1271325

usr.bin/mt/mt.c:
	In main(), bzero the mt_com structure so that we aren't
	using any uninitialized stack variables.  CID 1271319

	In mt_param(), only allow one -s and one -p argument.  This
	will prevent a memory leak caused by overwriting the
	param_name and/or param_value variables.  CID 1271320 and
	CID 1271322

	To make things simpler in mt_param(), make sure there
	there is only one exit path for the function.  Make sure
	the arguments are explicitly freed.

Sponsored by:	Spectra Logic
Pointed out by:	emaste
MFC after:	1 month
2015-02-25 04:30:23 +00:00
Kenneth D. Merry
43518607b2 Significant upgrades to sa(4) and mt(1).
The primary focus of these changes is to modernize FreeBSD's
tape infrastructure so that we can take advantage of some of the
features of modern tape drives and allow support for LTFS.

Significant changes and new features include:

 o sa(4) driver status and parameter information is now exported via an
   XML structure.  This will allow for changes and improvements later
   on that will not break userland applications.  The old MTIOCGET
   status ioctl remains, so applications using the existing interface
   will not break.

 o 'mt status' now reports drive-reported tape position information
   as well as the previously available calculated tape position
   information.  These numbers will be different at times, because
   the drive-reported block numbers are relative to BOP (Beginning
   of Partition), but the block numbers calculated previously via
   sa(4) (and still provided) are relative to the last filemark.
   Both numbers are now provided.  'mt status' now also shows the
   drive INQUIRY information, serial number and any position flags
   (BOP, EOT, etc.) provided with the tape position information.
   'mt status -v' adds information on the maximum possible I/O size,
   and the underlying values used to calculate it.

 o The extra sa(4) /dev entries (/dev/saN.[0-3]) have been removed.

   The extra devices were originally added as place holders for
   density-specific device nodes.  Some OSes (NetBSD, NetApp's OnTap
   and Solaris) have had device nodes that, when you write to them,
   will automatically select a given density for particular tape drives.

   This is a convenient way of switching densities, but it was never
   implemented in FreeBSD.  Only the device nodes were there, and that
   sometimes confused users.

   For modern tape devices, the density is generally not selectable
   (e.g. with LTO) or defaults to the highest availble density when
   the tape is rewritten from BOT (e.g. TS11X0).  So, for most users,
   density selection won't be necessary.  If they do need to select
   the density, it is easy enough to use 'mt density' to change it.

 o Protection information is now supported.  This is either a
   Reed-Solomon CRC or CRC32 that is included at the end of each block
   read and written.  On write, the tape drive verifies the CRC, and
   on read, the tape drive provides a CRC for the userland application
   to verify.

 o New, extensible tape driver parameter get/set interface.

 o Density reporting information.  For drives that support it,
   'mt getdensity' will show detailed information on what formats the
   tape drive supports, and what formats the tape drive supports.

 o Some mt(1) functionality moved into a new mt(3) library so that
   external applications can reuse the code.

 o The new mt(3) library includes helper routines to aid in parsing
   the XML output of the sa(4) driver, and build a tree of driver
   metadata.

 o Support for the MTLOAD (load a tape in the drive) and MTWEOFI
   (write filemark immediate) ioctls needed by IBM's LTFS
   implementation.

 o Improve device departure behavior for the sa(4) driver.  The previous
   implementation led to hangs when the device was open.

 o This has been tested on the following types of drives:
	IBM TS1150
	IBM TS1140
	IBM LTO-6
	IBM LTO-5
	HP LTO-2
	Seagate DDS-4
	Quantum DLT-4000
	Exabyte 8505
	Sony DDS-2

contrib/groff/tmac/doc-syms,
share/mk/bsd.libnames.mk,
lib/Makefile,
	Add libmt.

lib/libmt/Makefile,
lib/libmt/mt.3,
lib/libmt/mtlib.c,
lib/libmt/mtlib.h,
	New mt(3) library that contains functions moved from mt(1) and
	new functions needed to interact with the updated sa(4) driver.

	This includes XML parser helper functions that application writers
	can use when writing code to query tape parameters.

rescue/rescue/Makefile:
	Add -lmt to CRUNCH_LIBS.

src/share/man/man4/mtio.4
	Clarify this man page a bit, and since it contains what is
	essentially the mtio.h header file, add new ioctls and structure
	definitions from mtio.h.

src/share/man/man4/sa.4
	Update BUGS and maintainer section.

sys/cam/scsi/scsi_all.c,
sys/cam/scsi/scsi_all.h:
	Add SCSI SECURITY PROTOCOL IN/OUT CDB definitions and CDB building
	functions.

sys/cam/scsi/scsi_sa.c
sys/cam/scsi/scsi_sa.h
	Many tape driver changes, largely outlined above.

	Increase the sa(4) driver read/write timeout from 4 to 32
	minutes.  This is based on the recommended values for IBM LTO
	5/6 drives.  This may also avoid timeouts for other tape
	hardware that can take a long time to do retries and error
	recovery.  Longer term, a better way to handle this is to ask
	the drive for recommended timeout values using the REPORT
	SUPPORTED OPCODES command.  Modern IBM and Oracle tape drives
	at least support that command, and it would allow for more
	accurate timeout values.

	Add XML status generation.  This is done with a series of
	macros to eliminate as much duplicate code as possible.  The
	new XML-based status values are reported through the new
	MTIOCEXTGET ioctl.

	Add XML driver parameter reporting, using the new MTIOCPARAMGET
	ioctl.

	Add a new driver parameter setting interface, using the new
	MTIOCPARAMSET and MTIOCSETLIST ioctls.

	Add a new MTIOCRBLIM ioctl to get block limits information.

	Add CCB/CDB building routines scsi_locate_16, scsi_locate_10,
	and scsi_read_position_10().

	scsi_locate_10 implements the LOCATE command, as does the
	existing scsi_set_position() command.  It just supports
	additional arguments and features.  If/when we figure out a
	good way to provide backward compatibility for older
	applications using the old function API, we can just revamp
	scsi_set_position().  The same goes for
	scsi_read_position_10() and the existing scsi_read_position()
	function.

	Revamp sasetpos() to take the new mtlocate structure as an
	argument.  It now will use either scsi_locate_10() or
	scsi_locate_16(), depending upon the arguments the user
	supplies.  As before, once we change position we don't have a
	clear idea of what the current logical position of the tape
	drive is.

	For tape drives that support long form position data, we
	read the current position and store that for later reporting
	after changing the position.  This should help applications
	like Bacula speed tape access under FreeBSD once they are
	modified to support the new ioctls.

	Add a new quirk, SA_QUIRK_NO_LONG_POS, that is set for all
	drives that report SCSI-2 or older, as well as drives that
	report an Illegal Request type error for READ POSITION with
	the long format.  So we should automatically detect drives
	that don't support the long form and stop asking for it after
	an initial try.

	Add a partition number to the sa(4) softc.

	Improve device departure handling. The previous implementation
	led to hangs when the device was open.

	If an application had the sa(4) driver open, and attempted to
	close it after it went away, the cam_periph_release() call in
	saclose() would cause the periph to get destroyed because that
	was the last reference to it.  Because destroy_dev() was
	called from the sa(4) driver's cleanup routine (sacleanup()),
	and would block waiting for the close to happen, a deadlock
	would result.

	So instead of calling destroy_dev() from the cleanup routine,
	call destroy_dev_sched_cb() from saoninvalidate() and wait for
	the callback.

	Acquire a reference for devfs in saregister(), and release it
	in the new sadevgonecb() routine when all devfs devices for
	the particular sa(4) driver instance are gone.

	Add a new function, sasetupdev(), to centralize setting
	per-instance devfs device parameters instead of repeating the
	code in saregister().

	Add an open count to the softc, so we know how many
	peripheral driver references are a result of open
       	sessions.

	Add the D_TRACKCLOSE flag to the cdevsw flags so
	that we get a 1:1 mapping of open to close calls
	instead of a N:1 mapping.

	This should be a no-op for everything except the
	control device, since we don't allow more than one
	open on non-control devices.

	However, since we do allow multiple opens on the
	control device, the combination of the open count
	and the D_TRACKCLOSE flag should result in an
	accurate peripheral driver reference count, and an
	accurate open count.

	The accurate open count allows us to release all
	peripheral driver references that are the result
	of open contexts once we get the callback from devfs.

sys/sys/mtio.h:
	Add a number of new mt(4) ioctls and the requisite data
	structures.  None of the existing interfaces been removed
	or changed.

	This includes definitions for the following new ioctls:

	MTIOCRBLIM      /* get block limits */
	MTIOCEXTLOCATE	/* seek to position */
	MTIOCEXTGET     /* get tape status */
	MTIOCPARAMGET	/* get tape params */
	MTIOCPARAMSET	/* set tape params */
	MTIOCSETLIST	/* set N params */

usr.bin/mt/Makefile:
	mt(1) now depends on libmt, libsbuf and libbsdxml.

usr.bin/mt/mt.1:
	Document new mt(1) features and subcommands.

usr.bin/mt/mt.c:
	Implement support for mt(1) subcommands that need to
	use getopt(3) for their arguments.

	Implement a new 'mt status' command to replace the old
	'mt status' command.  The old status command has been
	renamed 'ostatus'.

	The new status function uses the MTIOCEXTGET ioctl, and
	therefore parses the XML data to determine drive status.
	The -x argument to 'mt status' allows the user to dump out
	the raw XML reported by the kernel.

	The new status display is mostly the same as the old status
	display, except that it doesn't print the redundant density
	mode information, and it does print the current partition
	number and position flags.

	Add a new command, 'mt locate', that will supersede the
	old 'mt setspos' and 'mt sethpos' commands.  'mt locate'
	implements all of the functionality of the MTIOCEXTLOCATE
	ioctl, and allows the user to change the logical position
	of the tape drive in a number of ways.  (Partition,
	block number, file number, set mark number, end of data.)
	The immediate bit and the explicit address bits are
	implemented, but not documented in the man page.

	Add a new 'mt weofi' command to use the new MTWEOFI ioctl.
	This allows the user to ask the drive to write a filemark
	without waiting around for the operation to complete.

	Add a new 'mt getdensity' command that gets the XML-based
	tape drive density report from the sa(4) driver and displays
	it.  This uses the SCSI REPORT DENSITY SUPPORT command
	to get comprehensive information from the tape drive about
	what formats it is able to read and write.

	Add a new 'mt protect' command that allows getting and setting
	tape drive protection information.  The protection information
	is a CRC tacked on to the end of every read/write from and to
	the tape drive.

Sponsored by:	Spectra Logic
MFC after:	1 month
2015-02-23 21:59:30 +00:00
Dimitry Andric
9b2a0d91b8 Merge ^/head r279023 through r279162. 2015-02-22 16:04:37 +00:00
Marcel Moolenaar
e6679c1a71 Add the -c option for specifying the capacity of the disk image. When
a capcity is given, no partitions are required. When no partitions are
given, no scheme needs to be specified either. This makes it possible
to create an entirely empty disk image. To add an empty partitioning
table, specify the scheme.

Bump the version to 20150222.
2015-02-22 04:50:47 +00:00
Marcel Moolenaar
aba885c960 Don't require a scheme if no partitions are given. Change the code
to handle that case. Note that we still require partitions, so the
change is effectively a no-op.
2015-02-22 01:20:49 +00:00
Marcel Moolenaar
b5380f2a09 In scheme_write(), don't overwrite the end parameter with the
return value of image_get_size(). As it so happens, the only
caller of scheme_write() passes exactly that.
2015-02-22 01:01:02 +00:00
Marcel Moolenaar
29eac8d790 Remove extraneous parenthesis in assignment. 2015-02-22 00:58:10 +00:00
Marcel Moolenaar
6504b42f68 Document that netstat(1) supports libxo(3). 2015-02-22 00:01:42 +00:00
Marcel Moolenaar
ade9ccfe21 Convert netstat to use libxo.
Obtained from:  Phil Shafer <phil@juniper.net>
Ported to -current by: alfred@ (mostly), Kim Shrier
Formatting: marcel@
Sponsored by:   Juniper Networks, Inc.
2015-02-21 23:47:20 +00:00
Dimitry Andric
0d36d957d3 Merging ^/head r278916 through r279022. 2015-02-19 21:10:01 +00:00
Gleb Smirnoff
de5ef1dfee Burn bridges to FreeBSD 7.x IGMP stats. 2015-02-19 19:36:54 +00:00
Pedro F. Giffuni
7e8dfdf113 ministat(1): replace malloc + memset with calloc.
Reviewed by:	phk
2015-02-17 23:20:19 +00:00
Pedro F. Giffuni
8c5a59ee44 du(1): replace malloc + memset with calloc. 2015-02-17 21:12:45 +00:00
Dimitry Andric
714e3c812d Merge ^/head r278756 through r278915. 2015-02-17 19:53:41 +00:00
Jilles Tjoelker
d6b3ef634c compress,gzip,xz: Preserve timestamps with nanosecond precision. 2015-02-17 13:12:54 +00:00
Sergey Kandaurov
723ea6bc93 kdump: sendfile(2) "flags" argument needs casting on 64-bit platforms.
MFC after:	1 week
Sponsored by:	Nginx, Inc.
2015-02-16 17:19:28 +00:00
Jilles Tjoelker
51492908f9 touch: Fix some subtle bugs related to NULL times fallback:
* Do not subvert vfs.timestamp_precision by reading the time and passing
  that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times
  pointer is no longer used.

* Do not ignore -a/-m if the user has write access but does not own the
  file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to
  a NULL times pointer (which would set both timestamps) if that fails.

Reviewed by:	bde
2015-02-15 21:28:00 +00:00
Ed Maste
b0aa0c6e1b timeout: handle zombie grandchildren
timeout previously collected only one child status with wait(2). If this
was one of the grandchildren timeout would return to sigsuspend and wait
until the timeout expired. Instead, loop for all children.

PR:		kern/197608
Reviewed by:	bapt, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-02-15 20:10:53 +00:00
John Baldwin
bc411bc2d0 Include OBJT_PHYS VM objects in ELF core dumps. In particular this
includes the shared page allowing debuggers to use the signal trampoline
code to identify signal frames in core dumps.

Differential Revision:	https://reviews.freebsd.org/D1828
Reviewed by:	alc, kib
MFC after:	1 week
2015-02-14 17:12:31 +00:00
Dimitry Andric
44f7b0dcc5 Merge llvm 3.6.0rc3 from ^/vendor/llvm/dist, merge clang 3.6.0rc3 from
^/vendor/clang/dist, resolve conflicts, and update patches README.
2015-02-14 14:13:00 +00:00
Dimitry Andric
569e61a4fc Merge ^/head r278499 through r278755. 2015-02-14 13:12:03 +00:00
Baptiste Daroussin
5c5b28d0d7 Revert r278642
install(1) does not handle chflags on hardlinks
2015-02-13 09:02:15 +00:00
Baptiste Daroussin
e707eb9bc2 Partially revert 278642
On reinstall (overwrite) install(1) does not handle chflags

Reported by:	ian
2015-02-13 07:51:26 +00:00
Baptiste Daroussin
9f65be6caf Use PRECIOUSPROG instead of custom code to handle schg
This allows to preserve schg when installed with -DNO_ROOT

MFC after:	1 week
2015-02-12 23:08:27 +00:00
Colin Percival
11d9aa6707 Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive.  Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities.  I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by:	jmg
Discussed at:	EuroBSDCon
Approved by:	gjb (release-affecting changes)
2015-02-12 05:35:00 +00:00
Glen Barber
21c31ec174 Reduce number of lines to set ORGANIZATION_NAME in
freebsd-organization.h.

Patched by:	ian
PR:		197540
MFC after:	3 days
X-MFC-with:	r278603
Sponsored by:	The FreeBSD Foundation
2015-02-12 00:17:14 +00:00
Glen Barber
81e4e017b6 Ensure ORGANIZATION_NAME is quoted when ORGANIZATION
could contain strings of two or more words.

Reviewed by:	peter
Reported by:	karl@denninger.net
PR:		197540
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2015-02-11 22:59:24 +00:00
Marcel Moolenaar
399d34850f Close the file list before opening the container that holds the
totals, otherwise we end up emitting invalid JSON -- provided
libxo does not prevent us from doing that.

PR:		197499
Submitted by:	allanjude@
2015-02-11 17:56:24 +00:00
Michael Gmelin
441ee032a3 Add xo_finish() to w.c in case it's invoked as uptime
Reviewed by:	marcel
Approved by:	marcel
Differential Revision: https://reviews.freebsd.org/D1821
2015-02-10 22:23:52 +00:00
Dimitry Andric
93466fc60f Merge ^/head r278351 through r278498. 2015-02-10 07:56:14 +00:00
Rui Paulo
532000256b Merge xz 5.2.0.
This brings support for multi-threaded compression.  This brings close
N times faster compression where N is the number of CPU cores.
Because of this, liblzma now depends on libthr.

Soon libarchive will be modified to use the new lzma API.

Thanks to antoine@ for the exp-run.

Differential Revision:	 https://reviews.freebsd.org/D1786
Reviewed by:	bapt
2015-02-09 06:20:34 +00:00
Ed Maste
9d984acfb7 Update FreeBSD LLDB build for 3.6 update
Sponsored by:	DARPA, AFRL
2015-02-08 17:26:41 +00:00
Alexander Motin
d5a6319ac7 Fix couple issues in ctlstat header printing.
MFC after:	1 week
2015-02-07 17:53:47 +00:00
Dimitry Andric
b40d827331 Merging ^/head r278298 through r278350. 2015-02-07 12:57:40 +00:00
John Baldwin
330c544318 Change ktrdump to use the more standard -M/-N flags to specify the path
to a crash dump and kernel, respectively.  The existing -m/-e flags are
still supported for backwards compatiblity but are no longer documented.

Requested by:	np
MFC after:	2 weeks
2015-02-06 19:41:23 +00:00
Dimitry Andric
bd9cc051b3 Merging ^/head r278224 through r278297. 2015-02-05 22:34:29 +00:00
Edward Tomasz Napierala
82babffba9 Make it possible to set (via iscsi.conf(5)) and query (via iscsictl -v)
initiator iSCSI offload.  Pass maximum data segment size supported by
chosen offload module to iscsid(8), and make iscsid(8) not try to negotiate
anything larger than that.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-02-05 06:37:59 +00:00
Dimitry Andric
a403ab7f64 Merge ^/head r278110 through r278223. 2015-02-04 21:08:28 +00:00
Enji Cooper
c7b6816fa9 Add MK_FILE to control whether or not to build file(1), libmagic(3), etc
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-02-04 10:24:40 +00:00
Enji Cooper
11981695fc Add the following options to enable/disable several features in the base system
WITHOUT_BOOTPARAMD - bootparamd
WITHOUT_BOOTPD - bootpd
WITHOUT_FINGER - finger, fingerd
WITHOUT_FTP - ftp, ftpd
WITHOUT_INETD - inetd
WITHOUT_RBOOTD - rbootd
WITHOUT_TCP_WRAPPERS - tcpd, et al
WITHOUT_TFTP - tftp, tftp-server
WITHOUT_TIMED - timed

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-02-04 10:19:32 +00:00
Dimitry Andric
f72f83dcae Merge ^/head r277902 through r277944. 2015-01-30 18:34:56 +00:00
Enji Cooper
b7c2ba84c9 Create MANLINKS for lzgrep, etc when MK_LZMA_SUPPORT != no
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-01-30 18:07:46 +00:00
Dimitry Andric
6402890244 Merge ^/head r277804 through r277843. 2015-01-28 18:45:40 +00:00
Pedro F. Giffuni
76c76d54f8 sed: fix pasto from previous r277802.
MFC after:	3 days
2015-01-27 19:46:19 +00:00
Dimitry Andric
76f411ce48 Merging ^/head r277777 through r277803. 2015-01-27 19:40:08 +00:00
Pedro F. Giffuni
fc04dce059 Fix resource leak and dereference after NULL.
process.c:
Protect access against NULL.

main.c:
Prevent outfile overwrite resource leak.

CID:	271181
CID:	1006930

Obtained from:	NetBSD
MFC after:	3 days
2015-01-27 18:58:24 +00:00
Dimitry Andric
1ae6788e51 Update llvm and clang library and binary Makefiles for 3.6.0 rc1. 2015-01-26 18:48:27 +00:00
Dag-Erling Smørgrav
4ac1e0a9fc Allow tracing dlfunc() / dlsym() events.
MFC after:	1 week
2015-01-25 12:11:50 +00:00
Enji Cooper
3f802165ba Add MK_TALK knob for building the talk and talkd
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-01-25 04:37:44 +00:00
Enji Cooper
b29d6977f3 Add MK_ISCSI knob for building the iscsi initiator, iscsi daemon, kernel
modules, etc

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-01-25 04:20:11 +00:00
Enji Cooper
79a86dafb7 Add MK_EE knob to control installing edit, ee, etc
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-01-25 00:03:44 +00:00
Jilles Tjoelker
5faf2ae160 cp,mv,touch: Set timestamps with nanosecond precision.
This uses utimensat().
2015-01-24 13:50:13 +00:00
Jilles Tjoelker
2205e0d1bd Add futimens and utimensat system calls.
The core kernel part is patch file utimes.2008.4.diff from
pluknet@FreeBSD.org. I updated the code for API changes, added the manual
page and added compatibility code for old kernels. There is also audit and
Capsicum support.

A new UTIME_* constant might allow setting birthtimes in future.

Differential Revision:	https://reviews.freebsd.org/D1426
Submitted by:	pluknet (partially)
Reviewed by:	delphij, pluknet, rwatson
Relnotes:	yes
2015-01-23 21:07:08 +00:00
Will Andrews
d0fde85e65 Use clock_gettime to measure the time that we spent asleep during
"vmstat -i" instead of assuming it's what we asked for.

Submitted by:	asomers
MFC after:	1 week
Sponsored by:	Spectra Logic
MFSpectraBSD:	1066751 on 2014/06/04
2015-01-23 16:21:31 +00:00
Will Andrews
157b158ea9 Use CLOCK_UPTIME to get the uptime instead of CLOCK_MONOTONIC.
Submitted by:	asomers
MFC after:	1 week
Sponsored by:	Spectra Logic
MFSpectraBSD:	1066740 on 2014/06/04
2015-01-23 16:18:39 +00:00
Will Andrews
961a5dae5c Make "vmstat -i" respect the -c <count> and -i <interval> options together.
Submitted by:	asomers
MFC after:	1 week
Sponsored by:	Spectra Logic
MFSpectraBSD:	1066735 on 2014/06/04
2015-01-23 16:15:55 +00:00
Xin LI
a5e43ff69e Fix xz handling for files larger than 32K.
Submitted by:	Stefan Ehmann <shoesoft gmx net>
PR:		bin/186861
MFC after:	2 weeks
2015-01-21 01:11:37 +00:00
Will Andrews
7a37b5fc17 Add a ${CP} alias for copying files in the build.
Some users build FreeBSD as non-root in Perforce workspaces.  By default,
Perforce sets files read-only unless they're explicitly being edited.
As a result, the -f argument must be used to cp in order to override the
read-only flag when copying source files to object directories.  Bare use of
'cp' should be avoided in the future.

Update all current users of 'cp' in the src tree.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	Spectra Logic
2015-01-16 21:39:08 +00:00
Justin Hibbits
b5d4909ec3 Make use of the new Altivec ptrace support, to save the Altivec registers in
gcore.

MFC after:	2 weeks
Relnotes:	yes
2015-01-14 07:02:21 +00:00
Pedro F. Giffuni
a161398ab8 Replace __inline GNUism with the standard inline.
MFC after:	1 week
2015-01-13 00:04:22 +00:00
Dimitry Andric
c369979c46 Add the llvm-symbolizer tool, which enables the sanitizers to report
more complete debugging information.  This tools is only enabled when
WITH_CLANG_EXTRAS is on.

Submitted by:	Dan McGregor <danismostlikely@gmail.com>
2015-01-10 22:22:42 +00:00
Dimitry Andric
f91be99b1f Remove a few redundant DPADD/LDADD pairs in llvm utilities. 2015-01-10 22:11:49 +00:00
Dimitry Andric
559f16f0dd Regenerate the manpages for the additional llvm/clang tools. This
contains only very minor updates.
2015-01-10 21:44:31 +00:00
Jeremie Le Hen
98648ee85e Add a regression test for PR 192108.
I won't go through the hassle of MFCing it since I expect all changes to go
first through HEAD anyway.

PR:		192108
2015-01-10 10:16:22 +00:00
Ed Maste
8fb02d8847 mkimg: Add MBR EFI partition type
Sponsored by:	The FreeBSD Foundation
2015-01-09 19:34:48 +00:00
John Baldwin
e275993995 Document CPU_WHICH_DOMAIN and bump Dd for cpuset.1.
Missed in:	r276829
2015-01-08 18:53:11 +00:00
Pedro F. Giffuni
bfffbac603 Partial revert of r276832:
Do not bump the warns level as it still breaks the gcc build on sparc64

Reported by:	jenkins
2015-01-08 17:23:59 +00:00
Pedro F. Giffuni
707c9cc5d1 sed: Address warnings with clang and gcc48.
MFC after:	2 weeks
2015-01-08 16:33:15 +00:00
John Baldwin
c0ae66888b Create a cpuset mask for each NUMA domain that is available in the
kernel via the global cpuset_domain[] array. To export these to userland,
add a CPU_WHICH_DOMAIN level that can be used to fetch the mask for a
specific domain. Add a -d flag to cpuset(1) that can be used to fetch
the mask for a given domain.

Differential Revision:	https://reviews.freebsd.org/D1232
Submitted by:	jeff (kernel bits)
Reviewed by:	adrian, jeff
2015-01-08 15:53:13 +00:00
Dimitry Andric
47a80b9264 Add the AArch64 llvm backend to the build to allow for early testing and
to ease any rework of how clang is built to take arm64 in to account.

Submitted by:	andrew
Reviewed by:	andrew, emaste
Differential Revision: https://reviews.freebsd.org/D1446
2015-01-07 19:06:27 +00:00
Ed Maste
63bf16a1c4 ar: Avoid null pointer deref while reading corrupt archives
ELF Tool Chain ticket #467

Reported by:	Alexander Cherepanov <cherepan@mccme.ru>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-01-07 01:51:02 +00:00
Baptiste Daroussin
ff7c6d42f3 Use the new process reaper functionality
When not using the --foreground option timeout(1) is supported to signal all
command children hierarchy, timeout(1) now acquire the reaper to ensure this
really happens and no children process can escaper from timeout(1) control
2015-01-06 23:40:39 +00:00
Dmitry Chagin
78ec874dd3 kdump: eliminate new clang warnings.
MFC after:	1 week
2015-01-06 18:53:09 +00:00
Joel Dahl
385385fb1c mdoc: use An macro. 2015-01-04 12:42:08 +00:00
Baptiste Daroussin
0489fbcd33 Only manpages with fatal errors should be rendered by groff(1) 2015-01-03 23:39:44 +00:00
Ed Maste
2432082836 Add Makefile for elftoolchain readelf(1)
Sponsored by:	The FreeBSD Foundation
2015-01-02 22:26:54 +00:00
Dimitry Andric
ccd2f3b61a Merge ^/head r274961 through r276472. 2014-12-31 16:50:46 +00:00
Pedro F. Giffuni
f718bedc4f Fixes to exit status.
Exit with EXIT_FAILURE for invalid arguments.
Fixes NetBSD-PR 43517.

Print version string to stdout instead of stderr;
it is user-requested and not an error.

Obtained from:	NetBSD
MFC after:	5 days
2014-12-31 16:30:33 +00:00
Dimitry Andric
3ed527f1b5 Merge ^/head r274961 through r276418. 2014-12-30 20:23:03 +00:00
Joel Dahl
f7e00d4bbd mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
Dimitry Andric
8007ee2b0c Merge ^/head r274961 through r276301. 2014-12-27 14:58:52 +00:00
Joel Dahl
914f6e6290 mdoc: sort SEE ALSO. 2014-12-26 21:56:23 +00:00
Baptiste Daroussin
fd83961f72 mandoc -Tlocale is now the default, no need to enforce it anymore 2014-12-25 22:04:16 +00:00
Baptiste Daroussin
47ed86a875 Update mandoc to 1.13.2 2014-12-25 21:56:56 +00:00
Pedro F. Giffuni
547e0acbec patch: Bring in xstrdup and use it when appropriate.
The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in.  In many cases, NULL
value is not properly handled, so use xstrdup here (it's outside Plan A/B
patching, which means that even Plan B relies on successful operations).

Clean up some whitespaces while here

Obtained from:	OpenBSD
MFC after:	2 weeks
2014-12-25 21:51:28 +00:00
Xin LI
bf855dd342 Sync with NetBSD, mainly address NetBSD bug #43355:
Fix valid_format() to be more careful about allowing only valid
printf formats.

Obtained from:	NetBSD
MFC after:	2 weeks
2014-12-18 20:23:19 +00:00
Dimitry Andric
e65720e1ac Merge ^/head r275759 through r275911. 2014-12-18 18:44:22 +00:00
Gleb Kurtsou
9b33705411 Adjust printf format specifiers for dev_t and ino_t in user space.
ino_t and dev_t are about to become uint64_t.

Reviewed by:	kib, mckusick
2014-12-17 07:10:48 +00:00
Pedro F. Giffuni
a34b42e43c sed: Bounds check the file path used in the 'w' command.
Modified version of a diff from Sebastien Marie to prevent a crash found
with the afl fuzzer.

Obtained from:	OpenBSD (CVS Rev. 1.37)
MFC after:	1 week
2014-12-16 20:26:11 +00:00
Dimitry Andric
be281d7007 Merge ^/head r275715 through r275748. 2014-12-13 19:45:18 +00:00
Marcel Moolenaar
0f49f14626 The size of the first level reference count table is given in terms of the
number of clusters it occupies. It's not the number of entries in the table,
as it is for the L1 cluster table.

For small images, the two are the same. With the unit tests based on small
images, this change has therefore no effect on the unit test.  For larger
images (like the FreeBSD 10.1-RELEASE image), this gives a discrepancy that
actually shows up when running "qemu-img check".

Bump the version number of mkimg.

While here, fix a white-space bug.

MFC after: 1 week
2014-12-12 06:13:31 +00:00
Dimitry Andric
d7e0694a59 Merge ^/head r275478 through r275622. 2014-12-08 19:56:34 +00:00
Pedro F. Giffuni
d3fc0cb884 patch(1): avoid line number overflows
Introduce strtolinenum to properly check line numbers while parsing:
no signs, no spaces, just digits, 0 <= x <= LONG_MAX

Properly validate line ranges supplied in diff file to prevent overflows.
Also fixes an out of boundary memory access because the resulting values
are used as array indices.

PR:	195436
Obtained from:	OpenBSD (CVS pch.c rev 1.45, 1,46, common.h rev 1.28)
MFC after:	1 week
2014-12-08 15:10:48 +00:00
Pedro F. Giffuni
2b468ebac3 Small space changes
Mostly to keep in sync with OpenBSD and update the TAG.

Obtained from:	OpenBSD
MFC after:	5 days
2014-12-07 20:32:24 +00:00
Pedro F. Giffuni
ab761cdbfa Prefer setvbuf() to setlinebuf().
On FreeBSD's libc setlinebuf is a wrapper to setvbuf anyways.

Obtained from:	OpenBSD
MFC after:	5 days
2014-12-07 20:15:07 +00:00
Pedro F. Giffuni
e91a64de38 Merge fixes from OpenBSD.
Check fstat return value.  Also, use off_t for file size and offsets.
Avoid iterating over end of string.

Obtained from:	OpenBSD (CVS rev. 1.41, 1.43)
MFC after:	1 week
2014-12-06 01:21:12 +00:00
Pedro F. Giffuni
dbfbf4a8af Update OpenBSD CVS revision for our r255232.
This is a no-op to make it easier to track changes from OpenBSD

MFC after:	3 days
2014-12-05 23:08:39 +00:00
Edward Tomasz Napierala
de29f585af Move iscsi.conf.5 from sbin/iscontrol/ to usr.bin/iscsictl/, as the
former is obsolete.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-12-05 12:38:01 +00:00
Dimitry Andric
24ce0a02e5 Merge ^/head r275387 through r275477. 2014-12-04 17:38:32 +00:00
Baptiste Daroussin
1fb816da82 Update to mandoc cvs version as of 20141201
- Compatiblity with existing manpages has been improved
- Now support ".so" directive with compressed manpages (which fixes a regression
we have since we have new man(1))
2014-12-02 23:24:57 +00:00
Dimitry Andric
2383695dc3 Merge ^/head r274961 through r275386. 2014-12-02 01:45:04 +00:00
Ed Maste
3194293903 Build infrastructure for elftoolchain tools
Set WITH_ELFTOOLCHAIN_TOOLS in src.conf to use the elftoolchain version
of the following tools:

 * addr2line
 * elfcopy (strip / mcs)
 * nm
 * size
 * strings

Reviewed by:	bapt (earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1224
2014-12-01 17:49:42 +00:00
Dimitry Andric
60c317af72 Merge ^/head r275262 through r275363. 2014-12-01 13:14:39 +00:00
Gleb Smirnoff
0f9d0a73a4 Merge from projects/sendfile:
o Introduce a notion of "not ready" mbufs in socket buffers.  These
mbufs are now being populated by some I/O in background and are
referenced outside.  This forces following implications:
- An mbuf which is "not ready" can't be taken out of the buffer.
- An mbuf that is behind a "not ready" in the queue neither.
- If sockbet buffer is flushed, then "not ready" mbufs shouln't be
  freed.

o In struct sockbuf the sb_cc field is split into sb_ccc and sb_acc.
  The sb_ccc stands for ""claimed character count", or "committed
  character count".  And the sb_acc is "available character count".
  Consumers of socket buffer API shouldn't already access them directly,
  but use sbused() and sbavail() respectively.
o Not ready mbufs are marked with M_NOTREADY, and ready but blocked ones
  with M_BLOCKED.
o New field sb_fnrdy points to the first not ready mbuf, to avoid linear
  search.
o New function sbready() is provided to activate certain amount of mbufs
  in a socket buffer.

A special note on SCTP:
  SCTP has its own sockbufs.  Unfortunately, FreeBSD stack doesn't yet
allow protocol specific sockbufs.  Thus, SCTP does some hacks to make
itself compatible with FreeBSD: it manages sockbufs on its own, but keeps
sb_cc updated to inform the stack of amount of data in them.  The new
notion of "not ready" data isn't supported by SCTP.  Instead, only a
mechanical substitute is done: s/sb_cc/sb_ccc/.
  A proper solution would be to take away struct sockbuf from struct
socket and allow protocols to implement their own socket buffers, like
SCTP already does.  This was discussed with rrs@.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-11-30 12:52:33 +00:00
Dimitry Andric
980e47cff3 Merge ^/head r274961 through r275261. 2014-11-29 18:44:52 +00:00
Enji Cooper
391343f4a2 MF projects/building-blocks r275198:
Use ${.TARGET} instead of hardcoding the name in the dump build rule
2014-11-29 06:53:06 +00:00
Dimitry Andric
344e0332fb Merge ^/head r275118 through r275209. 2014-11-28 13:25:57 +00:00
Enji Cooper
2d561fcbcf Use ${.TARGET} instead of hardcoding the name in the dump build rule 2014-11-27 23:42:32 +00:00
Kevin Lo
8bc29bb269 Init array field in the proper place.
Obtained from:	OpenBSD
2014-11-27 01:37:01 +00:00
Ed Maste
1a559761c7 Update build for LLDB snapshot at upstream rev 216948
Sponsored by:	DARPA, AFRL
2014-11-26 17:40:03 +00:00
Dimitry Andric
1181e9f8a2 After some horrible wrestling with Subversion's worthless merge
implementation, merge ^/head r275078 through r275117.

Note that all the extraneous mergeinfo is there because Subversion
created it.  I'll hopefully be able to remove it again when merging back
to head.
2014-11-26 14:36:04 +00:00
Enji Cooper
466046ec0d Conditionalize a number of components in the tree
- bootparamd
- bootpd
- finger/fingerd
- ftp/ftpd
- hastctl/hastd
- iscsid, et al
- rbootd
- talk/talkd
- tcpd, et al
- tftp/tftpd

Add src.conf entries for the various components and do a best effort
at adding components to tools/build/mk/OptionalObsoleteFiles.inc
2014-11-26 08:44:05 +00:00
Baptiste Daroussin
9c141de192 Convert svn to LIBADD reduce overlinking 2014-11-25 21:43:51 +00:00
Dimitry Andric
2c97f721e7 r274961 through r275075 2014-11-25 21:43:01 +00:00
Baptiste Daroussin
9215669c36 Readd protect(2) removed by mistake
Reported by:	emaste
2014-11-25 14:40:38 +00:00
Baptiste Daroussin
3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Baptiste Daroussin
39cffbbf4a Forgot to convert demandoc along with mandoc 2014-11-24 23:29:56 +00:00
Baptiste Daroussin
ebadd13c08 Convert mandoc to LIBADD
While here remove the ugly LDMANDOC
2014-11-24 22:12:27 +00:00
Dimitry Andric
046ffce1c3 Update llvm and clang binary Makefiles. 2014-11-24 19:47:59 +00:00
Christian Brueffer
9efc7e72bb Limit descriptors and enter capability mode.
Differential:	D1009
Reviewed by:	jonathan, pjd
MFC after:	2 weeks
Relnotes:	yes
2014-11-24 09:31:38 +00:00
Baptiste Daroussin
15eb6e34a6 Workaround help2man defficiency that prevents mandoc from rendering 2014-11-23 23:17:18 +00:00
Baptiste Daroussin
b8d52ac37c Install mdoc(7) and man(7) from mdoc instead of the one from groff 2014-11-23 22:28:46 +00:00
Baptiste Daroussin
b156563c0c Regenerate the manpage in mdoc(7) format using pod2mdoc
Now mandoc can render the manpage properly
2014-11-23 22:16:43 +00:00
Joel Dahl
d4d112e34a Misc mdoc fixes:
- Remove superfluous paragraph macros.
- Remove/fix empty or incorrect macros.
- Sort sections into conventional order.
- Terminate quoted strings properly.
- Remove EOL whitespace.
2014-11-23 21:00:00 +00:00
Baptiste Daroussin
b43edc06e6 Fix comments 2014-11-23 00:30:32 +00:00
Baptiste Daroussin
f17575acc9 Fix typo 2014-11-23 00:08:43 +00:00
Baptiste Daroussin
d6096801f1 Change man(1) to use mandoc to render manpages
man(1) now first test the manpage to run with mandoc to make sure it can be
rendered.
In case groff cannot be found (because base has been built WITHOUT_GROFF) it
recommands to install groff from the packages
2014-11-23 00:08:04 +00:00
Baptiste Daroussin
c3e5ebe1fc Lower warnings to fix build with gcc 2014-11-22 22:13:00 +00:00
Baptiste Daroussin
71bcdff764 Lower warning to allow building with gcc 2014-11-22 22:11:35 +00:00
Baptiste Daroussin
2421b90f47 Add the demandoc utility from the mandoc project
This is a modern version of the deroff utility, useful for example to do
spellchecking on manpages
2014-11-22 21:11:17 +00:00
Baptiste Daroussin
4357ec0f20 Add the preconv utility from mandoc project
it recodes multibyte UNIX manual files into mandoc(1)
2014-11-22 20:55:36 +00:00
Baptiste Daroussin
6cfe9d90da Rework mandoc Makefile to ease maintainance
Add compat_reallocarray into libmandoc given other mandoc components will use
it.
2014-11-22 20:48:21 +00:00
Baptiste Daroussin
362492e53e Promote SQLite3 as a privatelib as it will also be used by mandoc
While here ensure sqlite3 is using pread(2) and enable the suppot for FTS4
2014-11-22 19:44:49 +00:00
Baptiste Daroussin
d08b6add14 Add missing dependencies on pthread (sqlite being built with threadsafety on) 2014-11-22 19:17:05 +00:00
Baptiste Daroussin
6653664b44 Update mandoc to 1.13.1 2014-11-22 18:57:23 +00:00
Ian Lepore
dbd3f10702 Add libm to eliminate "undefined reference to sqrt" on arm 'softfp' builds. 2014-11-22 14:53:50 +00:00
Dimitry Andric
0c4bf57982 Fix the following -Werror warnings from clang 3.5.0, while building
usr.bin/locate:

usr.bin/locate/locate/util.c:249:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^
usr.bin/locate/locate/util.c:249:29: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^~~
usr.bin/locate/locate/util.c:274:32: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^
usr.bin/locate/locate/util.c:274:32: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^~~

The problem is that ntohl() always returns an unsigned quantity.  In
this case, it's expected to be cast back to a signed integer, but to
stop complaints about abs() we just store it into an integer, and don't
call ntohl() again.

Reviewed by:	ngie
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1196
2014-11-22 12:13:05 +00:00
Baptiste Daroussin
c501e7de0a Revert accidently message Makefile from 274836 and connect soeliminate(1) 2014-11-22 01:27:45 +00:00
Baptiste Daroussin
68d12e1fae Add a new soeliminate(1) command
mandoc(1) does not provide an equivalent of the GNU groff's soelim(1) as an
external binary. It does provide the funcitonnality but internally.

Lots if manpages in ports uses ".so" directives to include the content of
another manpage, which works properly if the manpages are not compressed.
With compressed manpages it will fail. So we need to preprocess those manpages
with soelim(1) before compressing them.

soeliminate(1) add the minimum functionnality from soelim(1) required for that
task, in order to still be able to prepare properly those manpages in case we
ship the base system only with mandoc as a manpage renderer.

soeliminate(1) accept all the arguments from soelim(1) for compatibility but
only '-I dir' is really functionnal.

Name it soeliminate and not soelim, so groff from base or ports can still call
soelim(1) for its internal use and avoid potential incompatibilities

MFC after:	1 month
2014-11-22 01:22:03 +00:00
John Baldwin
180e57e5c7 Improve support for XSAVE with debuggers.
- Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed
  to match what Linux does in that 1) it dumps the entire XSAVE area
  including the fxsave state, and 2) it stashes a copy of the current
  xsave mask in the unused padding between the fxsave state and the
  xstate header at the same location used by Linux.
- Teach readelf() to recognize NT_X86_XSTATE notes.
- Change PT_GET/SETXSTATE to take the entire XSAVE state instead of
  only the extra portion. This avoids having to always make two
  ptrace() calls to get or set the full XSAVE state.
- Add a PT_GET_XSTATE_INFO which returns the length of the current
  XSTATE save area (so the size of the buffer needed for PT_GETXSTATE)
  and the current XSAVE mask (%xcr0).

Differential Revision:	https://reviews.freebsd.org/D1193
Reviewed by:	kib
MFC after:	2 weeks
2014-11-21 20:53:17 +00:00
Edward Tomasz Napierala
aca4343c62 Fix improper .Fx macro usage.
Differential Revision:	https://reviews.freebsd.org/D1158
Reviewed by:	wblock@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-19 18:19:21 +00:00
Simon J. Gerraty
488c975a1f Updated/new dependencies 2014-11-19 07:10:38 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Sean Bruno
e4684c7895 Change LDFLAGS to LDADD in order to allow static builds. This is more
proper way to ensure that the command line compile works the way we intend.

Add explicity DPADD statemens on LIBMD and LIBPTHREAD depending on which
options are used in the build.

Reviewed by:	andrew
MFC after:	2 weeks
2014-11-15 18:03:38 +00:00
Edward Tomasz Napierala
c7ee47a779 Make it possible to do "iscsictl -Rt xxx -p yyy", to remove a session
that matches both -t and -p.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-15 06:14:38 +00:00
Edward Tomasz Napierala
65dd075b31 Add missing commas to .Xr.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-14 08:58:06 +00:00
Jung-uk Kim
468bac7080 Increase MAXTABLE to the maxmimum possible value. The default value is too
low for complex parsers.  Note it was one of those memory optimization hacks
back in the day.

MFC after:	1 week
2014-11-13 00:46:53 +00:00
Marcel Moolenaar
9ba57342c9 SEEK_DATA has interesting behaviour for sparse files on ZFS. A sparse file
with 128K of random data and truncated to 800K can have SEEK_DATA return -1
when given an offset of 128K. On UFS, the SEEK_DATA returns 800K (the size
of the file). SEEK_HOLE on ZFS seems to behave the same as UFS.

To handle this, map -1 to the size of the file (`end') when lseek returns
this for either SEEK_HOLE or SEEK_DATA. When sparse files are not supported
by the file system both `hole' and `data' will now be equal to `end' and we
will treat the entire file as data. This way, the -1 return for SEEK_DATA
on ZFS will end up doing the right thing.

Reported by: gjb@

MFC after:	3 days
2014-11-12 00:10:27 +00:00
Marcel Moolenaar
bab0558297 Fix text output for the uptime command.
Reported by: "Max N. Boyarov" <zotrix@bsd.by>, ae@
2014-11-11 21:52:10 +00:00
Marcel Moolenaar
985c93f0b4 Fix a SIGSEGV when emitting XML or JSON when reading stdin. In that
case the file variable is NULL.
2014-11-07 01:36:20 +00:00
Devin Teske
7fc89952f1 Re-enable dpv(1,3): Introduced via r274116; temporarily disabled
shortly thereafter via r274124 until I could get the right recipe
down w/respect to SUBDIR_DEPEND.

Thanks to:      ngie, ian
Reviewed by:    ian
MFC after:      21 days
X-MFC-to:       stable/10 stable/9
X-MFC-with:     274116 274120 274121 274123 274144 274146
2014-11-06 19:28:01 +00:00
Marcel Moolenaar
c61e3115fe Separate references by a comma. 2014-11-06 16:19:21 +00:00
Marcel Moolenaar
a01ced3391 Sort the references in "SEE ALSO" by section first; then alphabetically.
Pointed out by: brueffer@
2014-11-06 16:17:41 +00:00
Marcel Moolenaar
d6112c71c6 Document that w(1) supports libxo(3). 2014-11-05 23:59:52 +00:00
Marcel Moolenaar
76c0abf129 Convert to use libxo.
Obtained from:  Phil Shafer <phil@juniper.net>
Sponsored by:   Juniper Networks, Inc.
2014-11-05 23:54:33 +00:00
Devin Teske
f5a6518ef3 Balance DPADD against LDADD for dpv(1,3).
Thanks to:	ngie
MFC after:	21 days
X-MFC-to:	stable/10 stable/9
X-MFC-with:	274116 274120 274121 274123 274144
2014-11-05 20:58:25 +00:00
Baptiste Daroussin
8b5f724857 ftp(1) uses nothing from libutil, do not link to it 2014-11-05 15:32:57 +00:00
Baptiste Daroussin
1deb311eeb id(1) only uses getaudit(2) from the BSM which is part of the libc 2014-11-05 15:03:58 +00:00
Baptiste Daroussin
1cb20e39c0 Nothing in iconv(1) uses symbols from libcrypt 2014-11-05 14:55:01 +00:00
Marcel Moolenaar
bf0df86979 Document that wc(1) supports libxo(3). 2014-11-05 04:09:10 +00:00
Marcel Moolenaar
6711c4827a Convert to use libxo.
Obtained from:	Phil Shafer <phil@juniper.net>
Sponsored by:	Juniper Networks, Inc.
2014-11-05 04:02:25 +00:00
Devin Teske
39341fd090 Temporarily _disable_ compilation of dpv(3) and dpv(1).
Will revisit this to find out how to solve the ordering
issue in buildworld (potentially `make -j' specific).

Reviewed by:	shurd
2014-11-05 02:58:02 +00:00
Devin Teske
e34274ae37 Fix buildworld by adding DPADD= to libdpv [dpv(3)] Makefile
NB: Should also address `make -j' building
Remove "+" from "+=" in assignments to DPADD/LDADD while here.
NB: Also move CFLAGS for style measure.

Reviewed by:	shurd
MFC after:	21 days
X-MFC-to:	stable/10 stable/9
X-MFC-with:	274116 274120 274121
2014-11-05 02:36:28 +00:00
Devin Teske
964b46aaea Fix build-error (pointy hat; didn't merge full up-to-date code)
MFC after:	21 days
X-MFC-to:	stable/10 stable/9
X-MFC-with:	274116
2014-11-05 01:47:25 +00:00
Devin Teske
041394f38a Add new libraries/utilities for data throughput visualization.
dpv(3): dialog progress view library
dpv(1): stream data from stdin or multiple paths with dialog progress view
figpar(3): configuration file parsing library

Reviews:	D714
Reviewed by:	jelischer, shurd
Discussed at:	MeetBSD California 2014 Vendor/Dev Summit
Discussed on:	-current
MFC after:	21 days
X-MFC-to:	stable/10 stable/9
2014-11-04 23:46:01 +00:00
John-Mark Gurney
de9dd94772 fix spelling of offset since that is what is used in the body... 2014-10-30 06:54:25 +00:00
Jung-uk Kim
b666b03241 Replace a magic number with the proper definition. This change actually
fixes broken state field after r273266, i.e., "CPU-1" was displayed in place
of "RUN".
2014-10-29 19:21:19 +00:00
Edward Tomasz Napierala
1cb587dc9c Fix iscsictl(8) and ctld(8) to correctly handle Windows newlines
(CRLF) in iscsi.conf and ctl.conf.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-10-29 12:22:32 +00:00
Baptiste Daroussin
1c1c418e52 Add regression tests for the timeout(1) utility
They are modeled over the regression tests that are provided for the GNU
coreutils timeout(1) utility
2014-10-28 10:39:41 +00:00
Baptiste Daroussin
54c2e46443 Improve compatibility with GNU timeout
According to the coreutils regression testsuite for timeout(1)
It is expect to exit with a status being:
125 in case an invalid duration or signal is passed in arguments
126 in case an invalid command is passed in arguments
127 in case the command passed in arguments does not exists.

While here document this behaviour in the man page
2014-10-28 10:33:31 +00:00
Kirk McKusick
24244db06b Replace update from -r271410 accidentally lost in -r273575. 2014-10-26 20:48:26 +00:00
John Baldwin
53e1ffbbce The current POSIX semaphore implementation stores the _has_waiters flag
in a separate word from the _count.  This does not permit both items to
be updated atomically in a portable manner.  As a result, sem_post()
must always perform a system call to safely clear _has_waiters.

This change removes the _has_waiters field and instead uses the high bit
of _count as the _has_waiters flag.  A new umtx object type (_usem2) and
two new umtx operations are added (SEM_WAIT2 and SEM_WAKE2) to implement
these semantics.  The older operations are still supported under the
COMPAT_FREEBSD9/10 options.  The POSIX semaphore API in libc has
been updated to use the new implementation.  Note that the new
implementation is not compatible with the previous implementation.
However, this only affects static binaries (which cannot be helped by
symbol versioning).  Binaries using a dynamic libc will continue to work
fine.  SEM_MAGIC has been bumped so that mismatched binaries will error
rather than corrupting a shared semaphore.  In addition, a padding field
has been added to sem_t so that it remains the same size.

Differential Revision:	https://reviews.freebsd.org/D961
Reported by:	adrian
Reviewed by:	kib, jilles (earlier version)
Sponsored by:	Norse
2014-10-24 20:02:44 +00:00
Kirk McKusick
bcc63e8586 Fix formatting of vmstat (1) so that it looks cleaner on standard 80
column displays. In particular it wraps far less often.

Submitted by: Andy Kosela <akosela@andykosela.com>
PR:           191976
2014-10-24 04:01:14 +00:00
Marcel Moolenaar
41019211af Hook xo(1) to the build -- it's like echo, but uses libxo to
support emitting machine-readable output.

Sponsored by:	Juniper Networks, Inc.
2014-10-23 23:16:21 +00:00
Maksim Yevmenkin
dc7b26971d Change the code to use the openpty(3) API which uses the pts(4) driver
instead of the pty(4) driver.

PR:		184597
Submitted by:	tobias.rehbein
MFC after:	2 weeks
2014-10-23 15:16:40 +00:00
Xin LI
060ea80ecb Sync with NetBSD.
MFC after:	2 weeks
2014-10-23 01:22:29 +00:00
Edward Tomasz Napierala
2bd282696a Whitespace fixes.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-10-22 09:17:17 +00:00
John Baldwin
5817298f31 Retire the unimplemented MAP_RENAME and MAP_NORESERVE flags to mmap(2).
Older binaries are still permitted to use these flags.

PR:		193961 (exp-run in ports)
Differential Revision:	https://reviews.freebsd.org/D848
Reviewed by:	kib
2014-10-18 12:28:51 +00:00
John-Mark Gurney
7e2c0c79fa Fix to col when printing half-line feeds w/ -f option...
Message-Id on openbsd-tech: 20141017195810.GJ132@iris.usta.de
Submitted by:	Ingo Schwarze
Obtained from:	OpenBSD
MFC after:	3 days
2014-10-17 21:09:03 +00:00
John Baldwin
fdb5bf37fa Decode the arguments passed to _umtx_op(). In particular, decode the
opcode.

MFC after:	1 week
Sponsored by:	Norse
2014-10-13 16:37:06 +00:00
John Baldwin
bb1a2d4aa2 Fix most of the warnings in kdump(1).
Sponsored by:	Norse
2014-10-13 16:17:42 +00:00
Enji Cooper
cdfd89cea1 Integrate usr.bin/gzip/tests from NetBSD into atf/kyua
Sponsored by: EMC / Isilon Storage Division
2014-10-09 02:24:34 +00:00
Enji Cooper
1e7075e0a4 Integrate usr.bin/grep/tests from NetBSD into atf/kyua
Sponsored by: EMC / Isilon Storage Division
2014-10-09 01:53:23 +00:00
Enji Cooper
48e0fbc3f9 Integrate usr.bin/cut/tests from NetBSD into atf/kyua
Sponsored by: EMC / Isilon Storage Division
2014-10-09 01:46:31 +00:00
Enji Cooper
17313006a0 Integrate usr.bin/dirname/tests from NetBSD into atf/kyua
In collaboration with: pho, sjg
Sponsored by: EMC / Isilon Storage Division
2014-10-09 00:55:04 +00:00
Enji Cooper
0306a0a804 Integrate usr.bin/cmp/tests from NetBSD into atf/kyua
In collaboration with: sjg
Sponsored by: EMC / Isilon Storage Division
2014-10-09 00:50:33 +00:00
Enji Cooper
0be0d5f339 Integrate usr.sbin/basename/tests from NetBSD into atf/kyua
In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-09 00:41:42 +00:00
Ed Maste
599df3ef01 Correct scale factor for T terabyte suffix
PR:		194250
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2014-10-08 17:40:58 +00:00
Eitan Adler
920aa23dad don't reinvent the wheel: rely on basename(3)
Reviewed by:	nwhitehorn
2014-10-08 05:04:31 +00:00
Marcel Moolenaar
ea6d9dfc53 Update baseline files for EBR, MBR and PC98 now that mkimg fills in
the CHS fields appropriately when -T and -H are given on the command
line.
2014-10-03 20:54:35 +00:00
Marcel Moolenaar
2c83b36f45 Add mkimg_chs() for those schemes that need the LBA broken down into
cylinder, head and track numbers. Return ~0U for these values when
mkimg wasn't given both -T and -H (i.e. no geometry) or the cylinder
would be larger than the provided maximum.

Use mkimgs_chs() for the EBR, MBR and PC98 schemes to fill in the
appropriate fields. Make sure to use a "rounded" size so that the
partition is always a multiple of the track size. We reserved the
room for it in the metadata callback so that's a valid thing to
do.

Bump the mkimg version number.
While doing that again: have mkimg.o depend on the Makefile so that
a version change triggers a rebuild as needed.
2014-10-03 20:48:11 +00:00
Baptiste Daroussin
3e16491d77 Make sure to not skip any argument when converting from deprecated
+POS1, -POS2 to -kPOS1,POS2, so that sort +0n gets translated to sort -k1,1n
as it is expected

PR:		193994
Submitted by:	rodrigo
MFC after:	3 days
2014-10-02 06:29:49 +00:00
Marcel Moolenaar
852a0932c1 Improve performance of mking(1) by keeping a list of "chunks" in memory,
that keeps track of a particular region of the image. In particular the
image_data() function needs to return to the caller whether a region
contains data or is all zeroes. This required reading the region from
the temporary file and comparing the bytes. When image_data() is used
multiple times for the same region, this will get painful fast.

With a chunk describing a region of the image, we now also have a way
to refer to the image provided on the command line. This means we don't
need to copy the image into a temporary file. We just keep track of the
file descriptor and offset within the source file on a per-chunk basis.

For streams (pipes, sockets, fifos, etc) we now use the temporary file
as a swap file. We read from the input file and create a chunk of type
"zeroes" for each sequence of zeroes that's a multiple of the sector
size. Otherwise, we allocte from the swap file, mmap(2) it, read into
the mmap(2)'d memory and create a chunk representing data.

For regular files, we use SEEK_HOLE and SEEK_DATA to handle sparse files
eficiently and create a chunk of type zeroes for holes and a chunk of
type data for data regions. For data regions, we still compare the bytes
we read to handle differences between a file system's block size and our
sector size.

After reading all files, image_write() is used by schemes to scribble in
the reserved sectors. Since this never amounts to much, keep this data
in memory in chunks of exactly 1 sector.

The output image is created by looking using the chunk list to find the
data and write it out to the output file. For chunks of type "zeroes"
we prefer to seek, but fall back to writing zeroes to handle pipes.
For chunks of type "file" and "memoty" we simply write.

The net effect of this is that for reasonably large images the execution
time drops from 1-2 minutes to 10-20 seconds. A typical speedup is about
5 to 8 times, depending on partition sizes, output format whether in
input files are sparse or not.

Bump version to 20141001.
2014-10-01 21:03:17 +00:00
Marcel Moolenaar
ba7bccb366 Suffix the cookie constants with ULL to silence warnings from compilers
that try to treat them as 32-bit values.
2014-10-01 20:37:15 +00:00
Xin LI
934a6c2732 Sigh, remove a line that needs to be removed along with previous commit.
Submitted by:	mjg
MFC after:	3 days
X-MFC-with:	272288
2014-09-29 21:54:46 +00:00
Xin LI
da9c3bbbee When setting environment variables in the atrun script, use the
"export foo=bar" form instead of "foo=bar; export foo" since the
former allows the shell to catch variable names that are not valid
shell identifiers.  This will cause /bin/sh to exit with an error
(which gets mailed to the at user) and it will not run the script.

Obtained from:	OpenBSD (r1.63 millert)
MFC after:	3 days
2014-09-29 21:45:57 +00:00
Ryan Stone
9daa89f3bb Fix integer truncation in affecting systat -ifstat
The "systat -ifstat" command was using a u_int to store byte counters.
With a 10Gbps or faster interface, this overflows within the default
5 second refresh period.  Switch to using a uint64_t across the board,
which matches the size used for all counters as of r263102.

PR:		182448
MFC after:	1 week
Sponsored by:	Sandvine Inc
2014-09-29 17:38:50 +00:00
Marcel Moolenaar
fb2f6c6c66 Update the usage message and the man page to account for the new long
options. Bump the version number to 20140927.
While here, use explicit fputc() calls to skip a line in the output.
This to avoid having to hunt for extra '\n' characters in the printf
format strings.

MFC after:	1 week
Relnotes:	yes
2014-09-27 17:58:03 +00:00
Marcel Moolenaar
a53d83a210 Add 3 long options for getting information about mkimg itself:
--version	print the version of mkimg and also whether it's
		64- or 32-bit.
--formats	list the supported output formats separated by space.
--schemes	list the supported partitioning schemes separated by
		space.

Inspired by a patch from: gjb@

MFC after:	1 week
Relnotes:	yes
2014-09-27 04:53:51 +00:00
Allan Jude
b58e1deace Replace the macros used in the previous man(1) commit with literal text,
because the macros seem to be specific to groff, and do not render in
mandoc

Approved by:	bcr (mentor)
Sponsored by:	ScaleEngine Inc.
2014-09-26 11:48:29 +00:00
Allan Jude
84907ef05c Update man(1) to list the different sections of the manual
Add each of the intro sections to the 'Also See' list

PR:		193460
Differential Revision:	D834
Approved by:	bcr (mentor)
Sponsored by:	ScaleEngine Inc.
2014-09-25 21:34:57 +00:00
Pedro F. Giffuni
55a803b32a bsdgrep: Work-around for segmentation fault.
Fix by David Carlier.

Obtained from:	HardenedBSD
PR:		167921
MFC after:	1 month
2014-09-25 19:22:26 +00:00
Marcel Moolenaar
32e570e701 Add baseline files for QCOW2. 2014-09-24 22:58:10 +00:00
Marcel Moolenaar
e187064261 Finish QCOW version 2 and stop making it conditional.
We have a different ordering for the RC block(s) and L2 tables.
This is expected to be a non-issue, because everything is found
through file offsets in the corresponding RC table and L1 table.
Files that grow organically have RC blocks and L2 tables scattered
all over the place anyway.

The reason for the difference is that mkimg needs to be able to
write to a pipe. We can't seek forward and backward to fill in
the bits in non-sequential order.
2014-09-24 22:45:03 +00:00
Julien Charbon
cdcab7b62a Add myself (jch) to calendar.freebsd and committers-src.dot
Approved by:	jhb (mentor)
2014-09-24 22:31:40 +00:00
Marcel Moolenaar
88ff6ba840 Update the baseline for QCOW version 1. A bug was found that rendered
the baseline invalid.
2014-09-24 15:15:14 +00:00
Marcel Moolenaar
0e651cfe2e Fix the creation of the L2 cluster table for version 1. The blkofs
variable was assigned the image offset in bytes and not in blocks
(i.e. sectors). This had image_data() return FALSE, which meant that
we didn't assign a cluster when we needed and also meant that we
didn't write parts of the L2 table when we should have. The result
being that the actual data clusters were written at the wrong offset.

Improve support for QCOW version 2. We're having the right layout
and even know how many refcnt blocks we need. All we need to do is
populate the refcnt blocks for every cluster we write and allocate
a cluster when we need a new refcnt block. The allocation part is
tricky in that it'll interleave with the assignment of clusters to
L2 tables and data. Since version 2 is not quite done, keep it
compiled out for now.
2014-09-24 15:14:01 +00:00
Marcel Moolenaar
d60351df8f Clean the generated baseline files by adding them to CLEANFILES. 2014-09-24 04:17:29 +00:00
Mateusz Guzik
6e633f7297 install: re-check failed mkdir for EEXIST
Since the code stats and mkdirs in 2 separate steps, it is possible that
the directory will be created in the meantime by something else (e.g.
concurrent install).[1]

While here alter the code to properly report stat failure, previously it
would always claim it was mkdir which failed.

Noted by: royger [1]
MFC after:	1 week
2014-09-23 11:41:09 +00:00
Marcel Moolenaar
e286914f45 Rename the tests to something more meaningful. I spent way too long
trying to get the test name right, failed, gave up and used a sequence
number instead. When I realized it wasn't because of the number of
underscores in the name that I really started to think. I didn't have
braces around the variable names ...

Thus: test_1 is now called apm_1x1_512_qcow, which gives you all you
need to run mkimg by hand.

Dumb-ass: marcel
2014-09-22 16:52:09 +00:00
Marcel Moolenaar
66829acbb3 Don't update the baseline file when the result of the test is identical
to the baseline. Since we don't run gzip with the -n option, the output
of gzip varies for identical result files if and when they are created
at different time. Ouch...

Rather than add -n and commit a 600K+ diff for the changes to all the .uu
files, it's less of a churn to uudecode and gunzip the baseline file and
compare that to the new result file to determine if the baseline file
needs to be updated.

This way, "atf-sh mkimg.sh rebase" can be run as many times as people like
and a subsequent "svn status" will not show unnecessary diffs.
2014-09-22 16:37:37 +00:00
Marcel Moolenaar
c9b97e3bda Don't echo '# $FreeBSD$' as the first line into the .uu file. Keyword
substitution applies to this file, including the echo command. Avoid
the match (and substitution) by breaking the string up into 3 parts.
2014-09-22 15:27:23 +00:00
Marcel Moolenaar
572950ab03 Update the unit tests to include the QCOW (version 1) format.
This is a good safety net for when V2 is added.
2014-09-22 15:08:58 +00:00
Marcel Moolenaar
38501a4664 Add support for QCOW version 1. Version 2 is partially implemented.
And because of that, it's entirely disabled for now. Both versions
are similar enough that a single header definition works for both
of them. The only "diverting" side-effect is that the union of the
two is larger than the official V1 header.

What this means for our V1 support is that we can't put the L1 table
adjacent to the V1 header (i.e. at offset 0x30 in the file), unless
we revert to hackery and klugery. Let's not. Instead, we align the L1
table at the cluster boundary. This is in line with the V2 layout and
perfectly ok for V1 anyway (ok -- as far as I've seen so far).
Due to the alignment, our V1 image seems to be 1 cluster larger than
the V1 image created by qemu-img (on average).

Compression of the clusters is not supported at this time.

MFC after:	2 months
2014-09-22 15:05:28 +00:00
Marcel Moolenaar
cd0b4a3c40 Add unit tests for mkimg(1): 2014-09-20 21:02:54 +00:00
Marcel Moolenaar
53fcdb2d1a Fix partition alignment and image rounding when any of -P (block size),
-T (track size) or -H (number of heads) is given:
o   scheme_metadata() always rounded to the block size.  This is not
    always valid (e.g. vtoc8 that must have partitions start at cylinder
    boundaries).
o   The bsd and vtoc8 schemes "resized" the image to make it match the
    geometry, but since the geometry is an approximation and the size
    of the image computed from cylinders * heads * sectors is always
    smaller than the original image size, the partition information ran
    out of bounds.

The fix is to have scheme_metadata() simply pass it's arguments to the
per-scheme metadata callback, so that schemes not only know where the
metadata is to go, but also what the current block address is. It's now
up to the per-scheme callback to reserve room for metadata and to make
sure alignment and rounding is applied.

The BSD scheme now has the most elaborate alignment and rounding. Just
to make the point: partitions are aligned on block boundaries, but the
image is rounded to the next cyclinder boundary.

vtoc8 now properly has all partitions aligned (and rounded) to the
cyclinder boundary.

Obtained from:	Juniper Networks, Inc.
MFC after:	3 days
2014-09-19 23:16:02 +00:00
Will Andrews
76479f1d3f Fix incremental builds involving non-root users with read-only source files.
Makefiles should not assume that source files can be overwritten.  This is the
common case for Perforce source trees.

This is a followup commit to r211243 in the same vein.

MFC after:	1 month
Sponsored by:	Spectra Logic
MFSpectraBSD:	r1036319 on 2014/01/29, r1046711 on 2014/03/06
2014-09-18 14:41:57 +00:00
Mark Johnston
f4f080c659 Fix a typo.
MFC after:	3 days
2014-09-16 22:26:01 +00:00
Allan Jude
4f9ec02771 Add the new iscsi(4) man page
Cross reference it from iscsid(8) and iscsictl(8)

Reviewed by:	trasz
Approved by:	bcr (mentor), wblock (mentor)
Sponsored by:	ScaleEngine Inc.
CR:		https://reviews.freebsd.org/D741
2014-09-13 18:40:12 +00:00
Marcel Moolenaar
752bf46955 Add support for adding empty partition entries. I.e. skip partition
numbers or names. This gives more control over the actual layout and
helps to construct BSD disklabels with /usr or /var at dedicated
partitions.

Obtained from:	Juniper Networks, Inc.
MFC after:	3 days
Relnotes:	yes
2014-09-12 20:05:08 +00:00
Marcel Moolenaar
de3307644e Be compatible with boot code that starts right after the disk label in
the second sector by only clearing the amount of bytes needed for the
disklabel in the second sector. Previously we were clearing exactly 1
sector worth of bytes and as such writing over boot code that may have
been there.
Since we do support more than 8 partitions, make sure to set all fields
in d_partitions. For the first 8 partitions this is unneeded, but for
partitioons 9 and up this compensates for the fact that we don't clear
an entire sector anymore.
Obviously, one cannot use more than 8 partitions when using boot code
that starts right after the disk label.

Relevant GRNs:
107879 - Employ unused bytes after the disklabel in the second sector.
189500 - Revert the part of change 107879 that employs the unused bytes
	 after the disklabel in the 2nd sector for boot code.

Obtained from:	Juniper Networks, Inc.
MFC after:	3 days
2014-09-12 04:15:35 +00:00
Marcel Moolenaar
04ca14cc2a Fix checksum calculation:
1.  Iterate over all partitions counted in the label, which can be more
    than the number of partitions given to mkimg(1).
2.  Start the checksum from the beginning of the label; not the beginning
    of the bootarea.

Tested with bsdlabel(8).

MFC after:	3 days
2014-09-12 03:54:16 +00:00
Edward Tomasz Napierala
aaa995f25c Fix typo.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2014-09-11 19:54:30 +00:00
Hiroki Sato
83a15ccf22 Fix header output when -P is specified and (ncpus - 1) != maxid.
Reported by:	Hiroaki Shimizu
PR:		152738
2014-09-10 22:34:08 +00:00
Andrew Turner
b8fd1e31d9 Unify interrupts bit definition and usage. While here remove PSR_C_bit.
Submitted by:	Svatopluk Kraus <onwahe at gmail.com>,
		Michal Meloun <meloun at miracle.cz>
Differential Revision: https://reviews.freebsd.org/D754
2014-09-10 15:25:15 +00:00
Andrew Turner
adc9488df4 Stop accessing the saved stack pointer by looking past the end of the
array of registers.

Submitted by:	Michal Meloun <meloun at miracle.cz>
2014-09-10 13:07:01 +00:00
Andrey V. Elsukov
5dbfa43f65 Add the ability to set `prefer_source' flag to an IPv6 address.
It affects the IPv6 source address selection algorithm (RFC 6724)
and allows override the last rule ("longest matching prefix") for
choosing among equivalent addresses. The address with `prefer_source'
will be preferred source address.

Obtained from:	Yandex LLC
MFC after:	1 month
Sponsored by:	Yandex LLC
2014-09-09 10:52:50 +00:00
Andrey V. Elsukov
ccc53de916 Add the reverse part to rule #9. Also change its description in the
netstat(8) output.

MFC after:	1 week
2014-09-01 09:30:34 +00:00
John Baldwin
0b976534de Clarify that the -c argument clears the list of tracepoints specified by
-t (it does not clear all tracepoints).

Submitted by:	jmg, Eric van Gyzen <eric@vangyzen.net>
MFC after:	1 week
2014-08-26 21:21:57 +00:00
Glen Barber
eb5ba50bcf Add svnlite.1 to CLEANFILES.
MFC after:	3 days
X-MFC-To:	stable/10 only
Sponsored by:	The FreeBSD Foundation
2014-08-26 20:40:12 +00:00
Glen Barber
5605ea9fc1 Add host.1 to CLEANFILES.
MFC after:	3 days
X-MFC-To:	stable/10 only
Sponsored by:	The FreeBSD Foundation
2014-08-26 19:36:47 +00:00
Sergey Kandaurov
eb261dda8b Missed comma. 2014-08-26 11:04:51 +00:00
Stefan Eßer
f071b64ed3 More man pages that need to know about vt in addition to syscons.
MFC after:	3 dayS
2014-08-26 10:55:08 +00:00
Enji Cooper
e5516195c6 Convert LIBCURSES to LIBNCURSES to fix "make checkdpadd"
Also, add a missing LIBPANEL dependency for lldb

Approved by: rpaulo (mentor)
Suggested by: brooks
MFC after: 5 days
Phabric: D675 (as part of a larger diff)
PR: 192762
2014-08-26 09:10:28 +00:00
Enji Cooper
cfeea56955 Fix "make checkdpadd" in usr.bin/iscsictl by removing -lfl dependency
Approved by: rpaulo (mentor)
MFC after: 1 week
2014-08-23 20:42:37 +00:00
Mark Johnston
d77e67e495 Suppress warnings when retrieving protocol stats from interfaces that
don't support IPv6 (e.g. pflog(4)).

Reviewed by:	hrs
MFC after:	2 weeks
2014-08-22 19:23:38 +00:00