Commit Graph

11379 Commits

Author SHA1 Message Date
Marcel Moolenaar
a0f136e1c5 Add image_data() for checking whether a sequence of blocks has data.
Use this for VHD and VMDK to avoid allocating space in the image
for empty sectors.

Note that this negatively affects performance because mkimg uses a
temporary file for the intermediate storage. When mkimg has better
internal book keeping, performance can be significantly improved.
2014-07-15 04:39:23 +00:00
Pietro Cerutti
2d2187338e Unbreak the build by re-enabling exceptions.
Disabling them breaks build on archs using GCC. The problem is at line 156 of
bits/basic_ios.h:

	if (this->exceptions() & __state)
		__throw_exception_again;

With exceptions disabled __throw_exception_again is defined as

#define __throw_exception_again

at line 45 of exception_defines.h and the code results in an empty loop body,
which fails because of -Werror.

Approved by:	cognet
2014-07-14 12:24:38 +00:00
David Chisnall
f2b893a0c6 Turn off exceptions and rtti when building the c++ version of users.
Neither is used in the program and this saves us 10KB (around 40%) in binary
size.
2014-07-12 07:47:50 +00:00
Bryan Drewery
1d212ea524 Fix vmstat -M after r263620 renamed 'cnt' to 'vm_cnt'.
This was showing as:
  vmstat: undefined symbols:
   _cnt

To remain backwards compatible with older dumps, if 'vm_cnt' symbol is not
found then try again with 'cnt'.

Reported by:	pho
Sponsored by:	EMC / Isilon Storage Division
2014-07-11 16:45:55 +00:00
Marcel Moolenaar
5d4393ed1f Make this compile on older FreeBSD versions that don't have
APM_ENT_TYPE_APPLE_BOOT.
2014-07-11 01:49:25 +00:00
Ed Schouten
e8df2232e0 Fix a couple of style nits.
- Use set instead of std::set, to be consistent with the rest of the file.
- Remove return (0); it's not required.
- Add a dash at the beginning of the copyright, per style(9).
2014-07-10 16:10:39 +00:00
Ed Schouten
63cdd39993 Don't use auto, as we also need to support GCC 4.2. 2014-07-10 15:58:28 +00:00
Ed Schouten
975f912456 Let users(1) use an std::set, instead of std::{vector,sort,unique}.
Reviewed by:	gahr
2014-07-10 15:56:15 +00:00
Pietro Cerutti
33aa643fa0 Reimplements users(1) in C++.
This reduces the lines of code by roughly 50% (not counting the COPYRIGHT
header) and makes it more readable by using standard algorithms.

Approved by:	bapt
2014-07-10 12:15:02 +00:00
Simon J. Gerraty
5bcb74248e Update to bmake-20140620
Main change is detection of malformed variable references.

Reviewed by:	obrien
2014-07-08 22:27:50 +00:00
Warren Block
edcb40eb4e Make synopsis version of -3 flag match other uses in the page.
MFC after:	1 week
2014-07-08 02:43:04 +00:00
Marcel Moolenaar
e7d939bda2 Remove ia64.
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
2014-07-07 00:27:09 +00:00
Gavin Atkinson
6c17b5fab9 Dominion Day became Canada Day in 1982, update the holiday calendar.
PR:		191533
Submitted by:	db
Obtained from:	http://www.pch.gc.ca/eng/1359137387574/1359137429809
MFC after:	3 days
2014-07-05 19:02:53 +00:00
Eitan Adler
1dd5886f98 units(1): Clean up
Remove unused constant.  Add 'static' where able.
2014-07-05 03:49:20 +00:00
Eitan Adler
fa3fb62bff units(1): Convert units.lib to use '#' instead of '/'.
This allows us to run GNU units against our data files and compare the output.
	In addition, current units(1) does not support '/' as a comment at all.
2014-07-05 03:27:31 +00:00
Eitan Adler
0ce97bdf81 units: Support start of line comments with '#'
Modern GNU units(1) supports comments anywhere with '#' but take the easy route for now and at least support start of line # comments.
2014-07-05 03:25:26 +00:00
Eitan Adler
8d61f393a3 units(1): Add 'terse' support
terse output is used when calling units from another script.
2014-07-05 03:17:57 +00:00
Eitan Adler
a913717b0d units(1): Add 'help' flag
- Add support for --help for compatibility
	- Make usage() static
2014-07-04 22:19:21 +00:00
Eitan Adler
c27cc201fb units(1): Fix man page
Igor walks one way.  I walked the other.

Reported by:	wblock
2014-07-04 21:34:48 +00:00
Eitan Adler
5192ff4547 units(1): add long options
Things brings additional compatibility with units 2.10

Discussed with:	wblock (man page)
2014-07-04 21:21:05 +00:00
Marcel Moolenaar
264f86e1ad Document the -y option as a unit test option.
Add missing -v (and -y) to the usage message.

Requested by: eadler@
2014-07-04 18:47:25 +00:00
Eitan Adler
b5bb953863 look: implement long options
gentoo has "util-linux 2.24.1" with long options.  Other distributions
	have similar.

	usage() is intentionally unchanged to keep it short and sweet

Reviewed by:	jmg
Discussed with:	adrian, jilles
2014-07-04 04:47:29 +00:00
Marcel Moolenaar
f3582a728d Add VHD support to mkimg(1). VHD is used by Xen and Microsoft's Hyper-V
among others.

Add an undocumented option for unit testing (-y). When given, the image
will have UUIDs and timestamps synthesized in a way that gives identical
results across runs. As such, UUIDs stop being unique, globally or
otherwise.

VHD support requested by: gjb@
2014-07-03 20:31:43 +00:00
Pedro F. Giffuni
f243100087 More sed(1) usage fixing: the extension -i is not optional.
Pointed out by:	jmallet
MFC after:	3 days
2014-07-03 00:31:13 +00:00
Pedro F. Giffuni
9b788a2e5b Fix sed(1) usage: the extension -i is not an optional.
MFC after:	3 days
2014-07-02 23:07:01 +00:00
Ed Maste
634ad025e1 vtfontcvt: correct width calculation (.hex files and commandline)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-02 19:31:49 +00:00
Marcel Moolenaar
91e9fb22ea Add a ful stop after FreeBSD's version in the history section.
Pointed out by: brueffer@ (thanks!)
2014-07-02 14:34:01 +00:00
Eitan Adler
9f932ecdb2 Add documentation for svnlite.
PR:		191544
Reported by:	eric
Reviewed by:	imp
MFC After: 	1 week
2014-07-02 05:09:41 +00:00
Marcel Moolenaar
73f28b23c4 Prepare for merging to stable/10: update the history section. 2014-07-02 04:06:06 +00:00
Ed Maste
824a909300 Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT
The _SUPPORT knobs have a consistent meaning which differs from the
behaviour controlled by this knob.  As the knob is opt-out and has not
appeared in a release the impact should be low.

Suggested by:	imp, wblock
MFC after:	1 week
2014-06-30 00:20:12 +00:00
Xin LI
b6cee71de3 MFV r267843: update file/libmagic to 5.19.
MFC after:	2 weeks
2014-06-26 06:03:39 +00:00
Xin LI
60e5655540 Correct buffer size.
Submitted by:	Sascha Wildner <swildner dragonflybsd org>
MFC after:	2 weeks
2014-06-26 00:31:58 +00:00
Xin LI
0196728184 Use correct length for buffer.
Submitted by:	Sascha Wildner <swildner dragonflybsd org>
MFC after:	2 weeks
2014-06-25 23:42:53 +00:00
Hajimu UMEMOTO
f35f40c51f Introduce $RA_SERVER to set default whois server.
Requested by:	nork
Reviewed by:	nork
MFC after:	1 week
2014-06-25 15:39:08 +00:00
Gavin Atkinson
2d4f49b998 Remove csup(1) and its associated cpasswd(1) tool.
With the move by the FreeBSD Project away from CVSup as a distribution
mechanism, there is no longer a need to keep this in base.

Approved by:	mux (around a year ago), silence on -hackers
X-MFC-after:	never
2014-06-25 12:06:45 +00:00
Baptiste Daroussin
2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +00:00
Pedro F. Giffuni
90d81f30ec Drop ifdef nonsense: just use setvbuf(3).
Pointed out by:		kib, bde
2014-06-21 14:07:33 +00:00
Glen Barber
66edec08b0 Fix a bug in bsdgrep(1) where patterns are not correctly
detected.

Certain criteria must be met for this bug to show up:

 * the -w flag is specified, and
 * neither -o or --color are specified, and
 * the pattern is part of another word in the line, and
 * the other word that contains the pattern occurs first

