Commit Graph

12324 Commits

Author SHA1 Message Date
Glen Barber
582727cc63 MFH
Sponsored by:	The FreeBSD Foundation
2016-01-05 14:21:02 +00:00
Xin LI
a15691bf11 MFV r293125: less v481.
MFC after:	1 month
Relnotes:	yes
2016-01-05 05:25:16 +00:00
Glen Barber
b626f5a73a MFH r289384-r293170
Sponsored by:	The FreeBSD Foundation
2016-01-04 19:19:48 +00:00
Ed Maste
0a97e59728 Update build infrastructure for LLDB 3.8 2016-01-04 00:02:58 +00:00
Dimitry Andric
ffa548ae3e Next part of updating llvm/clang build glue: getting the
WITH_CLANG_EXTRAS tools built.
2015-12-31 17:37:35 +00:00
Dimitry Andric
34cdd77646 First part of updating llvm/clang build glue: getting llvm-tblgen,
clang-tblgen and clang itself built.
2015-12-31 14:39:45 +00:00
Dimitry Andric
28db8b1226 Drop the clang patch which adds recognition of 'CC' suffixes as aliases
for --driver-mode=g++, since this was never upstreamed.  For backwards
compatibility, add a wrapper shell script.

MFC after:	1 week
2015-12-30 16:14:30 +00:00
David Chisnall
c64a3eaf92 Improvements to BSD-licensed DTC.
- Added an expression parser so that expressions from headers are now working
- Fixed missing null terminators on cross references
- Disabled exceptions / RTTI in the build for smaller binaries
- Changed phandle order generation to be identical to GPL'd dtc
2015-12-29 16:29:42 +00:00
Ulrich Spörlein
c9e1c304c1 Fix type mismatches for malloc(3) and Co.
This is rather pedantic, as for most architectures it holds that
sizeof(type *) == sizeof(type **)

Found by:	clang static analyzer
Reviewed by:	ed
Differential Revision: https://reviews.freebsd.org/D4722
2015-12-29 11:24:41 +00:00
Marcelo Araujo
18b14b4415 Add on systat -vm the ability to display the physical and kernel memory
percent usage.

PR:		bin/203917
Submitted by:	ota <ota@j.email.ne.jp>
Approved by:	bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D4281
2015-12-28 02:07:56 +00:00
Simon J. Gerraty
6e05054094 Merge bmake-20151220
Fixed clearing suffixes impact on null suffix
2015-12-25 16:19:21 +00:00
Baptiste Daroussin
e05c3a9f6a Since removal of oldnfs support linking to kvm is not needed anymore 2015-12-24 11:41:21 +00:00
Craig Rodrigues
77624aed80 Remove extraneous characters
Noticed by:     markj
Reviewed by:    allanjude
2015-12-23 07:28:48 +00:00
John Baldwin
265e58989d Move the mkioctls script to libsysdecode and use it to generate a
sysdecode_ioctlname() function.  This function matches the behavior
of the truss variant in that it returns a pointer to a string description
for known ioctls.  The caller is responsible for displaying unknown
ioctl requests.  For kdump this meant moving the logic to handle unknown
ioctl requests out of the generated function and into an ioctlname()
function in kdump.c instead.

Differential Revision:	https://reviews.freebsd.org/D4610
2015-12-22 20:33:49 +00:00
Christian Brueffer
2a952cf258 RIP Juergen Lock (nox@FreeBSD.org), you and your contributions won't be forgotten. 2015-12-17 10:37:11 +00:00
George V. Neville-Neil
9d2d8e7bec Switch the IPsec related statistics to using the built in sysctl
variable set rather than reading from kernel memory.
This also makes the -z (zero) flag work correctly

MFC after:	1 week
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D4591
2015-12-17 02:02:09 +00:00
John Baldwin
d6fb489498 Start on a new library (libsysdecode) that provides routines for decoding
system call information such as system call arguments.  Initially this
will consist of pulling duplicated code out of truss and kdump though it
may prove useful for other utilities in the future.

This commit moves the shared utrace(2) record parser out of kdump into
the library and updates kdump and truss to use it.  One difference from
the previous version is that the library version treats unknown events
that start with the "RTLD" signature as unknown events.  This simplifies
the interface and allows the consumer to decide how to handle all
non-recognized events.  Instead, this function only generates a string
description for known malloc() and RTLD records.

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D4537
2015-12-15 00:05:07 +00:00
Alex Kozlov
46021e0128 - Properly set mode and atime/ctime for symlinks
Approved by:	des
2015-12-13 21:31:45 +00:00
Alex Kozlov
04e17b6a6d - Allow to extract symlinks
- Implement 4-digit year format listing (-y option)
- Improve detection of text files
- Use %ju for error_count as it is unsigned

Obtained from:	NetBSD
Approved by:	des
2015-12-11 23:52:08 +00:00
Alex Kozlov
2aa7d573a0 - Remove stray whitespaces
Approved by:	des
2015-12-11 23:46:33 +00:00
Warner Losh
4224509a36 Add ppcboot FAT type. Needed to create a bootable powerpc image.
Differential Review: https://reviews.freebsd.org/D4407
2015-12-11 05:39:42 +00:00
Bryan Drewery
1ef7db0f31 Use LIBADD for pthread.
Sponsored by:	EMC / Isilon Storage Division
2015-12-10 01:16:22 +00:00
Simon J. Gerraty
ac3446e962 Merge bmake-20151201 2015-12-08 01:29:07 +00:00
Bryan Drewery
b2fe867a0f DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2015-12-07 23:53:01 +00:00
Bryan Drewery
4d293dd8dc Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-12-07 16:08:13 +00:00
Bryan Drewery
becf96a52d Remove disconnected directory RETEST. 2015-12-04 05:00:51 +00:00
Bryan Drewery
eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Tony Finch
383f792e9c Avoid -Wmissing-initializer 2015-12-03 14:32:54 +00:00
Tony Finch
ef4eec8a6d Update to upstream version 2.11
Improved #if expression evaluator and safer modify-in-place.

Obtained from:	http://dotat.at/prog/unifdef
MFC after:	1 week
2015-12-03 14:21:55 +00:00
Bryan Drewery
3c89d6b0e3 Don't override LIB*DIR variables from src.libnames.mk.
In some cases switch to the LIB*SRCDIR value.

These recently were defined in r291327 and r291619.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 22:20:04 +00:00
Enji Cooper
c281fdb153 Fix typos in error messages dealing with unknown groups/users
MFC after: 1 month
X-MFC with: r291447, r291452
Sponsored by: EMC / Isilon Storage Division
2015-12-01 19:37:24 +00:00
Craig Rodrigues
06691045ba Add more text to explain --libxo flag. 2015-12-01 19:18:53 +00:00
Allan Jude
3410663468 Some problems were introduced during the libxo-ification of vmstat, fix them
stop vmstat -i segfaulting
remove duplicate header from vmstat -i
do not pad the name of the interupt in encoded outputs
fix stray % and missing } in the header for vmstat -i
add outer container to vmstat -i
add missing xo_flush in vmstat -i (when run with an interval or delay)
add outer container to vmstat -m
do not pad the name of malloc areans
add outer container to vmstat -z
do not pad the name of memory zones

Reviewed by:	rodrigc
Approved by:	bapt (mentor)
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4263
2015-12-01 16:31:07 +00:00
Hajimu UMEMOTO
4fc31adf6a At the time a destination or a gateway of `netstat -r'
protrudes its field, narrow the next field to raise
readability bit.
2015-12-01 16:04:50 +00:00
Edward Tomasz Napierala
508744b2b1 Fix rctl rule filters - eg the 'rctl -r :' case.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-12-01 14:02:14 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery
cf990407e1 Update dependencies after r291406 added libelf to libkvm.
Unfortunately filemon/meta mode tracks all indirect dependencies here
since ld(1) is reading libelf when linking in libkvm.  Churn would be
reduced if this was able to be limited to direct dependencies.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:48 +00:00
Edward Tomasz Napierala
5c859bfb63 Improve error reporting to clearly show problematic rules.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-29 13:14:45 +00:00
Edward Tomasz Napierala
4cf0d89598 Simplify rule retrieval and improve error handling.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-29 12:33:56 +00:00
Edward Tomasz Napierala
5e7a25553c Fix some memory management problems.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-29 12:21:02 +00:00
Edward Tomasz Napierala
f4e361a725 Handle asprintf(3) errors in a standards-compliant way.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-29 12:09:12 +00:00
Edward Tomasz Napierala
0971623e61 Rewrite the rctl(8) utility to make it possible to add multiple rules
in a single run.  This speeds up operation with large rulesets.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-29 12:01:36 +00:00
Edward Tomasz Napierala
478f7a726b User and group identifiers the rctl(8) utility receives from the kernel
are always in numeric form; don't try to resolve them by names.  This
speeds up rule listing with large rulesets by about 50%.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-29 11:30:17 +00:00
Bryan Drewery
7fdd45b091 Use LIBEXECDIR for /usr/libexec.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-26 01:14:40 +00:00
Bryan Drewery
114350b9de Replace DPSRCS that work fine in SRCS.
This is so that 'make depend' is not a required build step in these
files.

DPSRCS is overall unneeded.  DPSRCS already contains SRCS, so anything
which can safely be in SRCS should be.  DPSRCS is mostly just a way to
generate files that should not be linked into the final PROG/LIB.  For
headers and grammars it is safe for them to be in SRCS since they will
be excluded during linking and installation.

The only remaining uses of DPSRCS are for generating .c or .o files that
must be built before 'make depend' can run 'mkdep' on the SRCS c files
list.  A semi-proper example is in tests/sys/kern/acct/Makefile where a
checked-in .c file has an #include on a generated .c file.  The
generated .c file should not be linked into the final PROG though since
it is #include'd.  The more proper way here is just to build/link it in
though without DPSRCS.  Another example is in sys/modules/linux/Makefile
where a shell script runs to parse a DPSRCS .o file that should not be
linked into the module.  Beyond those, the need for DPSRCS is largely
unneeded, redundant, and forces 'make depend' to be ran.  Generally,
these Makefiles should avoid the need for DPSRCS and define proper
dependencies for their files as well.

An example of an improper usage and why this matters is in usr.bin/netstat.
nl_defs.h was only in DPSRCS and so was not generated during 'make all',
but only during 'make depend'.  The files including it lacked proper
depenencies on it, which forced running 'make depend' to workaround that
bug.  The 'make depend' target should mostly be used for incremental build
help, not to produce a working build.  This specific example was broken in
the meta build until r287905 since it does not run 'make depend'.

The gnu/lib/libreadline/readline case is fine since bsd.lib.mk has 'OBJS:
SRCS:M*.h' when there is no .depend file.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	1 week
2015-11-25 20:38:17 +00:00
Bryan Drewery
277fbb92d5 Remove redundant DPSRCS which were already in SRCS.
DPSRCS already contains all of SRCS.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 20:38:07 +00:00
Bryan Drewery
f198d81722 Fix spelling error. 2015-11-25 19:48:09 +00:00
Bryan Drewery
5a0d38b3aa META MODE: Remove unneeded libmd.host dependency for xinstall.host.
This is chasing r291026.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:55 +00:00
Bryan Drewery
4aa63711a7 META MODE: Fix 'make bootstrap-tools'.
The main problem was bitrot after elftoolchain being swapped in for the
GNU toolchain.

This also reworks how the list of 'host allowed' libraries is determined
to only allow INTERNALLIBs, which is needed for libelftc to come in.

For usr.bin/readelf use the same hack, as libelf and libdward, to bring in
the needed sys/ headers for host builds.  This has not yet been a problem due
to readelf not being built as a host tool in buildworld.  This is possible
in the meta build though when building the toolchain.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:51 +00:00
Bryan Drewery
b791fbe630 META MODE: Don't create .meta files when symlinking sources into the obj directory.
Tracking these leads to situations where meta mode will consider the
file to be out of date if /bin/sh or /bin/ln are newer than the source
file.  There's no reason for meta mode to do this as make is already
handling the rebuild dependency fine.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:43 +00:00
Bryan Drewery
393608176b META MODE: Fix 'make the-lot' with recent locale changes
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:13:28 +00:00
Hajimu UMEMOTO
0eaa116e1e Fix udp entry of `netstat -TW'. 2015-11-25 11:20:54 +00:00
Hajimu UMEMOTO
046aad399a Correct alignment of the addresses in the `netstat -aW' output. 2015-11-24 14:25:40 +00:00
Kurt Lidl
3164bb81e6 Add myself (lidl) to the calendar.freebsd file.
Approved by:	rpaulo (mentor)
Differential Revision:	https://reviews.freebsd.org/D4264
2015-11-24 13:47:21 +00:00
Hajimu UMEMOTO
06ff7ccb5f Add missing error check after xo_parse_args() in netstat(8).
Submitted by:	Oliver Pinter
Differential Revision:	https://reviews.freebsd.org/D4233
2015-11-24 11:07:37 +00:00
Bryan Drewery
6a270e17f3 Remove unneeded libutil dependency for sendmail.
It included libutil.h for setproctitle(3), which was moved from libutil to libc
in r65353 in 2000.

Reviewed by:	gshapiro [sendmail change]
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4261
2015-11-24 04:19:55 +00:00
Pedro F. Giffuni
6659f97630 bc(1): Fix memory corruption issues
Fix crashes and hangs found by AFL.
Improve handling of non-ascii chars.

Obtained from:	OpenBSD (CVS rev 1.49)
2015-11-24 04:15:13 +00:00
Marcelo Araujo
19d3ba993d Compute the median of the data set as the midpoint between the two middle
values when the data set has an even number of elements.

PR:		201582
Submitted by:	Marcus Reid <marcus@blazingdot.com>
Reviewed by:	imp
Approved by:	bapt (mentor)
2015-11-24 02:30:59 +00:00
Pedro F. Giffuni
bafb3a75ca bc: sync with OpenBSD
tty.c Rev. 1.3
Avoid unintended problems with operator precedence when doing an
assignment and comparison.

bc.1, Rev. 1.31, 1.32
'.Ql Quit' -> '.Ql quit' because only the lowercase command is valid.
Clarify sentence about `quit` in BUGS section.

extern.h, Rev. 1.12
whitespace

bc.y, Rev. 1.47
Prefer setvbuf() to setlinebuf() for portability

Obtained from:	OpenBSD
MFC after:	2 weeks
2015-11-22 02:43:14 +00:00
Mark Johnston
f226507c00 Add a missing brace to fix vmstat -s output. 2015-11-21 23:04:12 +00:00
Baptiste Daroussin
dcee298e48 Revert a modification that crept in and should not 2015-11-21 11:06:20 +00:00
Baptiste Daroussin
46ef9581dd Synchronize m4(1) with OpenBSD 2015-11-21 11:05:38 +00:00
Baptiste Daroussin
c9a1870367 colldef(1) does not need the libc's internal collate.h header anymore 2015-11-21 10:52:32 +00:00
Baptiste Daroussin
dee69ea53c Reintegrate colldef(1) and mklocale(1)
While those tools are not needed anymore they are necessary to build FreeBSD 9
and 10. it does not hurt to keep those tools around until both 9 and 10 branch
become EOLed.

Modify colldef(1) to build after the change in the collation header, and ensure
it does produce the same collation definition it used to generate for 9 and 10

Reported by:	Oliver Pinter
2015-11-20 23:15:05 +00:00
Hajimu UMEMOTO
857357b6c9 Don't truncate an interface name when -W option is specified.
Spotted by:	Jim Thompson <jim__at__netgate.com>
MFC after:	1 week
2015-11-20 12:32:49 +00:00
Hajimu UMEMOTO
b1a302a533 Avoid core dump when output style is html. 2015-11-20 12:15:58 +00:00
Baptiste Daroussin
d0b9260683 install: do not follow symlinks
In case the target of install is a dead symlink, install(1) used to not
consider it as "existing" because of the usage of stat(2) instead of
lstat(2).  meaning the old file (the symlink) is not removed before the new
file is created. The symlink is being followed and the new file becoming the
target of the symlink instead of the target of install(1)

Reviewed by:	jhb, brooks
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4191
2015-11-20 08:45:59 +00:00
Craig Rodrigues
0e51ea9106 Convert vmstat to use libxo.
This patch was based on this patch:
https://github.com/Juniper/libxo/blob/master/patches/vmstat.patch

by Phil Shafer at Juniper Networks, but updated to the latest
vmstat code.

Reviewed by:           allanjude
Differential Revision: https://reviews.freebsd.org/D3935
2015-11-20 05:15:34 +00:00
Craig Rodrigues
749f65e3e3 Use print as a function for Python 3 [PEP 3105]
Import print_function from the __future__ module
to activate this for Python 2.  This works as far back as Python 2.6.0a2:
   https://docs.python.org/2/library/__future__.html

[PEP 3105] https://www.python.org/dev/peps/pep-3105/
2015-11-19 00:01:52 +00:00
Bryan Drewery
20f680588a Remove unneeded libmd from bootstrap-tools (reverting r246784).
The bootstrap-tools are supposed to be host tools, which in most cases, use
host headers and libraries.  As such, directly including the src tree's headers
for libmd here causes the need to link libmd in since it will be built with
the new symbols (which /usr/lib/libmd.so) won't have unless it is new enough.
During the target build in buildworld the target headers are staged into
WORLDTMP and used via --sysroot, allowing the target xinstall to be built with
the new/target libmd.

The .PATH here was also not doing anything since xinstall does not use libmd
source files.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-11-18 21:37:46 +00:00
Hajimu UMEMOTO
d48d68fa9e JSON doesn't permit a hexadecimal notation of an integer. 2015-11-17 12:09:57 +00:00
Simon J. Gerraty
948f327ee4 Rename META_MODE option to DIRDEPS_BUILD
This allows META_FILES option to be renamed META_MODE.
Also add META_COOKIE_TOUCH for use in targets that can benefit
from a cookie when in meta mode.

Differential Revision:	https://reviews.freebsd.org/D4153
Reviewed by:	bdrewery
2015-11-14 03:24:48 +00:00
Dag-Erling Smørgrav
af1aec74f5 There is no more point in indexing /var/db/freebsd-update than there is in
indexing /var/db/portsnap, which was already in PRUNEPATHS.

MFC after:	1 week
2015-11-13 06:16:12 +00:00
Enji Cooper
dd76c272b8 Add some basic tests that exercise cputime limits with limits(1)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-09 01:05:31 +00:00
Baptiste Daroussin
c5aac62ae4 lower again the warnings and remove the pragmas unsupported by gcc 4.2.1 2015-11-08 22:23:21 +00:00
Baptiste Daroussin
55b270e68c Eliminate some gcc pragmas 2015-11-08 21:22:24 +00:00
Baptiste Daroussin
8c859b074e Fix build of localedef(1) on arm where wchar_t is an unsigned int 2015-11-07 22:57:00 +00:00
Baptiste Daroussin
00d10c2c70 Rewrite the histoty part
Fix information about "Dragonfly-style" format which on freebsd is named
BSD-style

Noted by:	bdrewery
2015-11-07 21:07:40 +00:00
Baptiste Daroussin
5b3b54e06c Improve localedef(1) manpage
Obtained from:	DragonflyBSD
2015-11-07 20:36:54 +00:00
Baptiste Daroussin
29660f86e2 Bump warning level 2015-11-07 20:31:23 +00:00
Baptiste Daroussin
a0e395a47f Use const where needed instead of using pragmas to work around the warnings 2015-11-07 20:29:23 +00:00
Baptiste Daroussin
557a07f08a Make bsd declaration static 2015-11-07 20:27:31 +00:00
Baptiste Daroussin
5d21db0905 Fix an off by one due to bad conversion from avl(3) to tree(3)
Readd calloc as it was not the issue just the messenger

Submitted by:	dim
Found by:	Address Sanitizer
2015-11-07 19:54:40 +00:00
Baptiste Daroussin
e12838d367 Run memset only after having checked the return of malloc
Submitted by:	pluknet
2015-11-07 16:45:51 +00:00
Baptiste Daroussin
6cdc211add Workaround an issue on i386 to unbreak the build until the real issue is tracked
down
2015-11-07 16:22:29 +00:00
Baptiste Daroussin
78be8e6732 Fix build on arm64 2015-11-07 15:03:45 +00:00
Baptiste Daroussin
99b72f8fa4 Add missing header 2015-11-07 12:11:17 +00:00
Baptiste Daroussin
9f3e8dc233 Fix typo 2015-11-07 11:08:19 +00:00
Baptiste Daroussin
3e4f384ed2 Merge from head r290483 2015-11-07 11:02:33 +00:00
Baptiste Daroussin
2d32cdcdd9 Improve soelim(1) manpages
Submitted by:	Sascha Wildner <saw@online.de>
2015-11-07 01:58:23 +00:00
Hajimu UMEMOTO
b670e89ac2 Do not truncate addresses when printing in encoded format. 2015-11-06 14:50:23 +00:00
Hajimu UMEMOTO
fb3ab86f32 - Fix alignment for padding link address.
- Trim whitespace of link address.
2015-11-06 14:35:22 +00:00
Enji Cooper
f9b3502ce1 Fix compiling netstat after r290367 by substituting sys/types.h for
sys/param.h, as sys/param.h defines the MAX(..) macro

Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de>
Pointyhat to: ume
2015-11-06 08:43:12 +00:00
Bryan Drewery
7cda87fc70 Add SUBDIR_PARALLEL.
None of these libraries depend on each other.

Submitted by:	Jia-Shiun Li <jiashiun@gmail.com>
MFC after:	2 weeks
2015-11-06 00:06:10 +00:00
Edward Tomasz Napierala
18e1f46eae Make rctl(8) use more reasonable buffer size for retrieving the rules.
Reviewed by:	mjg@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-05 19:15:39 +00:00
Edward Tomasz Napierala
6ced1f7802 Fix markup in rctl(8) - the 'rule' or 'filter' arguments are not optional.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-05 17:26:56 +00:00
Hajimu UMEMOTO
cca052c621 Give enough room for addresses when -W option is specified. 2015-11-05 11:06:46 +00:00
Hajimu UMEMOTO
011ae9c907 Fix alignment of `Drop' header. 2015-11-05 11:04:43 +00:00
Hajimu UMEMOTO
f3ffc9fdf9 Use returned network name from getnetbyaddr() correctly. 2015-11-05 11:02:28 +00:00
Hajimu UMEMOTO
6f53a03868 Revert previous workaround. This problem was fixed
by r290318.
2015-11-05 10:58:19 +00:00
Hajimu UMEMOTO
6ad5f7ca01 Since sa->sa_len doesn't match sizeof(struct sockaddr_dl),
getnameinfo() fails against sockaddr_dl.  This commit is workaround
for this problem.
2015-11-04 19:09:42 +00:00
Hajimu UMEMOTO
3e687cd867 Fix alignment of AF_LINK address. 2015-11-04 19:05:04 +00:00
Hajimu UMEMOTO
86a598950f Simplify r290367 using asterisk for a field width
and precision.
2015-11-04 16:59:12 +00:00
Hajimu UMEMOTO
38f16ca658 Unify AF_INET case and AF_INET6 case. 2015-11-04 15:05:15 +00:00
Hajimu UMEMOTO
bd4fcecaca Change to not truncate an interface name when -W option
is specified.
2015-11-04 14:57:46 +00:00
Hajimu UMEMOTO
38507af333 Mask an IPv6 network address. 2015-11-04 14:47:10 +00:00
Hajimu UMEMOTO
8e2d18a7c5 Restore an interface name field to left align. 2015-11-04 13:59:13 +00:00
Craig Rodrigues
a36eca08bb Rename libohash to libopenbsd.
libopenbsd is an internal library which
to bring in compatibility stuff from OpenBSD.
This will allow us to bring in more
OpenBSD utilities into the FreeBSD base system.