PR:		181973
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2014-06-20 21:53:50 +00:00
Pedro F. Giffuni
fc39ce9ee1 Add -u (unbuffered output) after GNU sed.
Obtained from:	NetBSD
MFC after:	1 week
2014-06-20 21:41:30 +00:00
John Baldwin
e876f6d052 Cap the percent CPU of individual threads at 100% to fix some of the
more obvious imprecision in the previous top changes.

Specifically, top uses a delta of clock_gettime() calls right after
invoking the kern.proc sysctl to fetch the process/thread list to
compute the time delta between the fetches.  However, the kern.proc
sysctl handler does not run in constant time.  It can spin on locks,
be preempted by an interrupt handler, etc.  As a result, the time
between the gathering of stats for individual processes or threads
between subsequent kern.proc handlers can vary.  If a "slow" kern.proc
run is followed by a "fast" kern.proc run, then the threads/processes
at the start of the "slow" run will have a longer time delta than the
threads/processes at the end.  If the clock_gettime() time delta is
not itself skewed by preemption, then the delta may be too short for
a given thread/process resulting in a higher percent CPU than actual.
However, there is no good way to calculate the exact amount of overage,
nor to know which threads to subtract the overage from.  Instead, just
punt and fix the definitely-wrong case of an individual thread having
more than 100% CPU.

Discussed with:	zonk
2014-06-20 19:54:23 +00:00
Marcel Moolenaar
a589e596c0 Don't dump core when the ELF file has no section headers. The ELF
core files created by gcore are among those.
2014-06-19 20:12:28 +00:00
Edward Tomasz Napierala
4d47846940 Rename a variable; no functional changes.
Sponsored by:	The FreeBSD Foundation
2014-06-18 17:48:30 +00:00
Edward Tomasz Napierala
0262f2e007 Add "iscsictl -M", which allows one to change session parameters
without removing it and adding back.

Sponsored by:	The FreeBSD Foundation
2014-06-18 17:46:34 +00:00
Gavin Atkinson
47200bbd05 Add a stub send-pr that simply points people towards the online support
pages, to give people used to send-pr a bit of guidance.

MFC after:	3 days
2014-06-17 12:59:03 +00:00
Pedro F. Giffuni
5e64d66ca4 patch: add dry-run alias for compatibility with other implementations.
Other implementations of patch(1), including GNU patch and "svn patch"
have a --dry-run option which does the same as our -C or --check
option.

Add a new alias to make our implementation more compatible.

MFC after:	1 week
2014-06-15 16:38:17 +00:00
Joel Dahl
0d7fff32d4 Fix date. 2014-06-15 10:18:57 +00:00
Pedro F. Giffuni
c1a08643e3 patch: unsign the line length to avoid overflows.
Patch(1) uses a short int for the line length, which is usually
sufficient for regular diffs, but makes no effort to signal
when there is an overflow.

Change the line length to an unsigned short int to better use
the fact that a length is never negative.  The change is loosely
inspired on a related change in DragonFly, but we avoid spending
more memory than necessary.

While here adjust the messages to be clearer on what is happening.

MFC after:	1 week
2014-06-15 03:54:23 +00:00
Pedro F. Giffuni
c44f94d0cd patch: cleanup some unnecessary cruft.
- Drop some bogus casts to size_t.
- The new_p_foo variables are not needed after r267426.

Pointed out by:		bde
MFC after:		1 week
2014-06-14 01:58:33 +00:00
Stephen Hurd
d8d56b6087 Added:
- my birthday

Approved by:	db, skreuzer (mentors)
2014-06-14 00:10:10 +00:00
Tijl Coosemans
79304f984f - Make invalids variable local to do_conv such that it prints the number
of invalid characters of the current file instead of an accumulated
  value.
- Make do_conv return an error when invalid characters have been found.
  Return EXIT_FAILURE from main if any file contained invalid characters.
  This matches the behaviour of GNU iconv.
- Mark usage with __dead2 attribute.
- Make the long_options array const.
2014-06-13 08:44:03 +00:00
Pedro F. Giffuni
9f00ccd37a Avoid zeroing during allocation.
This change reverts a change from OpenBSD which made use of
calloc, and therefore wasted time initializing arrays that
will later be realloc'ed. Consistently use FreeBSD's
reallocf().

While here also merge the changes from OpenBSD's manpage
patch.1 Rev 1.27:
"patch was moved from user portability (UP) to base in issue 7
and is no longer optional"

MFC after:	1 week
2014-06-12 19:01:57 +00:00
Rodrigo Osorio
a00ec56ca1 Add myself to the calendar
Approved by:	bapt (mentor)
2014-06-12 14:20:58 +00:00
Ed Maste
efc81e89ec Avoid leaking file pointer on error
CID:		1222506, 1222505
2014-06-11 17:19:57 +00:00
Ed Maste
b410b62c85 vt fontcvt: move to usr.bin/vtfontcvt
vtfontcvt is useful for end users to convert arbitrary bitmap fonts
for use by vt(4).  It can also be used as a build tool, allowing us
to keep the source font data in the src tree rather than uuencoded
binaries.

Reviewed by:	ray, wblock (D183)
Sponsored by:	The FreeBSD Foundation
2014-06-10 18:29:45 +00:00
Rui Paulo
7f78c17319 dtc: ignore lines starting with #.
This is necessary because we use the C pre-processor to parse #include lines
and cpp adds line markings that start with #.
2014-06-10 06:16:34 +00:00
Rui Paulo
23afbfa96e dtc: don't crash if the argument is a directory. 2014-06-10 06:04:25 +00:00
Rui Paulo
b60aab0101 The, currently undocumented, -i option takes an argument. 2014-06-10 05:58:46 +00:00
Jilles Tjoelker
fc96358cdd truncate: Detect integer overflow, fix relative sizes, add tests.
The change to expand_number (r204654) broke detection of too large sizes and
relative sizes ('+'/'-').

Also add some tests.

PR:		190735
Submitted by:	Kirk Russell
MFC after:	1 week
2014-06-09 10:39:55 +00:00
Bryan Drewery
864c53ead8 In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.
This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by:		Shawn Webb <lattera@gmail.com>
Discussed between:	des@ and Shawn Webb [2]
2014-06-08 17:29:31 +00:00
Joel Dahl
b6829dc82a Minor mdoc improvements. 2014-06-06 19:00:43 +00:00
Julio Merino
8c7ec47a40 Move atf-sh from /usr/bin/ to /usr/libexec/
In r266650, we made libatf-c and libatf-c++ private libraries so that no
components outside of the source tree could unintendedly depend on them.

This change does the same for the "atf-sh library" by moving the atf-sh
interpreter from its public location in /usr/bin/ to the private location
in /usr/libexec/.  Our build system will ensure that our own test programs
use the right binary, but users won't be able to depend on atf-sh by
"mistake".

Committing this now to ride the UPDATING notice added with r267172 today.
2014-06-06 18:58:06 +00:00
Bryan Drewery
3675249837 Fix some rpcgen sample file issues.
* -Sc was generating code without a return type on main.
* -Sm was generating an unusable clean target due to undefined RM.
* -Sm was generating clean target with extra preceding space.

PR:		185582
Submitted by:	Pawel Biernacki <pawel.biernacki@gmail.com>
MFC after:	1 week
2014-06-06 17:38:37 +00:00
Joel Dahl
275b78396e Minor mdoc nit. 2014-06-06 08:42:03 +00:00
Warner Losh
04efeffe99 When building picobsd, define WITHOUT_OPENSSL and WITHOUT_KERBEROS and
remove the now-redundant checks for RELEASE_CRUNCH. This originally
was defined for building smaller sysinstall images, but was later also
used by picobsd builds for a similar purpose. Now that we've moved
away from sysinstall, picobsd is the only remaining consumer of this
interface. Adding these two options reduces the RELEASE_CRUNCH
special cases in the tree by half.
2014-06-06 04:09:07 +00:00
Sergey Kandaurov
0e3db25f2e mdoc: drop the trailing dot from the xref list. 2014-06-05 08:20:14 +00:00
Konstantin Belousov
28c828b227 Cross-reference jot(1) and seq(1).
MFC after:	3 days
2014-06-04 17:17:30 +00:00
Allan Jude
997a303f17 Sadly, we do not actually live in the future.
Approved by:	wblock (mentor)
2014-06-04 16:55:38 +00:00
Allan Jude
fd2c6bc9e1 Further updates to the netstat(1) man page and usage message
- Reformat the entire man page
- Create a proper synopsis section
- Use itemized-lists to describe each flag, rather than paragraphs
- Cross-reference common flags to a 'general flags' sub-section with short
inline description of the flag
- Label 'general flags' sub-section
- Apply additional fixes suggested by wblock, brueffer, and bdrewery
- Update .Dd that got undone previously
- Change the order of the .Op Fl to be alphabetical
- Add the -i | -I interface flags to the description of 'interface
display mode'
- Fix missing parameters in man page
- Fix missing parameters in usage()
- Sync man page and usage()

MFC Note: stable/9 and stable/10 do not have -R, will need to be removed
when merged

CR:		D58
Reviewed by:	brueffer, bcr
Approved by:	wblock (mentor)
MFC after:	7 days
Sponsored by:	ScaleEngine Inc.
2014-06-04 04:18:33 +00:00
Pietro Cerutti
bc31c88265 - Avoid calling a wrapper function around strcmp
- Use sizeof(*array) instead of sizeof(element) everywhere

CR:		D161
Approved by:	cognet, bapt
2014-06-03 20:59:26 +00:00
Pietro Cerutti
af99cef7e8 - style, remove (void) in front of printf and the like
CR:		D161
Approved by:	cognet, bapt
2014-06-03 20:58:11 +00:00
Ed Maste
ff2e520113 Remove extraneous "mkdir -p"
The directory hierarchy is created by an mtree file (BSD.usr.dist,
in the case of calendar(1)).  An explicit "mkdir -p" in a program's
Makefile is redundant, and can mask a missing mtree entry.
2014-06-02 18:30:57 +00:00
Jilles Tjoelker
fd1e753fbc printf: Install tests/regress.missingpos1.out, fixing tests. 2014-06-01 13:33:22 +00:00
Patrick Kelsey
7650e67d84 - Added myself and mentor/mentee relationship to the src committers
graph.

- Added my info to the FreeBSD calendar.

Approved by:	jmallett (mentor)
2014-05-31 05:16:12 +00:00
Pedro F. Giffuni
cacacde774 Fix m2 regression test.
This is not really a good test as the behaviour for /c is unspecified.

For the record, ksh93 returns:

$ printf "abc\n\cdef"
abc
ef$

Discussed with:	Garret D'Amore (Illumos)
2014-05-31 00:54:21 +00:00
John Baldwin
a90539544c Rework the notion of CPU used in top. In particular, for subsequent
displays after a pause, use the difference in runtime divided by the
length of the pause as the percentage of CPU used instead of the value
calculated by the kernel.  In addition, when determing if a process or
thread is idle or not, treat any process or thread that has used any
runtime or performed any context switches during the interval as busy.

Note that the percent CPU is calculated as a double and stored in an
array to avoid recalculating the value multiple times in the comparison
method used to sort processes in the CPU display.

Tested by:	Jamie Landeg-Jones <jamie@dyslexicfish.net>
Reviewed by:	emaste (earlier version)
MFC after:	1 week
2014-05-30 21:18:53 +00:00
Pedro F. Giffuni
583d27945d Update number of tests.
Suggested by:	jmmv
2014-05-29 19:48:18 +00:00
Pedro F. Giffuni
ea1a630ade Minor style knit. 2014-05-29 19:43:43 +00:00
John Baldwin
5648de3b31 Fix a couple of size_t != int warnings. 2014-05-27 20:22:36 +00:00
Peter Wemm
b924fc0363 Update backend files and makefiles for apr 1.4.8 -> 1.5.1 2014-05-27 07:16:43 +00:00
Peter Wemm
437480d4f5 Merge svn-1.8.8 -> 1.8.9 2014-05-27 04:59:53 +00:00
Pedro F. Giffuni
f764fa47f0 printf(1): add tests for warn about incomplete uses n$
Submitted by:	jilles
MFC after:	2 weeks
2014-05-26 15:08:39 +00:00
Pedro F. Giffuni
4aa1792423 printf(1): warn about incomplete uses n$
Reviewed by:	jilles
Obtained from:	Illumos
MFC after:	2 weeks
2014-05-26 14:57:47 +00:00
Julio Merino
17a286a994 Change libatf-c and libatf-c++ to be private libraries.
We should not be leaking these interfaces to the outside world given
that it's much easier for third-party components to use the devel/atf
package from ports.

As a side-effect, we can also drop the ATF pkgconfig and aclocal files
from the base system.  Nothing in the base system needs these, and it
was quite ugly to have to get them installed only so that a few ports
could build.  The offending ports have been fixed to depend on
devel/atf explicitly.

Reviewed by:	bapt
2014-05-25 12:01:13 +00:00
Allan Jude
ada0a6dd14 Add path markup on sys/mbuf.h to previous netstat(1) man page update
Submitted by:	brueffer
Reviewed by:	eadler (mentor)
2014-05-25 08:09:55 +00:00
Allan Jude
e9fa95e9e9 Document the new -R flag of netstat(1) introduced in r266448 that tracks the
flowid for each socket.