We similarly use libnetbsd for bringing in stuff from NetBSD.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D4078
2015-11-04 07:20:55 +00:00
Andrey A. Chernov
0755c17500 Check for (old|new)size + 1 overflows off_t.
PR:     204230
MFC after:      1 week
2015-11-03 17:27:24 +00:00
Andrey A. Chernov
8f94ce2876 Use meaningful errno for ssize_t overflow in read().
Catch size_t overflow in malloc().

PR:     204230
MFC after:      1 week
2015-11-03 09:50:10 +00:00
Baptiste Daroussin
3c3feed41a Merge from head 2015-11-01 21:17:38 +00:00
Baptiste Daroussin
d79cdd21de libc: Fix (and improve) nl_langinfo (CODESET)
The output of "locale charmap" is identical to the result of
nl_langinfo (CODESET) for any given locale.  The logic for returning the
codeset was very simplistic.  It just returned portion of the locale name
after the period (e.g. en_FR.ISO8859-1 returned "ISO8859-1").

When softlinks were added to locales, this broke.  e.g.:
   en_US returned ""
   en_FR.UTF8 returned "UTF8"
   en_FR.UTF-8 returned "UTF-8"
   zh_Hant_HK.Big5HKSCS returned "Big5HKSCS"
   zh_Hant_TW.Big5 returned "Big5"
   es_ES@euro returned ""

In order to fix this properly, the named locale cannot be used to
determine the encoding.  This information was almost available in the
rune data.  Unfortunately, all the single byte encodings were listed
as "NONE" encoding.

So I adjusted localedef tool to provide more information about the
encoding.  For example, instead of "NONE", the LC_CTYPE used by
fr_FR.ISO8859-15 is now encoded as "NONE:ISO8859-15".  The locale
handlers now check if the first four characters of the encoding is
"NONE" and if so, treats it as a single-byte encoding.

The nl_langinfo handling of CODESET was adjusting accordingly.  Now the
following is returned:
   en_US returns "ISO8859-1"
   fr_FR.UTF8 returns "UTF-8"
   fr_FR.UTF-8 returns "UTF-8"
   zh_Hant_HK.Big5HKSCS returns "Big5"
   zh_Hant_TW.Big5 returns "Big5"
   es_ES@euro returns "ISO8859-15"

as before, "C" and "POSIX" locales return "US-ASCII".  This is a big
improvement.  The result of nl_langinfo can never be a zero-length
string and it will always exclusively one of the values of the
character maps of /usr/src/tools/tools/locale/etc/final-maps.

Submitted by:	marino
Obtained from:	DragonflyBSD
2015-11-01 12:00:55 +00:00
Ed Schouten
b0e787276b Make truss work for CloudABI processes on aarch64.
This change copies over amd64-cloudabi64.c to aarch64-cloudabi.c and
adjusts it to fetch the proper registers on aarch64. To reduce the
amount of shared code, the errno conversion function is moved into a
separate source file.

Reviewed by:	jhb, andrew
Differential Revision:	https://reviews.freebsd.org/D4023
2015-10-30 08:11:37 +00:00
Bryan Drewery
bd9302d862 Check archive_entry_new() result.
Coverity CID:	1331341
2015-10-29 19:28:21 +00:00
Bryan Drewery
7d8f797b72 Use more appropriate ${SHAREDIR} rather than /usr/share.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-27 23:35:02 +00:00
Xin LI
199c446625 Update NetBSD RCS IDs to reflect the changes being upstreamed.
MFC after:	13 days
X-MFC-With:	r290024
2015-10-27 21:26:05 +00:00
Xin LI
354ed04257 In gunzip(1), treat trailing garbage as a warning and not an error. This
allows scripts to distinguish it between real fatal errors, for instance a
CRC mismatch.

Update manual page for the behavior change.

PR:		bin/203873
Submitted by:	Eugene Grosbein <eugen grosbein net>
MFC after:	2 weeks
2015-10-26 22:29:58 +00:00
David Chisnall
70d7ec6737 Update some obsolete information in the HACKING document.
Reported by:	bapt
2015-10-26 11:02:57 +00:00
David Chisnall
e713ba26f2 Ensure that dtc is built in C++11 mode.
Reported by:	George Abdelmalik
2015-10-26 10:37:17 +00:00
David Chisnall
a0706eb457 Lots of improvements to the BSD-licensed dtc
- Various fixes to includes (including recursive includes)
- Lots of testing that the output exactly matches GPL'd dtc
- Lots of bug fixes to merging
- Fix incorrect mmap usage
- Ad-hoc memory management replaced with C++11 unique_ptr and similar

Patrick Wildt has successfully run many (all?) of the GPL dtc test suite.
2015-10-25 14:52:16 +00:00
Baptiste Daroussin
44a94685f3 timeout(1): fix the acceptable range values for parse_signal()
Before both 0 and sys_nsig would be successfully returned by parse_signal()
although being invalid signal numbers.

PR:		Alexandre Perrin <alex@kaworu.ch>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D3990
2015-10-24 13:47:03 +00:00
Baptiste Daroussin
902b9f79f7 Fix some mdoc(7) issues
Obtained from:	DragonflyBSD
2015-10-24 13:43:10 +00:00
Michael Tuexen
2a95561f19 Bump date. Missed in r289873.
MFC after:	1 week
X-MFC with:	r289873
2015-10-24 09:41:43 +00:00
Michael Tuexen
1eaa568237 Add support to systat to display SCTP statistics.
MFC after: 1 week
2015-10-24 09:34:40 +00:00
Bryan Drewery
a1a3d6f4c1 Replace gcc reference with 'cc' and document the default ${CC}.
MFC after:	1 week
2015-10-24 05:16:30 +00:00
Simon J. Gerraty
4c620fe5c4 Merge bmake 20151020 2015-10-23 17:38:01 +00:00
Bryan Drewery
58144364e9 dtc needs to be installed if MK_GPL_DTC is not set, which doesn't fit into the
SUBDIR.yes pattern well.

This fixes installation of the BSDL dtc after r288904.

Reported by:	jhibbits
Discussed with:	imp
Sponsored by:	EMC / Isilon Storage Division
2015-10-23 17:24:34 +00:00
Devin Teske
bf7a0eeb92 dpv(1) merged to stable/10 before release/10.2.0
MFC after:	3 days
X-MFC-to:	stable/10
2015-10-23 07:38:34 +00:00
Gabor Kovesdan
a7bc18929d -C and -c allow at most one input file. Ensure this is the case when the
input files are specified through --files0-from.

Submitted by:	tim@OpenBSD
Obtained from:	OpenBSD
MFC after:	1 week
2015-10-22 10:57:15 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Baptiste Daroussin
4ec37af6c9 getconf(1): Fix typo. _POSIX_V6_LP64_OFFBIG -> _POSIX_V6_LPBIG_OFFBIG.
Submitted by:	Sascha Wildner <saw@online.de>
Obtained from:	DragonflyBSD
MFC after:	3 days
2015-10-19 21:06:30 +00:00
Baptiste Daroussin
71e8badedc Actually only T_ISDIGIT should be flagged as _E4 2015-10-19 14:48:31 +00:00
Baptiste Daroussin
227d35dac0 With regard to ctype, digits (e.g. 0 to 9) and xdigits (the 0 to 9 portion
of hexidecimal numbers) are all considered "numbers".  (Note that while
all digits are numbers, not all numbers are digits).

Enhance localedef to automatically set the "number" characteristic when
it encounters a digit or xdigit definition. This fixes malfunctionning
isalnum(3)