Reviewed by:	adrian
Approved by:	eadler (mentor)
2014-05-25 07:41:12 +00:00
Warner Losh
47e496fd5d Add .../share/mk to the default system make path. This will fix the
problem with broken in-tree builds (which are used far more
pervasively than I'd known outside the tree). However, weird results
may now happen if at any point in the tree above you there happens to
be a directory that has subdirectory of share/mk, as unpredictable
results will follow. This was considered the lessor of the two evils,
at least for now. In the future this will be removed again when the
underlying issues are resolved.
2014-05-23 00:20:44 +00:00
Marcel Moolenaar
aa30ba04c3 Create our temporary file in $TMPDIR, if the environment variable
is set. /tmp otherwise.

Submitted by:   Dan McGregor <danismostlikely@gmail.com>
2014-05-22 20:24:30 +00:00
Aleksandr Rybalko
b8a7acdf7b Rollback r266496.
Different meaning of flags for lock(1) and vidcontrol(1) confuse me.

Pointy hat to:	ray
Sponsored by:	The FreeBSD Foundation
2014-05-22 09:28:36 +00:00
Marcel Moolenaar
762ff43901 Fix CID 1204379 (vtoc8.c) & CID 1204380 (bsd.c): Cast ncyls to lba_t
before multiplying the 32-bit integrals to avoid any possibility of
truncation before widening. Not a likely scenario to begin with...
2014-05-21 17:39:49 +00:00
Marcel Moolenaar
adc991ea42 Fix CID 1204394: Use strncpy(3) instead of strcpy(3). Note that it's
ok to not have the name and type strings terminated.
2014-05-21 17:38:56 +00:00
Marcel Moolenaar
645c72194e Fix CID 1215124: Handle errors properly. 2014-05-21 17:38:14 +00:00
Marcel Moolenaar
a513818762 Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does
not return the error (oops).
2014-05-21 17:37:22 +00:00
Marcel Moolenaar
9746454f54 Fix CID 1215128: Free the allocated buf when image_set_size()
returns and error and we return from bsd_write().
2014-05-21 17:36:12 +00:00
Marcel Moolenaar
bce9a24a0e Fix CID 1215129: move the call to lseek(2) before the call to malloc(3)
so that the error path (taken due to lseek(2) failing) isn't leaking
memory.
2014-05-21 17:34:50 +00:00
Aleksandr Rybalko
0cc7a38567 Sync lock(1) on VT_LOCKSWITCH usage with syscons(4), vt(4) and vidcontrol(1).
Sponsored by:	The FreeBSD Foundation
2014-05-21 11:53:15 +00:00
Hiroki Sato
c4f55e08be - Fix a bug which can make sysctl() fail when -F is specified.
- Increase WID_IF_DEFAULT() from 6 to 8 (the default for AF_INET6) because
  we have interfaces with longer names than 6 chars like epairN{a,b}.
- Style fixes.
2014-05-21 10:04:51 +00:00
Adrian Chadd
85b0f0f325 Add -R to netstat to dump RSS/flow information.
This is intended to help in diagnostics and debugging of NIC and stack
flowid support.

Eventually this will grow another column (RSS CPU ID) but
that currently isn't cached in the inpcb.

There's also no clean flowtype -> flowtype identifier string.  This is
the mbuf M_HASHTYPE_* values for RSS.

Here's some example output:

adrian@adrian-hackbox:~/work/freebsd/head/src % netstat -Rn | more
Active Internet connections
Proto Recv-Q Send-Q Local Address          Foreign Address           flowid ftype
tcp4       0      0 10.11.1.65.22          10.11.1.64.12409        29041942     2
udp4       0      0 127.0.0.1.123          *.*                     00000000     0
udp6       0      0 fe80::1%lo0.123        *.*                     00000000     0
udp6       0      0 ::1.123                *.*                     00000000     0
udp4       0      0 10.11.1.65.123         *.*                     00000000     0

Tested:

* amd64 system w/ igb NIC; local driver changes to expose RSS flowid in if_igb.
2014-05-19 17:11:43 +00:00
Allan Jude
a7b1372283 Note my mentors in the committers graph.
Add my birthday to the calendar.

Approved by:	bcr (mentor)
2014-05-18 04:21:12 +00:00
John Baldwin
cb3530163a Add descriptions of the display formats for -e, -l, -r, and -x. Fix a few
typos in indent settings while here.
2014-05-17 16:12:50 +00:00
John Baldwin
27705da488 Use 'RESOURCE' instead of the more generic 'TYPE' for the resource name
column header when displaying resource usage.  This more closely matches
other procstat displays.
2014-05-17 16:11:06 +00:00
John Baldwin
81c3d3958a Correct some minor nits in the per-thread signal format description such
as missing posessives and misordering of fields.

MFC after:	1 week
2014-05-17 04:06:54 +00:00
John Baldwin
dc0aa0675b - Add support for dumping current resource usage for processes via a new -r
flag to procstat.
- Add an -H flag to request information about threads rather than processes
  when dumping statistics.  Currently it is only used for -r to display
  resource usage for individual threads instead of the entire process.

Reviewed by:	kib (older version without -H)
MFC after:	1 month
2014-05-17 03:54:51 +00:00
Hiroki Sato
0e798e1faa - Do not override sin6_scope_id in LLA when it is already set to non-zero.
This fixes destination list in output of netstat -r.
- Plug a memory leak.
- Add RTM_VERSION check.
- Minor style fixes.
2014-05-15 19:26:20 +00:00
Marcel Moolenaar
f0e9dced5c MFuser/marcel/mkimg:
Add support for different output formats:
1.  The output file that was previously written is now called the raw format.
2.  Add the vmdk output format to create VMDK images.

When the format is not given, the raw output format is assumed.
2014-05-15 19:19:57 +00:00
Brooks Davis
525e2a83f6 Revert r261296. This removes the WITHOUT_NCURSESW option.
It was the wrong direction.  We will instead remove use of the
non-wide-character supporting libncurses.
2014-05-15 16:44:25 +00:00
Warner Losh
0629d5e958 Makefile.inc is also included by the tests subdirectory, which results
in SUBDIRS having tests added to it, which fails. Work around this by
checking to make sure tests exists before adding it to subdirs and
work to get the generated file fixed so we can rename Makefile.inc to
something else so it isn't automatically included by subdirs...
2014-05-15 15:45:45 +00:00
Eitan Adler
87ddbe8241 units(1): Fix minor typos
Obtained From:	DragonflyBSD
2014-05-15 05:35:00 +00:00
Warner Losh
a3438dfc9b Undo changes to the generated Makefile. Move tests directory to proper
location, including updating the test to work in the more-fragile
fmake -> bmake bootstrap environment.
2014-05-15 01:27:24 +00:00
Julio Merino
5ae59dec60 Move old fmake tests into bmake and hook them to the build.
This first step is mostly to prevent the code from rotting even further
and to ensure these do not get wiped when fmake's code is removed from
the tree.

These tests are currently being skipped because they detect the underlying
make is not fmake and thus disable themselves -- and the reason is that
some of the tests fail, possibly due to legitimate bugs.  Enabling them to
run against bmake will come separately.

Lastly, it would be ideal if these tests were fed upstream but they are
not ready for that yet.  In the interim, just put them under usr.bin/bmake/
while we sort things out.  The existence of a different unit-tests directory
within here makes me feel less guilty about this.

Change confirmed working with a clean amd64 build.
2014-05-14 18:43:13 +00:00
Jilles Tjoelker
4e4d980265 printf: Fix missing arguments for %u/%o/%x/%X after r265592.
If a numeric argument is missing, zero should be assumed, for signed as well
as unsigned conversions.

This fixes the 'zero' regression tests.

r265592 erroneously reverted r244407.
2014-05-13 21:24:55 +00:00
Eitan Adler
373ca6f9ff units(1): call el_end()
Add missing el_end() call
2014-05-12 07:14:09 +00:00
Eitan Adler
db9def8b0a units(1): unbreak -f option, fix some style, increase compatibility.
- Unbreak the -f option: it was missing a ':'
- gunits -V spits out more information than just its version: attempt to do so
  as well.
2014-05-12 06:14:14 +00:00
Eitan Adler
cfa8c23640 units(1): use common functions
No need to replicate strdup
2014-05-12 05:44:55 +00:00
Thomas Quinot
55298f0397 Minor fixes to previous change introducing switch -H, as per comments
on -arch.

Reviewed by:	gleb
2014-05-11 18:49:18 +00:00
Pedro F. Giffuni
30238f4963 printf: fix regression after illumos merges.
The "bltin/bltin.h" wrappers do not support exit() and attempting
to call it will exit sh completely.

Note that errx() is acceptable but will always return with status 2.

Reported by:	jilles (and the testing framework)
Fix by:		jilles
Pointyhat:	pfg
2014-05-11 17:28:57 +00:00
Eitan Adler
2f4de29783 mesg: remove advertising clause
The University of California board of trustees has given permission to remove
the advertising clause of all software attributed to it.
2014-05-11 02:04:40 +00:00
Eitan Adler
b245fc98c8 look(1): add compability with other implementations.
On other implementations 'look -a' uses an alternate dictionary.  Since we don't
have one, just ignore it.
2014-05-11 02:00:48 +00:00
Pedro F. Giffuni
76f66be6bf prinf: replace use of alloca with variable length array.
Use of alloca(3) is discouraged in FreeBSD. Using a VLA
is simple and should be more portable.

Requested by:	jilles
2014-05-10 22:27:01 +00:00
Warner Losh
7273339dc4 Eliminate EARLY_BUILD flag. It is redundant and means MK_CLANG_FULL=no
and MK_LLDB=no, so set those explicitly (now that we can do
that). Simplify tests for these variables as well, since we know they
will always be defined regardless of the phase of the build.
2014-05-10 16:38:03 +00:00
Warner Losh
f510ecf0ee Optionally allow building the historical FreeBSD make program and
install it as fmake. This defaults to no. This should be viewed as the
first step towards evental migration of this historic code to ports
and removal from the tree.
2014-05-10 16:37:39 +00:00
Alexander V. Chernikov
6052df8ef8 Allow systat(1) interactive dispay-specific commands to
be specified via command line.

Submitted by:	vsevolod
MFC after:	2 weeks
2014-05-09 16:20:55 +00:00
Pedro F. Giffuni
437bce620f Fix the incorrect handling of %b and \c in printf(1)
This is required for POSIX compliance.

Obtained from:	Garrett D'Amore (Illumos)
MFC after:	4 days
2014-05-08 20:20:59 +00:00
Ed Maste
97a9b0b123 Handle ELF files with 65280 or more sections
If e_shnum or e_shstrndx are at least SHN_LORESERVE (0xff00) then an
escape value is used to indicate that the actual value is found in one
of section 0's fields.

Sponsored by:	DARPA, AFRL
2014-05-07 21:16:47 +00:00
Pedro F. Giffuni
f8a6c905bf Add width and precision specifiers to printf(1) %n$.
This actually completes r264743 so that width and precision
specifiers work properly with %n$. These keeps consistency
with  ksh93 and zsh.

Requested by:	jilles
Obtained from:	Garrett D'Amore (Illumos)
MFC after:	4 days
2014-05-07 19:30:28 +00:00
Thomas Quinot
4d6bab2606 Introduce a new command line switch '-H' for stat(1)
causing arguments to be interpreted as NFS file handles.

Reviewed by:	-arch (jhb, eadler)
MFC after:	1 month
2014-05-07 19:22:54 +00:00
Marcel Moolenaar
789a10b106 Add mkimg_write() which combines lseek(2) and write(2) and uses
sector granularity for both offset and length. Have all schemes
use mkimg_write() instead of mkimg_seek() followed by write(2).

Now that schemes don't use lseek(2) nor write(2) directly, it's
easier to support output formats other than raw disks.
2014-05-06 21:54:05 +00:00
Marcel Moolenaar
c562fda42a In apm_write(), both fd and imgsz are referenced, so don't mark the
arguments as unused.
2014-05-06 20:34:21 +00:00
Warner Losh
f0e845794d Fix the upgrade path for fmake by allowing the include of src.opts.mk
to fail and falling back on the conservative testing of variables
already in place. This should stop the tide of tinderbox mail.
2014-05-06 14:33:18 +00:00
Stefan Eßer
cb3d295629 Revert r265436, since it is not the correct fix. 2014-05-06 14:01:48 +00:00
Stefan Eßer
05071052ab Fix include statement to accept src.opts.mk from a source directory
instead of from /usr/share/mk.

I'm not sure that this will let buildworld complete on a system with
no installed src.opts.mk (make buildworld is still running), but the
tinderbox builds are all failing earlyon without this patch.
2014-05-06 12:31:17 +00:00
Warner Losh
d03127447d Remove support for WITHOUT_BMAKE. bmake is now the only make that can
build world, so it is the only make we build or install. fmake is
still in the tree, but disconnected, and upgrades from older systems
that still have bmake has not been removed, but its state has not been
tested (it should work given how minimal the work to upgrade to bmake
is).
2014-05-06 04:22:37 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Gleb Smirnoff
c669105d17 - Remove net.inet.tcp.reass.overflows sysctl. It counts exactly
same events that tcpstat's tcps_rcvmemdrop counter counts.
- Rename tcps_rcvmemdrop to tcps_rcvreassfull and improve its
  description in netstat(1) output.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-05-06 00:00:07 +00:00
Sergey Kandaurov
c401df0176 Treat the '-' as meaning standard input.
Obtained from:	NetBSD
2014-05-04 12:20:40 +00:00
Bryan Drewery
069f49cfe8 Fix width/alignment of JID column. Make it support up to the maximum
7-wide JIDs. On a system using jails for common tasks the JID can
quickly increase.

MFC after:	2 weeks
2014-05-03 15:03:47 +00:00
Eitan Adler
377d232d9c Fix syntax error with modern shells
Submitted by:	multiple
2014-05-03 08:52:52 +00:00
Bryan Drewery
1b60f97272 Add -J command/flag to filter by jail name/jid. This will automatically
display the JID as well (the -j command/flag).

  0 displays host.
  + displays all.

MFC after:	2 weeks
Relnotes:	yes
2014-05-02 23:30:39 +00:00
Nathan Whitehorn
2cbc36ab59 Add freebsd-boot to recognized partition types. 2014-05-01 03:24:20 +00:00
Alexander V. Chernikov
68bbdd0e71 Fix "netstat -gW" behavior broken in r259638.
netstat has two options for printing multicast tables:
sysctl (the default one for live systems) and kvm-based one (for cores).
It looks like kvm-based one hasn't been working since it's been introduced
in r190012 due to absence of mfctablesize kernel symbol.
Check for all ipv4-multicast symbols being correctly resolved was introduced
in r259638 regardless of 'live' value leading to "No IPv4 MROUTING" error
message.

Reported by:	Olivier Cochard-Labbé
MFC after:	1 week
2014-04-29 16:51:28 +00:00
Warner Losh
a58f61bf3a Eliminate last vestigies of NO_MAN= in the tree. Also, remove
ineffectual NOMAN= lines. These don't change the build at all.
2014-04-25 19:25:05 +00:00
Bryan Drewery
459d6434a8 Fix spelling error.
MFC after:	3 days
2014-04-25 15:27:19 +00:00
Xin LI
a1217f20b4 Constify. 2014-04-25 04:01:25 +00:00
Warner Losh
d6d1ee211a Add option WITHOUT_VI to not build/install vi. vi was the largest
binary without a knob to turn it off.
2014-04-24 23:17:40 +00:00
Steven Hartland
1c99a22a29 Add Linux socket call decoding to truss
MFC after:	1 month
2014-04-24 14:12:35 +00:00
Edward Tomasz Napierala
0151d866c0 Grammar fix. 2014-04-24 11:27:03 +00:00
Ed Schouten
43e0d7bfe0 Make usage printing more consistent with other tools.
- Introduce a separate usage() function.
- Don't use argv[0]. Directly name the application, as we do elsewhere.
- Don't prepend the application name.
- Don't print two newlines.
2014-04-23 14:05:28 +00:00
Baptiste Daroussin
0c8de5b03c Update to byacc 20140409
Among all the modifications, this new byacc also solves a 14 year old bug [1]

PR:		bin/23254 [1]
Submitted by:	marka@nominum.com [1]
MFC after:	3 weeks
2014-04-23 05:57:45 +00:00
Pedro F. Giffuni
b1a409863f Various style(9) fixes and typos in grep, sort and patch.
MFC after:	3 days
2014-04-21 22:52:18 +00:00
Pedro F. Giffuni
b0620803d5 Add parameterized position handling to printf(1).
Add a new %n$ option to change the order of the parameters as
done in the ksh93 builtin printf (among others).

For example:
%printf '%2$1d %1$s\n' one 2 three 4
2 one
4 three

The feature was written by Garret D'Amore under a
BSD license for Nexenta/illumos.

Reference:
http://garrett.damore.org/2010/10/new-implementation-of-printf.html

PR:		bin/152934
Obtained from:	Illumos
MFC after:	2 weeks
2014-04-21 22:47:18 +00:00
Jilles Tjoelker
07426f1f0a login: Remove broken dialup log message.
For 10 years, the "DIALUP <tty>, <user>" message has required having a
hostname (-h) instead of not having a hostname; therefore, it is never
logged. Given that dialup is obsolete and this has not been fixed, remove
the log message.

Note that LOGALL, which is defined by default, logs a message for all
logins, including dialup logins.
2014-04-19 13:47:32 +00:00
Bjoern A. Zeeb
43b001dc46 Stop casting the const char * to void * to char * to make compile more happy
after r264573.

Someone submit to:	OpenBSD
MFC after:	13 days
X-MFC with:	r264573
2014-04-17 14:15:53 +00:00
Bjoern A. Zeeb
107074dfec Remove duplicate extern declarations after r264573.
Makes things compile better.

Someone submit to:	OpenBSD
MFC after:		13 days
X-MFC with:		r264573
2014-04-17 13:57:37 +00:00
Pedro F. Giffuni
f77d666207 Minor style(9) cleanups
#define should be followed by a tab.

MFC after:	3 days
2014-04-17 01:43:15 +00:00
Xin LI
be848c7a13 Sync with OpenBSD.
MFC after:	2 weeks
2014-04-16 23:14:05 +00:00
Eitan Adler
956c78c92b units(1): don't compare pointers with 0
For better readability, don't compare pointers with 0 or assign 0
to them. Use NULL instead.

Inspired by:	DragonflyBSD
2014-04-14 21:09:47 +00:00
Eitan Adler
dc8c916dcd units(1): Add 'static' and sort list.
Inspired by:	DragonflyBSD
2014-04-14 21:07:54 +00:00
Eitan Adler
9653775e6b units(1): Add v option: verbose
For increased compatibility with GNU units: support a -v option which
produces more verbose output when spitting out the answer.
GNU -v does additional work in the version, information, and check output which
we do not (yet?) replicate.
2014-04-14 20:51:04 +00:00
Eitan Adler
114022f58e units(1): Add U option
For increased compatibility with GNU units: support a -U option which tests for the
existence of the default units file and prints it to the screen.
2014-04-14 16:55:09 +00:00
Eitan Adler
3af082017a units(1): support reading multiple units files
GNU units(1) supports reading up to 25 -f options.  We support an arbitrary
number.
2014-04-14 16:43:36 +00:00
Eitan Adler
cada55282a units(1): parse config file after setting defaults
Parse the config file after setting the defaults to permit the user to change
things (e.g., editing mode)
2014-04-14 14:40:12 +00:00
Eitan Adler
647be2c3a9 units(1): add libedit support
Add line editing and history support to units(1) via libedit.

Reviewed by:	bdrewery
2014-04-14 14:04:59 +00:00
Christian Brueffer
b21e986087 Avoid double close() of a file descriptor.
CID:		1006089
Found with:	Coverity Prevent(tm)
MFC after:	1 week
2014-04-13 20:12:21 +00:00
Christian Brueffer
2545695e6a Avoid double free in f_acl().
CID:		1018508
Found with:	Coverity Prevent(tm)
MFC after:	1 week
2014-04-13 19:48:51 +00:00
Jilles Tjoelker
b547523eb4 find: Return normal exit status from -quit.
If there was an error, make the exit status reflect this even if -quit
caused the exit. Formerly, -quit always caused exit(0).

GNU find does the same.
2014-04-13 11:47:17 +00:00
Alexander Motin
7dc06c978d Fix periph listing when IOCTL buffer border hits result for wanted bus. 2014-04-13 09:31:22 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Jilles Tjoelker
7a79617cc1 find: Correctly propagate -exec/-execdir ... {} + exit status.
As per POSIX, the -exec ... {} + primary always returns true, but a non-zero
exit status causes find to return a non-zero exit status itself. GNU does
the same, and also for -execdir ... {} +.

It does not make much sense to return false from the primary only when the
child process happens to be run.

The behaviour for -exec/-execdir ... ; remains unchanged: the primary
returns true or false depending on the exit status, and find's exit status
is unaffected.
2014-04-12 22:36:26 +00:00
Johannes Jost Meixner
606b39f1e0 - Adding myself to the committers-ports.dot
- Adding myself to the freebsd calendar

Approved by: swills (mentor)
2014-04-10 18:34:26 +00:00
Eitan Adler
6d12a83408 units(1): make -V print version instead of -v
The units program is likely little used.  It is even less likely that a script
will want the units program to print out its version number by passing -v.

GNU units uses -V for version and -v for verbosity.

Increase compatibility between these two versions (written by the same author)
by switching our flag as well.

Take this opportunity to remove bogus information about the version number and
just call it 'FreeBSD units'.

Discussed with:	cperciva, rwatson
2014-04-07 02:31:10 +00:00
Eitan Adler
212168f867 units(1): fix spelling
Pointyhat to:	me
2014-04-07 01:52:35 +00:00
Eitan Adler
e15ad0da3d units(1): Add some some additional units
Most of these are also recognized by GNU units
2014-04-07 01:46:30 +00:00
Jilles Tjoelker
73a0af46b8 find: Treat errno from fts_read() more carefully.
fts_read() leaves errno unchanged on EOF and sets it on error, so set errno
to 0 before calling it. Also, don't trust finish_execplus() to leave errno
unchanged.
2014-04-06 20:04:33 +00:00
Warner Losh
cf57243a46 Convert sort to using newer MK_ convention. 2014-04-05 18:01:49 +00:00
Warner Losh
74b229cb2b Don't test WITHOUT_FOO in program makefiles, test MK_FOO instead. 2014-04-01 14:24:32 +00:00
Julio Merino
912eec3015 Add atf m4 files from the vendor branch.
These were originally deleted as "not important" but, actually we need them
in place if we want to be able to use autoconf on software that provides
atf-based tests.  (That includes being able to rebuild autotest from scratch
on the Kyua cluster machines, as the automated setup does.)
2014-04-01 13:47:08 +00:00
Eitan Adler
ac117d5d7e add capsicum to units(1) 2014-03-30 16:04:47 +00:00
Eitan Adler
0333a5a1e2 units(1): Add some missing units 2014-03-30 05:06:06 +00:00
Eitan Adler
e90cd7efd8 Teach units(1) that an erg and ergon are the same thing. 2014-03-30 04:55:33 +00:00
Marcel Moolenaar
9e4108268e Fix build on FreeBSD 7 where:
1.  DOSPTYP_FAT32 is not defined in <sys/diskmbr.h>
2.  uuid_enc_le() does not exist in libc.
2014-03-29 23:46:01 +00:00
Marcel Moolenaar
f529e2e0a5 Fix build on FreeBSD 8 where partition types for nandfs do not exist. 2014-03-29 22:10:54 +00:00
Marcel Moolenaar
9bc923cbde Fix build on FreeBSD 9 where <sys/pc98.h> has the same defines as
<sys/diskmbr.h> and not the unique defines introduced later.
2014-03-29 22:02:25 +00:00
Marcel Moolenaar
81a44173f0 Hook mkimg(1) to the build. 2014-03-29 19:04:38 +00:00
Marcel Moolenaar
a5eb4ea3ee Add mkimg, a utility for making disk images from raw partition contents.
The partitioning scheme can be one of the schemes supported by gpart.

Reviewed by:	sjg
Obtained from:	Juniper Networks, Inc.
2014-03-29 19:03:10 +00:00
Bryan Drewery
b9034ce23f Add `-S' to display syscall numbers in the output as well.
This is useful for debugging compat modules.

Sponsored by:	EMC / Isilon Storage Division
Obtained from:	Isilon OneFS (based on work by Jeff Hughes)
MFC after:	2 weeks
2014-03-28 16:11:20 +00:00
Dimitry Andric
32a632c401 Enable parallel building for gnu/usr.bin and usr.bin/clang too.
MFC after:	2 weeks
X-MFC-With:	r263778
2014-03-27 20:15:33 +00:00
Dimitry Andric
54ff5d7323 Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially.  Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.

This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.

I tested this on a 24-core machine, with make -j48 buildworld (N = 6):

                before    stddev       after    stddev
                =======   ======       =======  ======
real time        1741.1     16.5         959.8     2.7
user time       12468.7     16.4       14393.0    16.8
sys  time        1825.0     54.8        2110.6    22.8

(user+sys)/real     8.2                   17.1

E.g. the build was approximately 45% faster in real time.  On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive.  But at least you can now almost max out a machine with
buildworld!

Submitted by:	jilles
MFC after:	2 weeks
2014-03-26 22:30:38 +00:00
John-Mark Gurney
0740b81269 udpate VERY old email address.. I haven't had this email address for
well over 8 years...

roll the clock forward 16 years since there have been other changes
deserving of a bump, but never happened..

Submitted by:	feld
Obtained from:	1 week
2014-03-26 03:18:27 +00:00
Maxim Sobolev
c1269d2088 Make -R', -T' and `-E' options mutially non-exclusive. It is often
useful to see two or three types at the same time when inspecting the
dump.

MFC after:	1 month
Sponsored by:	Sippy Software, Inc.
2014-03-25 23:37:57 +00:00
Andrew Turner
73279d4113 Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.
This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
 * WITH_ARM_EABI
 * WITHOUT_GCC
 * WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
 * WITH_CLANG
 * WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.
2014-03-23 12:49:25 +00:00
Julio Merino
ad9105df49 Mark multi_test as requiring /usr/share/dict/words.
The file may not be present if MK_DICT=no.  Pointed out by Casey Peel.
2014-03-19 23:29:00 +00:00
Julio Merino
8d08c1118c Add Makefiles missed in r263346.
Grrr, I wish svn clearly displayed files not yet added when about to commit.
2014-03-19 12:32:50 +00:00
Julio Merino
d525bcd959 Migrate tools/regression/usr.bin/make/ to the new tests layout.
Note that these tests are for fmake, not bmake, and thus they are not
installed nor run when bmake is selected (the default).  Yes, I have
wasted a *ton* of time on moving tests for no real reason other than
ensuring they are not left behind.

But maybe, just maybe, it was not work in vain: the majority of these
tests also work with bmake and the few that don't may point at broken
stuff.  For example, the tests for the "archive" feature do not work
with bmake, but bmake's manpage and source tree seem to imply that they
should.  So... to be investigated later; need to poke sjg@.
2014-03-19 12:29:20 +00:00
Gleb Smirnoff
55fb7d688b Now, after r263102 we have ifi_oqdrops in if_data, restore printing of
output queue drops in netstat(1).

No driver, neither kernel fills this field in if_data, yet.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-03-19 03:33:32 +00:00
Attilio Rao
ce42e79310 Remove dead code from umtx support:
- Retire long time unused (basically always unused) sys__umtx_lock()
  and sys__umtx_unlock() syscalls
- struct umtx and their supporting definitions
- UMUTEX_ERROR_CHECK flag
- Retire UMTX_OP_LOCK/UMTX_OP_UNLOCK from _umtx_op() syscall

__FreeBSD_version is not bumped yet because it is expected that further
breakages to the umtx interface will follow up in the next days.
However there will be a final bump when necessary.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	jhb
2014-03-18 21:32:03 +00:00
Gleb Smirnoff
05b0160ef2 Make talk(1) capable of displaying UTF-8 characters.
Sponsored by:	Nginx, Inc.
2014-03-17 11:58:48 +00:00
Jilles Tjoelker
cf599562fa find: When performing -quit, finish pending -exec ... + command lines.
This avoids unexpected partial processing when a find command uses both
-quit and -exec ... +.

GNU find does the same.

MFC after:	1 week
2014-03-16 14:42:58 +00:00
Robert Watson
b881b8be1d Update most userspace consumers of capability.h to use capsicum.h instead.
auditdistd is not updated as I will make the change upstream and then do a
vendor import sometime in the next week or two.

MFC after:	3 weeks
2014-03-16 11:04:44 +00:00
Julio Merino
3a92d97ff0 Migrate most of tools/regression/usr.bin/ to the new tests layout.
I'm starting with the easy cases.  The leftovers need to be looked at a
bit more closely.

Note that this change _does_ modify the code of the old tests.  This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.

Also note that at least one test is known to be broken here.  Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that.  Will have to be
fixed separately.
2014-03-16 08:04:06 +00:00
Julio Merino
d14afb2adc Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.
This change was originally going to only migrate the usr.sbin tests but, as
it turns out, the usr.sbin/sa/ tests require files from usr.bin/lastcomm/
so it's better to just also migrate the latter at the same time.  The other
usr.bin tests will be moved separately.

To make these tests work within the test suite, some of them have required
changes to prevent modifying the source directory and instead just rely on
the current directory for file manipulation.
2014-03-16 04:09:22 +00:00
Gleb Smirnoff
66dcee729c Garbage collect long time obsoleted (or never used) stuff from routing API. 2014-03-15 06:49:32 +00:00
Eitan Adler
fdfda3af49 Use the system queue.h instead of bundling its own.
PR:		bin/187067
Submitted by:	lulf
2014-03-15 01:20:42 +00:00
Warner Losh
dbb83b6af0 Fix cut-and-paste error message. 2014-03-15 00:58:08 +00:00
Neel Natu
3447a66db8 Don't dump entries that were modified during the time the KTR buffer was being
copied to userspace. Failing to do this would result in entries at the bottom
of the ktrdump output to be more recent than entries at the top.

With this change the timestamps are monotonically decreasing going from the
top to the bottom of the ktrdump output.
2014-03-14 22:07:08 +00:00
Neel Natu
f8c8b7ee8f Fix an issue with ktrdump(8) where it would not print all entries in the
KTR buffer.

This happens when 'i' tries to wrap around from 0 to 'entries - 1'. Since 'i'
is a signed integer the modulo operation actually returns a negative number.

Fix this by computing the next index to use "by hand" instead of relying
on the modulo operator.
2014-03-14 21:35:16 +00:00
Julio Merino
f5fd950e35 Make bsd.test.mk the only public mk fragment for the building of tests.
Change {atf,plain,tap}.test.mk to be internal implementation details of
bsd.test.mk.  Makefiles that build tests should now only include bsd.test.mk
and declaratively specify what they want to build, without worrying about
the internal implementation of the mk files.

The reason for this change is to permit building test programs of different
interfaces from a single directory, which is something I had a need for
while porting tests over from src/tools/regression/.

Additionally, this change makes it possible to perform some other requested
changes to bsd.test.mk in an easier manner.  Coming soon.
2014-03-14 08:56:19 +00:00
Gleb Smirnoff
45c203fce2 Remove AppleTalk support.
AppleTalk was a network transport protocol for Apple Macintosh devices
in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was
a legacy protocol and primary networking protocol is TCP/IP. The last
Mac OS X release to support AppleTalk happened in 2009. The same year
routing equipment vendors (namely Cisco) end their support.

Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 06:29:43 +00:00
Eitan Adler
dda5b39711 multiple: Remove 3rd clause from BSD license where approved by the
regents and renumber.

This patch skips files in contrib/ and crypto/

Acked by:	imp
Discussed with:	emaste
2014-03-14 03:07:51 +00:00
Gleb Smirnoff
2c284d9395 Remove IPX support.
IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 02:58:48 +00:00
Gleb Smirnoff
b245f96c44 Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbit
interface, in the r241616 a crutch was provided. It didn't work well, and
finally we decided that it is time to break ABI and simply make if_baudrate
a 64-bit value. Meanwhile, the entire struct if_data was reviewed.

o Remove the if_baudrate_pf crutch.

o Make all fields of struct if_data fixed machine independent size. The
  notion of data (packet counters, etc) are by no means MD. And it is a
  bug that on amd64 we've got a 64-bit counters, while on i386 32-bit,
  which at modern speeds overflow within a second.

  This also removes quite a lot of COMPAT_FREEBSD32 code.

o Give 16 bit for the ifi_datalen field. This field was provided to
  make future changes to if_data less ABI breaking. Unfortunately the
  8 bit size of it had effectively limited sizeof if_data to 256 bytes.

o Give 32 bits to ifi_mtu and ifi_metric.
o Give 64 bits to the rest of fields, since they are counters.

__FreeBSD_version bumped.

Discussed with:	emax
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-03-13 03:42:24 +00:00
Poul-Henning Kamp
b0cba3367e Make ministat CRNL tolerant by stripping all isspace() from the tail
end of input lines.
2014-03-12 08:54:29 +00:00
Jilles Tjoelker
236a5a7938 install: Use posix_spawnp() for starting strip and improve error messages. 2014-03-08 23:05:28 +00:00
Gleb Smirnoff
46425317db Fix compilation for 32-bit machines. 2014-03-06 02:00:01 +00:00
Brad Davis
3e5184c65f - Clarify usage of the -f option.
Reviewed by:	gjb@, dru@, and Allan Jude
2014-03-05 02:10:10 +00:00
Gleb Smirnoff
5274e55eb3 Hide struct rtentry from userland. 2014-03-05 01:47:08 +00:00
Gleb Smirnoff
e3a7aa6f56 - Remove rt_metrics_lite and simply put its members into rtentry.
- Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This
  removes another cache trashing ++ from packet forwarding path.
- Create zini/fini methods for the rtentry UMA zone. Via initialize
  mutex and counter in them.
- Fix reporting of rmx_pksent to routing socket.
- Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode.

The change is mostly targeted for stable/10 merge. For head,
rt_pksent is expected to just disappear.

Discussed with:		melifaro
Sponsored by:		Netflix
Sponsored by:		Nginx, Inc.
2014-03-05 01:17:47 +00:00
Marcel Moolenaar
0f8d6cfc15 Increase MAXLINE to deal with longer paths.
Obtained from:	Juniper Networks, Inc.
2014-03-04 01:14:37 +00:00
Dimitry Andric
21efc33edc Apply fix for lldb not linking after the sparc backend import.
Reported by:	se
Pointy hat to:	dim
2014-03-01 16:07:17 +00:00
Eitan Adler
0f4d097284 ssh-copy-id: add restorecon call
In certain situations when creating an authorized_key file on a Linux machine
restorecon(1) may need to be called.  Therefore, attempt to run it if it exists.

MFC After:	1 week
Idea from:	https://bugzilla.redhat.com/show_bug.cgi?id=739989
2014-03-01 03:36:46 +00:00
Eitan Adler
df54ea8001 ssh-copy-id: avoid sending private keys; add -v option
To help avoid confusion: when attempting to send a key file check to see if a
file of the same name exists with a '.pub' suffix and send that instead.  This
mimics the behavior of other ssh-copy-id scripts.

Add -v passthrough.

Reported by:	dweimer <dweimer@dweimer.net>
Reported by:	feld
MFC After:	1 week
2014-03-01 03:17:46 +00:00
Dimitry Andric
bdc74e2bc0 Merge from head up to r262536. 2014-02-26 22:26:40 +00:00
Ed Maste
6ec4f0a5fa Update LLDB snapshot to upstream r202189
Highlights include (upstream revs in parens):

- Improvements to the remote GDB protocol client
  (r196610, r197579, r197857, r200072, and others)

- Bug fixes for big-endian targets
  (r196808)

- Initial support for libdispatch (GCD) queues in the debuggee
  (r197190)

- Add "step-avoid-libraries" setting
  (r199943)

- IO subsystem improvements (including initial work on a curses gui)
  (r200263)

- Support hardware watchpoints on FreeBSD
  (r201706)

- Improved unwinding through hand-written assembly functions
  (r201839)

- Handle DW_TAG_unspecified_parameters for variadic functions
  (r202061)

- Fix Ctrl+C interrupting a running inferior process
  (r202086, r202154)

- Various bug fixes for memory leaks, LLDB segfaults, the C++ demangler,
  ELF core files, DWARF debug info, and others.

Sponsored by:	DARPA, AFRL
2014-02-26 16:09:54 +00:00
Edward Tomasz Napierala
45cf0eab60 There is no need to prevent iscsictl from adding iSER session when there
is no iSER support in ctld and/or kernel; should the user make that mistake,
the output from "iscsictl -L" is enough to determine what the problem is.

Sponsored by:	The FreeBSD Foundation
2014-02-26 09:06:57 +00:00
Dimitry Andric
892620150f Merge from head up to r262415. 2014-02-23 23:33:11 +00:00
Pawel Jakub Dawidek
2c93e2a3bc Capability rights are held by descriptors, not processes.
Reported by:	jonathan
2014-02-23 22:13:16 +00:00
David Chisnall
aaeeeec365 Fix parsing multiple roots with whitespace between them.
Patch by:   Patrick Wildt
2014-02-23 21:13:07 +00:00
Christian Brueffer
8c91e67c8c Simplify the way the end of a singly linked list is followed (for adding
items), so it is more obvious that we aren't going to indirect through
a NULL pointer.

PR:		144723
Submitted by:	Garrett Cooper <yaneurabeya at gmail.com>
Obtained from:	NetBSD r1.19
MFC after:	2 weeks
2014-02-22 10:15:27 +00:00
Dimitry Andric
137470fbfb Add Makefile glue to build the Sparc backend libraries and link them
into the clang executable.
2014-02-20 22:22:39 +00:00
Peter Wemm
da64579a3b Match our implementation of iconv's inbuf argument. 2014-02-20 20:09:28 +00:00
Peter Wemm
f5f7a7f70a Import svn-1.8.8.
Highlights:
* Security fix for apache server plugin that we don't build or use
* sqlite performance improvements.
* bug fixes for edge cases and some other less common operations.
2014-02-20 19:48:47 +00:00
Edward Tomasz Napierala
bf4427d114 Make it clear that there are two ways to add a session using iscsictl(8),
and some options require configuration file.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2014-02-20 17:23:08 +00:00
Ed Maste
5eef691b3e Update LLDB bmake build for r262187
Sponsored by:	DARPA, AFRL
2014-02-18 20:25:02 +00:00
Ed Maste
adacc0725e Update lldb for clang/llvm 3.4 import
This commit largely restores the lldb source to the upstream r196259
snapshot with the addition of threaded inferior support and a few bug
fixes.

Specific upstream lldb revisions restored include:
   SVN      git
  181387  779e6ac
  181703  7bef4e2
  182099  b31044e
  182650  f2dcf35
  182683  0d91b80
  183862  15c1774
  183929  99447a6
  184177  0b2934b
  184948  4dc3761
  184954  007e7bc
  186990  eebd175

Sponsored by:	DARPA, AFRL
2014-02-17 18:50:03 +00:00
Eitan Adler
81479c5c55 calendar(1): don't segfault in invalid input
When the user supplies an invalid number of days provide a useful error message
instead of segfaulting.

PR:		bin/186697
Reported by:	kaltheat <kaltheat@gmail.com>
Submitted by:	oliver <oliver@beefrankly.org> (older version)
2014-02-17 03:24:00 +00:00
Dimitry Andric
f785676f2a Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3.  The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
2014-02-16 19:44:07 +00:00
Edward Tomasz Napierala
1de5b5eb55 Mention that rctl(8) was sponsored by the Foundation.
Sponsored by:	The FreeBSD Foundation
2014-02-16 08:42:52 +00:00
Bryan Drewery
c0a04e017b Rework rctl(8) manpage
- Note that kernel options are required
- Shift parameters around in SYNOPSIS to make it more clear that there are
  different modes
- For all literal symbols such as 'process' or 'loginclass' or 'wallclock',
  etc, make them into bold symbols with .Sy
- For each subject:subject-id:etc: use .Em to underline to make it more clear
  they relate to the rule syntax
- Document how devd(8) support works
- Move RSS warning to BUGS and replace RSS with 'memoryuse' since 'RSS' is not
  defined in the manpage
- Add more examples around listing existing rules
- Make rule syntax into a list to improve readability
- Add a list of subjects and their corresponding subject-id same as
  RESOURCES/ACTIONS have lists
- Note that rctl(8) takes affect on all current and future processes
- Note that amount can take human numbers
- Add reference to login.conf(5) in few places login class is mentioned

Reviewed by:	trasz
Approved by:	bapt (mentor)
MFC after:	1 week
2014-02-15 14:56:50 +00:00
Warren Block
639399ae07 Remove mention of minimum password length and upper/lower case checking,
patch supplied by Allan Jude <freebsd@allanjude.com>.  Add xref to
pam_passwdqc(8), where that testing is now done.

PR:		docs/184482
Submitted by:	Ryan Gerstenkorn <ryan_gerstenkorn@fastmail.fm>
Reviewed by:	jilles, eadler
MFC after:	3 days
2014-02-14 15:46:06 +00:00
Gleb Smirnoff
f0e49f6631 Whenever flowtable lookup fails, we do route lookup and then try to
insert flow entry. During the route lookup the critical section is
exited. It may happen, that after route lookup we will be executed
on an other CPU that already has such flowentry. Before this change
we simply freed the flowentry and returned to ip_output() with
failure.

Actually there is nothing wrong with using previously allocated
flow entry, updating it properly. Thus, make flowentry_insert()
return the new either old fle, and make use of it.

Count reuses as "collisions" and real inserts as "inserts".

Reviewed by:	adrian
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-02-14 10:56:26 +00:00
Adrian Chadd
6d9223ac7e Reword.
Suggestion:	glebius
2014-02-14 07:43:39 +00:00
Adrian Chadd
0e778c88c9 Don't insert a flowtable entry if the lle isn't yet valid.
Some of the collisions that are occuring are due to flowtable lookups
that succeed but have an invalid lle - typically because the L2 adjacency
lookup hasn't completed.  This would lead to a follow-up insert which
would then fail (ie, collision) and the code would fall through to doing
a slow-path L2/L3 lookup in the netinet/netinet6 code.

This patch simply aborts storing a new flowtable entry if the lle isn't
yet valid.

Whilst I'm here, add a new pcpu counter for the item so the number of
failures can be tracked separately from generic "collisions."

Reviewed by:	glebius
MFC after:	10 days
Sponsored by:	Netflix, Inc.
2014-02-14 00:05:09 +00:00
Gleb Smirnoff
9968f056d6 Fix world build WITHOUT_PF.
Sponsored by:	Nginx, Inc.
2014-02-12 09:59:48 +00:00
John Baldwin
2db08c03f0 Expose OBJT_MGTDEVICE VM objects used for GEM/TTM with drm2 as an
explicit object type.

Reviewed by:	kib
MFC after:	1 week
2014-02-11 21:57:37 +00:00
Edward Tomasz Napierala
57cf56ce65 Make iscsictl(8) properly handle (optional) semicolons in iscsi.conf,
instead of ignoring them and echoing them to stdout.

Sponsored by:	The FreeBSD Foundation
2014-02-10 15:04:59 +00:00
Edward Tomasz Napierala
5d386b72b1 Simplify.
Sponsored by:	The FreeBSD Foundation
2014-02-10 15:03:08 +00:00
Edward Tomasz Napierala
d5874fc4f1 Remove unused variable.
Sponsored by:	The FreeBSD Foundation
2014-02-10 15:02:02 +00:00
Edward Tomasz Napierala
5381f86246 Yacc cleanup; no functional changes.
Sponsored by:	The FreeBSD Foundation
2014-02-10 15:01:24 +00:00
Joel Dahl
7e700c30d2 mdoc: minor paragraph fixes. 2014-02-08 13:37:02 +00:00
Joel Dahl
3d9335a67e Correct example.
Submitted by:    Jason McIntyre <jmc@kerhand.co.uk>
                 Thomas Klausner <wiz@netbsd.org>
2014-02-08 13:29:35 +00:00
Gleb Smirnoff
5d6d7e756b o Revamp API between flowtable and netinet, netinet6.
- ip_output() and ip_output6() simply call flowtable_lookup(),
    passing mbuf and address family. That's the only code under
    #ifdef FLOWTABLE in the protocols code now.
o Revamp statistics gathering and export.
  - Remove hand made pcpu stats, and utilize counter(9).
  - Snapshot of statistics is available via 'netstat -rs'.
  - All sysctls are moved into net.flowtable namespace, since
    spreading them over net.inet isn't correct.
o Properly separate at compile time INET and INET6 parts.
o General cleanup.
  - Remove chain of multiple flowtables. We simply have one for
    IPv4 and one for IPv6.
  - Flowtables are allocated in flowtable.c, symbols are static.
  - With proper argument to SYSINIT() we no longer need flowtable_ready.
  - Hash salt doesn't need to be per-VNET.
  - Removed rudimentary debugging, which use quite useless in dtrace era.

The runtime behavior of flowtable shouldn't be changed by this commit.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-02-07 15:18:23 +00:00
David Malone
d642560225 Let units deal with Gas Mark and Stufe. 2014-02-06 15:55:29 +00:00