Obtained from:	DragonflyBSD
2015-10-19 14:30:28 +00:00
Baptiste Daroussin
031c294c1d Merge from head 2015-10-19 11:51:10 +00:00
Enji Cooper
550d2b80ec Make libxo depend on libutil because it uses humanize_number after r287111
Remove overlinking in lib/libxo/tests, sbin/savecore, and
usr.bin/{iscsictl,wc,xo}

PR: 203673
Sponsored by: EMC / Isilon Storage Division
2015-10-18 07:30:50 +00:00
Edward Tomasz Napierala
fd3996c90a Remove write-only variable.
Submitted by:	Dominic Marks
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-10-17 16:05:42 +00:00
Edward Tomasz Napierala
1dba27c1bf Add -w flag to iscsictl(8) utility, to make it wait for successfull
session establishment.  Scripting is kind of hard without it.

Reviewed by:	mav@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3872
2015-10-17 13:06:52 +00:00
Jung-uk Kim
a41dab8fc9 Add support for ARM EABI.
MFC after:	1 week
2015-10-16 17:50:36 +00:00
Glen Barber
324fd1ce05 MFH to r289370
Sponsored by:	The FreeBSD Foundation
2015-10-15 17:36:56 +00:00
Ed Maste
a4c8dbbd87 mkimg: support fat16b partitions (MBR type 06h)
Reviewed by:	marcel
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3894
2015-10-15 01:09:14 +00:00
Baptiste Daroussin
7d710f0522 Merge from head 2015-10-13 20:57:37 +00:00
Baptiste Daroussin
8833f5e9c2 eliminate need for "print" definition
By having space automatically classified as "print" type, we can
eliminate the print section from ctype src files completely (they
are just "graph" plus "<space>".

Obtained from:	Dragonfly
2015-10-13 20:45:29 +00:00
Baptiste Daroussin
f5dde0166d Commit log from Dragonfly:
FreeBSD extended ctypes to include numbers (e.g. isnumber()) but never
actually implemented it.  The isnumber() function was equivalent to the
isdigit() function in every case.

Now that DragonFly's ctype source files have number definitions, the
number ctype can finally be implemented.  It's given a new flag _CTYPE_N.
The isalnum() and iswalnum() functions have been changed to use this
flag rather than the _CTYPE_D digit flag.

While isalnum(), isnumber(), and their wide equivalents now return
different values in locale cases, the ishexnumber() and iswhexnumber()
functions are unchanged.  They are still aliases for isxdigit() and
iswxdigit().

Also change ctype.h for isdigit and isxdigit to use sbistype like the
other functions.

Obtained from:	dragonfly
2015-10-13 20:43:49 +00:00
Baptiste Daroussin
becbad1f6e Merge from head 2015-10-13 19:44:36 +00:00
Bryan Drewery
8c444cbc45 Simplify syscall generation and ABI source file handling for the build.
This is to make the Makefile more easily extendable for new ABIs.

This also makes several other subtle changes:
  -  The build now is given a list of ABIs to use based on the MACHINE_ARCH or
     MACHINE_CPUARCH.  These ABIs have a related path in sys/ that is used
     to generate their syscalls.  For each ABI to build check for a
     ABI.c, MACHINE_ARCH-ABI.c, or a MACHINE_CPUARCH-ABI.c.  This matches
     the old behavior needed for archs such as powerpc* and mips*.
  -  The ABI source file selection allows for simpler assignment of common
     ABIs such as "fbsd32" from sys/compat/freebsd32, or cloudabi64.
  - Expand 'fbsd' to 'freebsd' everywhere for consistency.
  -  Split out the powerpc-fbsd.c file into a powerpc64-freebsd32.c to be more
     like the amd64-freebsd32.c file and to more easily allow the auto-generation
     of ABI handling to work.
  -  Rename 'syscalls.h' to 'fbsd_syscalls.h' to lessen the ambiguity and
     avoid confusion with syscall.h (such as in r288997).
  -  For non-native syscall header files, they are now renamed to be
     ABI_syscalls.h, where ABI is what ABI the Makefile is building.
  -  Remove all of the makesyscalls config files.  The "native" one being
     name i386.conf was a long outstanding bug.  They were all the same
     except for the data they generated, so now it is just auto-generated
     as a build artifact.
  -  The syscalls array is now fixed to be static in the syscalls header to
     remove the compiler warning about non-extern.  This was worked around
     in the aarch64-fbsd.c file but not the others.
  -  All syscall table names are now just 'syscallnames' since they don't
     need to be different as they are all static in their own ABI files.  The
     alternative is to name them ABI_syscallnames which does not seem
     necessary.

Reviewed by:	ed, jhb
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D3851
2015-10-13 18:23:51 +00:00
Enji Cooper
59e2ff550c Integrate the tests from lib/libarchive, usr.bin/cpio, and usr.bin/tar in to
the FreeBSD test suite

functional_test.sh was ported from bin/sh/tests/functional_test.sh, as a
small wrapper around libarchive_test, bsdcpio_test, and bsdtar_test provided
by upstream.

A handful of testcases in lib/libarchive/tests have been disabled as they
were failing when run with kyua test (see BROKEN_TESTS in
lib/libarchive/tests/Makefile)

As a sidenote: this removes the check/test targets from the Makefiles as they
don't match the pattern used in the rest of the FreeBSD test suite.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-10-12 18:31:21 +00:00
Peter Wemm
af80ed6add Update from svn-1.8.14 to 1.9.2.
Formal release notes are available:
  https://subversion.apache.org/docs/release-notes/1.9.html

Of particular note, the client checkout format has *not* changed so
upgrades should *not* be required.

When reading a repository (file:// or running as a local server), an
improved fsfs version 7 is available with significant performance
improvements.  An optional upgrade is possible to use the new features.
Without the upgrade, this is fully read/write compatible with the
version 6 fsfs as in svn-1.8.

Relnotes:	yes
2015-10-12 09:53:55 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Baptiste Daroussin
9be27fdc00 Merge from head 2015-10-09 22:45:54 +00:00
Bryan Drewery
7096af2e9e Let -c imply -S (hide signal output).
Without this, the signals are shown seemingly randomly in the output before
the final summary is shown.  This is especially noticeable when there is
not much output from the application being traced.

Discussed with:	jhb
Relnotes:	yes
2015-10-09 20:47:29 +00:00
Ed Schouten
808d980506 Properly format pointer size independent CloudABI system calls.
CloudABI has approximately 50 system calls that do not depend on the
pointer size of the system. As the ABI is pretty compact, it takes
little effort to each truss(8) the formatting rules for these system
calls. Start off by formatting pointer size independent system calls.

Changes:

- Make it possible to include the CloudABI system call definitions in
  FreeBSD userspace builds. Add ${root}/sys to the truss(8) Makefile so
  we can pull in <compat/cloudabi/cloudabi_syscalldefs.h>.
- Refactoring: patch up amd64-cloudabi64.c to use the CLOUDABI_*
  constants instead of rolling our own table.
- Add table entries for all of the system calls.
- Add new generic formatting types (UInt, IntArray) that we'll be using
  to format unsigned integers and arrays of integers.
- Add CloudABI specific formatting types.

Approved by:	jhb
Differential Revision:	https://reviews.freebsd.org/D3836
2015-10-08 05:27:45 +00:00
Bryan Drewery
04a97800bf Correct a comment. 2015-10-08 00:31:11 +00:00
Xin LI
65d3abd5e4 Remove support of ancient (pre-8.0R, 800041) FreeBSD releases.
MFC after:	2 weeks
2015-10-07 01:25:47 +00:00
Simon J. Gerraty
bd47c7ec11 Updated depends 2015-10-07 00:43:05 +00:00
Bryan Drewery
195aef9962 truss: Add support for utrace(2).
This uses the kdump(1) utrace support code directly until a common library
is created.

This allows malloc(3) tracing with MALLOC_CONF=utrace:true and rtld tracing
with LD_UTRACE=1.  Unknown utrace(2) data is just printed as hex.

PR:		43819 [inspired by]
Reviewed by:	jhb
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D3819
2015-10-06 21:58:38 +00:00
John Baldwin
f44fc79d0b Group the decoded system calls by ABI and sort the calls within each ABI.
Reviewed by:	bdrewery
Glanced at by:	kib
Differential Revision:	https://reviews.freebsd.org/D3823
2015-10-06 19:31:07 +00:00
Dimitry Andric
4f4bbad316 Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.7.0
release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

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

Thanks to Ed Maste, Andrew Turner and Antoine Brodin for their help.

Exp-run:	antoine
Relnotes:	yes
2015-10-06 17:53:29 +00:00
Enji Cooper
4436b51dff Integrate the tests from libxo into the FreeBSD test suite
The functional_test.sh harness for each test subdir was inspired
by the version in bin/sh/tests/functional_test.sh

Some gymnastics were required to deal with implicit rules for
.c / .o -> .out as the suffix transformation rules were
incorrectly trying to create the test outputs from some of the
source files

Sponsored by: EMC / Isilon Storage Division
2015-10-06 16:58:47 +00:00
Dimitry Andric
88750be440 Merge ^/head r288836 through r288925. 2015-10-06 16:25:13 +00:00
Enji Cooper
7fd25aff6b Use LIBXOSRC instead of LIBXO when defining the path to contrib/libxo
The latter is already defined in bsd.libnames.mk, so avoid the conflict
in case someone copy-pastes make variables

While here, switch path to the top of the source tree with SRCTOP
2015-10-06 07:28:54 +00:00
Warner Losh
3a845236df Start using the fact that SUBDIR.yes is added to SUBDIR
and move from the pattern of:

.if ${MK_FOO} != "no"
SUBDIR+= bar
.endif

to

SUBDIR.${MK_FOO}+= bar

since we know that MK_FOO is always either yes or no and the latter
form is easier to follow and much shorter. Various exception to this
pattern dealt with on an ah-hoc basis.

Discussed on arch@ a while ago.
2015-10-05 21:41:55 +00:00
Bryan Drewery
94746562ff Fix crash if a process sends itself a SIGTRAP. Just forward it as expected.
MFC after:	2 weeks [needs rewrite]
Relnotes:	yes
2015-10-05 21:39:07 +00:00
Dimitry Andric
926b24f309 Merge ^/head r288831 through r288835. 2015-10-05 20:08:11 +00:00
Bryan Drewery
47ff1ba642 Add decoding for modfind(2) 2015-10-05 18:11:30 +00:00
Bryan Drewery
6c61b0f324 Fix tracking of unknown syscalls for 'truss -c'.
This is done by changing get_syscall() to either lookup the known syscall
or add it into the list with the default handlers for printing.

This also simplifies some code to not have to check if the syscall variable
is set or NULL.

Reviewed by:	jhb
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D3792
2015-10-05 18:08:35 +00:00
Dimitry Andric
c710e87b3b Merge ^/head r288457 through r288830. 2015-10-05 17:54:54 +00:00
Bryan Drewery
0a71c082d2 Style fix. 2015-10-03 19:08:36 +00:00
Bryan Drewery
a776866b44 Add decoding for struct statfs.
Reviewed by:	jhb (briefly)
2015-10-03 18:57:15 +00:00
Baptiste Daroussin
6875f8e707 Remerge as previous one was broken 2015-10-03 07:22:07 +00:00
Konstantin Belousov
5821213b4c Add aarch64 support to truss(1).
Reviewed by:	jhb
Discussed with:	emaste (license)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3750
2015-10-02 13:30:56 +00:00
Ed Schouten
2f9ebcc1a5 Make truss print CloudABI system call names.
This change adds the bits that are necessary to fetch system call
arguments and return values from trapframes for CloudABI. This allows us
to properly print system calls with the right name. We need to make sure
that we properly convert error numbers when system calls fail.

We still need to improve truss to pretty-print some of the system calls
that have flags.
2015-10-02 11:17:15 +00:00
Colin Percival
6ae1554a5d Final step of eliminating the "games" distribution: Merge src/games
(or what's left of it, at least) into src/usr.bin.

This change will not be MFCed.

Discussed at:   EuroBSDCon 2014
Committed from: EuroBSDCon 2015
2015-10-02 10:08:11 +00:00
Dimitry Andric
65dcb5bcb1 Merge ^/head r288197 through r288456. 2015-10-01 19:02:45 +00:00
John Baldwin
66917ca9d2 Rather than groveling around in a socket address structure for a socket
address's length (and then overriding it if it "looks wrong"), use the
next argument to the system call to determine the length.  This is more
reliable since this is what the kernel depends on anyway and is also
simpler.
2015-10-01 18:18:58 +00:00
John Baldwin
72df19e7ab The id_t type used to pass IDs to wait6(2) and procctl(6) is a 64-bit
integer.  Fix the argument decoding to treat this as a quad instead of an
int.  This includes using QUAD_ALIGN and QUAD_SLOTS as necessary.  To
continue printing IDs in decimal, add a new QuadHex argument type that
prints a 64-bit integer in hex, use QuadHex for the existing off_t arguments,
repurpose Quad to print a 64-bit integer in decimal, and use Quad for id_t
arguments.

This fixes the decoding of wait6(2) and procctl(2) on 32-bit platforms.
2015-10-01 17:50:41 +00:00
John Baldwin
df438f423d - Remove extra integer argument from truncate() and ftruncate(). This is
probably fallout from the removal of the extra padding argument before
  off_t in 7.  However, that padding still exists for 32-bit powerpc, so
  use QUAD_ALIGN.
- Fix QUAD_ALIGN to be zero for powerpc64.  It should only be set to 1
  for 32-bit platforms that add padding to align 64-bit arguments.
2015-10-01 17:28:07 +00:00
Baptiste Daroussin
5a2b666ce5 Merge from head 2015-10-01 09:36:43 +00:00
John Baldwin
2b75c8ad3d Several changes to truss.
- Refactor the interface between the ABI-independent code and the
  ABI-specific backends.  The backends now provide smaller hooks to
  fetch system call arguments and return values.  The rest of the
  system call entry and exit handling that was previously duplicated
  among all the backends has been moved to one place.
- Merge the loop when waiting for an event with the loop for handling stops.
  This also means not emulating a procfs-like interface on top of ptrace().
  Instead, use a single event loop that fetches process events via waitid().
  Among other things this allows us to report the full 32-bit exit value.
- Use PT_FOLLOW_FORK to follow new child processes instead of forking a new
  truss process for each new child.  This allows one truss process to monitor
  a tree of processes and truss -c should now display one total for the
  entire tree instead of separate summaries per process.
- Use the recently added fields to ptrace_lwpinfo to determine the current
  system call number and argument count.  The latter is especially useful
  and fixes a regression since the conversion from procfs.  truss now
  generally prints the correct number of arguments for most system calls
  rather than printing extra arguments for any call not listed in the
  table in syscalls.c.
- Actually check the new ABI when processes call exec.  The comments claimed
  that this happened but it was not being done (perhaps this was another
  regression in the conversion to ptrace()).  If the new ABI after exec
  is not supported, truss detaches from the process.  If truss does not
  support the ABI for a newly executed process the process is killed
  before it returns from exec.
- Along with the refactor, teach the various ABI-specific backends to
  fetch both return values, not just the first.  Use this to properly
  report the full 64-bit return value from lseek().  In addition, the
  handler for "pipe" now pulls the pair of descriptors out of the
  return values (which is the true kernel system call interface) but
  displays them as an argument (which matches the interface exported by
  libc).
- Each ABI handler adds entries to a linker set rather than requiring
  a statically defined table of handlers in main.c.
- The arm and mips system call fetching code was changed to follow the
  same pattern as amd64 (and the in-kernel handler) of fetching register
  arguments first and then reading any remaining arguments from the
  stack.  This should fix indirect system call arguments on at least
  arm.
- The mipsn32 and n64 ABIs will now look for arguments in A4 through A7.
- Use register %ebp for the 6th system call argument for Linux/i386 ABIs
  to match the in-kernel argument fetch code.
- For powerpc binaries on a powerpc64 system, fetch the extra arguments
  on the stack as 32-bit values that are then copied into the 64-bit
  argument array instead of reading the 32-bit values directly into the
  64-bit array.

Reviewed by:	kib (earlier version)
Tested on:	amd64 (FreeBSD/amd64 & i386), i386, arm (earlier version)
Tested on:	powerpc64 (FreeBSD/powerpc64 & powerpc)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D3575
2015-09-30 19:13:32 +00:00
John Baldwin
9e07e493b3 Trim trailing whitespace. 2015-09-30 00:08:24 +00:00
John Baldwin
a061e3c50f Decode recently added procctl(2) operations. 2015-09-29 23:54:26 +00:00
Xin LI
05212689bb Use _PATH_DEVNULL instead of direct hardcoding.
MFC after:	2 weeks
2015-09-28 18:19:22 +00:00
Hans Petter Selasky
b27480c68d Store PID after becoming a daemon() and not before to ensure the
correct PID gets written to the PID file.

Submitted by:	Maxime Soule <btik-fbsd@scoubidou.com>
PR:		203252
MFC after:	2 weeks
2015-09-28 07:23:05 +00:00
Michael Reifenberger
27aa47691e Add support to systat to display zfs arc cache status/info
PR:		195460
Submitted by:	ota
2015-09-27 09:15:54 +00:00
Conrad Meyer
0ceadbf05d Revert r288270 to fix the build
Submitted by:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 20:26:05 +00:00
Bryan Drewery
cfac01438a Hookup mkcsmapper_static and mkesdb_static for all but install.
These are only handled as 'build-tools' in Makefile.inc1.  This causes
'make clean' from the top of the tree to not clean the directories.  It also
effectively has kept them disconnected and risks them bitrotting.  The
buildworld process never cleans them either.

Connect them so they will always be built, cleaned, etc, but never installed.

Discussed with:	imp (briefly)
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 14:28:04 +00:00
Bryan Drewery
595fe15108 Add more SUBDIR_PARALLEL.
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 14:13:51 +00:00
Ed Maste
209e744f89 xinstall: renumber UCB clauses to avoid skipping #3 2015-09-25 20:25:18 +00:00
Bryan Drewery
ec766071e3 META_MODE: Remove DEP_MACHINE from Makefile.depend files.
This has not been needed since r246865 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:44:01 +00:00
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Bryan Drewery
660d1f65bb Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:15:24 +00:00
Dimitry Andric
98e67009c0 Merge ^/head r288126 through r288196. 2015-09-24 21:48:04 +00:00
Ed Maste
453b09caf5 Rename ELFOSABI_SYSV to ELFOSABI_NONE to match current spec
Source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3731
2015-09-24 21:04:48 +00:00
Bryan Drewery
2254894222 Similar to r266147, don't define PROG in the test subdirs.
Magic things happen when including bsd.prog.mk in them.

Sponsored by:	EMC / Isilon Storage Division
2015-09-23 21:35:58 +00:00
Ed Maste
050747f2c3 elfdump: report MIPS ELF section type SHT_MIPS_REGINFO
Sponsored by:	The FreeBSD Foundation
2015-09-23 00:32:38 +00:00
Dimitry Andric
26e065d02e Merge ^/head r288035 through r288099. 2015-09-22 09:50:11 +00:00
Ed Maste
4db90148e1 elfdump: report MIPS-specific section type SHT_MIPS_ABIFLAGS
Sponsored by:	The FreeBSD Foundation
2015-09-22 01:45:43 +00:00
Alexander Motin
61639a0a3f Bunch of improvements to ctlstat.
Add -p option to allow filtering by ports.
Make -l and -p options work in all modes as filters.
Improve output formatting to better fit columns.
2015-09-21 09:37:49 +00:00
Alexander Motin
2eb293b996 Output times as normal microseconds, rather then in bintime format. 2015-09-20 21:06:37 +00:00
Dimitry Andric
ae2d96ab3a Merge ^/head r287878 through r288034. 2015-09-20 20:34:17 +00:00
Bryan Drewery
6fcd667fd6 Connect sesutil(1) and numactl(1) for META_MODE.
Sponsored by:	EMC / Isilon Storage Division
2015-09-19 17:47:36 +00:00
Baptiste Daroussin
449a792dd5 Restore man -t for manpages rendered by mandoc
Reported by:	swills
2015-09-19 16:00:50 +00:00
Bryan Drewery
e56d20da9d Don't hide build commands. 2015-09-18 21:01:52 +00:00
Bryan Drewery
42c4cf86d4 Update META_MODE dependencies. 2015-09-17 05:06:34 +00:00
Dimitry Andric
a1cb6af119 Merge ^/head r287680 through r287877. 2015-09-16 22:35:59 +00:00
Edward Tomasz Napierala
d051ac804a Make it clear that 'swapuse' is swap reservation and not actual swap usage.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-14 15:37:19 +00:00
Baptiste Daroussin
b5ff185e19 Merge from head 2015-09-12 11:41:31 +00:00
Dimitry Andric
0e1e5c22c2 Merge ^/head r287527 through r287679. 2015-09-11 17:20:03 +00:00
Mark Johnston
9eddb899d9 Use a common subroutine to fetch and zero protocol stats instead of
duplicating roughly similar code for each protocol.

MFC after:	2 weeks
2015-09-11 04:37:01 +00:00
Mark Johnston
2bdd6ea2ad Remove prototypes for undefined functions from netstat.h. 2015-09-11 04:02:05 +00:00
Mark Johnston
d73ce4c698 Remove the v_cache_min and v_cache_max sysctls. They are unused and have
no effect.

Reviewed by:	alc
Sponsored by:	EMC / Isilon Storage Division
2015-09-11 03:00:20 +00:00
Xin LI
60b0aa6a8f login.c doesn't really need libutil.h, don't include it.
login_fbtab.c includes paths.h and pathnames.h, and pathnames.h includes
paths.h.  Eliminate the paths.h inclusion in login_fbtab.c.

MFC after:	2 weeks
2015-09-10 22:25:40 +00:00
Xin LI
1e902b3b7e - Avoid accessing window properties directly, instead, use accessors.
This should be no-op for now, but allows the code to work if we
   move to NCURSES_OPAQUE.
 - Use calloc() instead of malloc+bzero.

MFC after:	2 weeks
2015-09-10 22:07:52 +00:00
Xin LI
ab9cee11d6 w(1) is not setgid binary since r53279, so remove the setgid() call.
Reviewed By:	wollman
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D3541
2015-09-09 05:17:04 +00:00
Dimitry Andric
cfab224f31 Merge ^/head r287502 through r287526. 2015-09-06 22:05:55 +00:00
Dimitry Andric
999971f7f7 Minimize the number of files compiled for clang only (e.g. when neither
WITH_CLANG_EXTRAS nor WITH_LLDB is in effect).
2015-09-06 22:02:13 +00:00
Allan Jude
dafe59a9ec Fix inverted output re: stack protection no-execute flag in procstat(1)
PR:		196110
Submitted by:	Joerg Pernfuss <code.jpe@gmail.com>
Approved by:	bapt (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3576
2015-09-06 17:47:03 +00:00
Dimitry Andric
1757ba14bf Merge ^/head r287490 through r287501. 2015-09-06 12:02:28 +00:00
Allan Jude
3491f5d422 Fix build error on gcc platforms
Approved by:	bapt (mentor)
2015-09-05 19:28:41 +00:00
Dimitry Andric
d9442b10a2 Merge ^/head r286858 through r287489. 2015-09-05 18:36:23 +00:00
Allan Jude
474b62b876 Introduce libxo to procstat(1)
Reviewed by:	rodrigc, bapt
Approved by:	marcel (mentor)
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D2446
2015-09-05 17:02:01 +00:00
Marcelo Araujo
aa44f2ed5e Rename YP to NIS in the manpages.
Approved by:		bapt (mentor)
Differential Revision:	D3555
2015-09-03 07:18:52 +00:00
Hiroki Sato
81dacd8beb Simplify kvm symbol resolution and error handling. The symbol table
nl_symbols will eventually be organized into several modules depending
on MK_* variables.
2015-09-02 18:51:36 +00:00
Hiroki Sato
a261e36179 Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR:	183598
2015-09-02 18:42:35 +00:00
Hiroki Sato
10d5269ff9 - Add -W flag support for network column in intpr() (-i flag) and
routepr() (-r flag).  It is too narrow to show an IPv6 prefix
  in most cases.

- Accept "local" as a synonym of "unix" in protocol family name.

- Show a prefix length in CIDR notation when name resolution failed in
  netname().

- Make routename() and netname() AF-independent and remove
  unnecessary typecasting from struct sockaddr.

- Use getnameinfo(3) to format L2 addr in intpr().

- Fix a bug which showed "Address" when -A flag is specfied in pr_rthdr().

- Replace cryptic GETSA() macro with SA_SIZE().

- Fix declarations shadowing local variables with the same names.

- Add more static, remove unused header files and variables.

MFC after:	1 week
2015-09-01 08:42:04 +00:00
Xin LI
0a107daff7 Drop group privileges after opening the kvm descriptor, otherwise, the code
would not drop privileges as expected.

While there also add checks for the drop and bail out immediately if we
failed.

MFC after:	3 days
2015-09-01 06:28:16 +00:00
Xin LI
a4a889a0ef Failure of dropping privilege should be fatal, so test and bail out
when setgid() fails.

Reported by:	clang static analyzer
MFC after:	2 weeks
2015-09-01 06:05:43 +00:00
Ed Maste
a1f0b4cf95 vtfontcvt: fix buffer overflow for non-default size .hex fonts
Sponsored by:	The FreeBSD Foundation
2015-09-01 01:35:43 +00:00
Ed Maste
2e268aa950 vtfontcvt: introduce xmalloc to abort on out-of-memory
Sponsored by:	The FreeBSD Foundation
2015-08-31 23:08:39 +00:00
Ed Maste
a84c4d189b ar: Deobfuscate a while loop 2015-08-31 18:07:17 +00:00
Ed Maste
a64a36e280 ar: fix deterministic mode when running as ranlib
This was broken by r286024.

PR:		202741
Submitted by:	fk@fabiankeil.de
Obtained from:	ElectroBSD
2015-08-31 12:28:13 +00:00
Xin LI
32e49abef0 - uri is expected to be nul-terminated (strchr used later),
so use strlcpy instead of strncpy.
 - unroll the other two cases of strncpy+\0 to strlcpy.

MFC after:	2 weeks
2015-08-31 06:11:39 +00:00
Xin LI
670f01434e Constify opt_f and opt_t and eliminate unneeded copying. This fixes
memory leaks.

Reported by:	clang static analyzer
MFC after:	2 weeks
2015-08-31 05:57:26 +00:00
Michael Tuexen
0835304fea Use the userland exported states and handle them completely. 2015-08-29 09:27:29 +00:00
Michael Tuexen
c1eb13c74c Report CLOSED as state for bound sockets for consistency with
netstat and the way TCP is handled.

PR:		201585
MFC after:	3 weeks
2015-08-29 09:10:52 +00:00
John-Mark Gurney
e7ae88eeda add documentation for timers that silby added in r197244, almost 6 years
ago...
2015-08-27 19:12:42 +00:00
Ed Schouten
bc1ace0b96 Decompose linkat()/renameat() rights to source and target.
To make it easier to understand how Capsicum interacts with linkat() and
renameat(), rename the rights to CAP_{LINK,RENAME}AT_{SOURCE,TARGET}.

This also addresses a shortcoming in Capsicum, where it isn't possible
to disable linking to files stored in a directory. Creating hardlinks
essentially makes it possible to access files with additional rights.

Reviewed by:	rwatson, wblock
Differential Revision:	https://reviews.freebsd.org/D3411
2015-08-27 15:16:41 +00:00
Alexander Kabaev
93f422607b Unbreak nvi message catalog generation for 8 bit locales.
Feeding any file encoded in 8 bit locales such as KOI8-RU
to sort utility running under UTF-8 locale produces astonishing
result of recoding the output to UTF-8. To counter that, just
run sort under 'C' locale for now.
2015-08-27 14:00:16 +00:00
Michael Tuexen
6414db1bc4 Add SCTP support.
PR:		201585
MFC after:	3 weeks
2015-08-26 23:45:06 +00:00
Michael Tuexen
6eb1d5ba64 Remove a variable which is set but never used.
PR:		201585
MFC after:	3 weeks
2015-08-26 22:52:18 +00:00
Michael Tuexen
4e13a5b043 Print the status on the first line of a socket description, not at
the last one. This doesn't matter for TCP, but it does for the upcoming
SCTP support.

PR:		201585
MFC after:	3 weeks
2015-08-26 22:50:53 +00:00
Sergey Kandaurov
d7deff23cd Fix SEE ALSO.
The history mechanism applies to csh.

Sponsored by:	Nginx, Inc.
2015-08-26 11:54:40 +00:00
Baptiste Daroussin
23a32822d2 Merge from HEAD 2015-08-25 20:14:50 +00:00
Marcelo Araujo
58458d066f Sync ypwhich(1) code with the OpenBSD version that is more modern.
Update the BSD LICENSE and remove the 3rd clause.

Reviewed by:	rodrigc, kib, bapt
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	D3249
2015-08-25 15:27:32 +00:00
Xin LI
f2f9b434b6 Finish r89633 and completely remove the remaining of VERSION.
PR:		bin/202308
Submitted by:	John Hein <z7dr6ut7gs snkmail com>
MFC after:	2 weeks
2015-08-25 05:31:00 +00:00
Marcel Moolenaar
d1a0d267b7 Upgrade libxo to 0.4.5.
Local changes incorporated by 0.4.5: r284340
Local changes retained: r276260, r282117

Obtained from:	https://github.com/Juniper/libxo
2015-08-24 16:26:20 +00:00
Xin LI
9242719ed3 Although the website [1] says US-ASCII is accepted, ISO-8859-1 seems to
be the only accepted character that is close enough to US-ASCII (and
this is also done on OpenBSD; the alternative would be to use UTF-8).

[1] http://www.denic.de/en/domains/technik/denic_whois-server/index.html

MFC after:	2 weeks
2015-08-23 08:22:00 +00:00
Enji Cooper
46e352ca51 Fix the racy xargs -P0 -n2 test added in r286289
Sort the output obtained from xargs and the expected output
to ensure the end result versus the input file is stable

Differential Revision: D3432
Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>
2015-08-21 18:42:57 +00:00
Enji Cooper
3cfe782429 Disable the -P0 test
It's unreliable (sometimes it passes, sometimes it fails)

Reported by: Jenkins (many times over the past few weeks)
2015-08-21 17:47:17 +00:00
John Baldwin
68055893c1 Handle the conditional decoding of execve() argument and environment
arrays generically rather than duplicating a hack in all of the backends.
- Add two new system call argument types and use them instead of StringArray
  for the argument and environment arguments execve and linux_execve.
- Honor the -a/-e flags in the handling of these new types.
- Instead of printing "<missing argument>" when the decoding is disabled,
  print the raw pointer value.
2015-08-20 14:51:11 +00:00
John Baldwin
890843c15b Rework the argv and env string fetching for execve to be more robust.
Before truss would fetch 100 string pointers and happily walk off the end
of the array if it never found a NULL.  This also means for a short argv
list it could fail entirely if the 100 string pointers spanned into an
unmapped page.

Instead, fetch page-aligned blocks of string pointers in a loop fetching
each string until a NULL is found.

While here, make use of the open memstream file descriptor instead of
allocating a temporary array.  This allows us to fetch each string once
instead of twice.
2015-08-20 14:33:30 +00:00