Commit Graph

12324 Commits

Author SHA1 Message Date
Baptiste Daroussin
99ed5c6e34 Fix "files" arguments 2016-03-05 15:53:06 +00:00
Dimitry Andric
82aa34e6fa Merge ^/head r296007 through r296368. 2016-03-03 23:15:46 +00:00
Dimitry Andric
ada554fc20 Regenerate llvm and clang manpages. 2016-03-03 23:09:57 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Konstantin Belousov
1bdbd70599 Implement process-shared locks support for libthr.so.3, without
breaking the ABI.  Special value is stored in the lock pointer to
indicate shared lock, and offline page in the shared memory is
allocated to store the actual lock.

Reviewed by:	vangyzen (previous version)
Discussed with:	deischen, emaste, jhb, rwatson,
	Martin Simmons <martin@lispworks.com>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2016-02-28 17:52:33 +00:00
Bryan Drewery
3055a28d44 Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:15 +00:00
Pedro F. Giffuni
7880fc113f talk(1): Replace select(2) with poll(2)
Hinted by:	OpenBSD and NetBSD
2016-02-25 19:06:44 +00:00
Mariusz Zaborski
c501d73c7e Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with:		pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by:	drysdale@google.com, bdrewery
Approved by:		pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D4277
2016-02-25 18:23:40 +00:00
John Baldwin
6fb8946b7f Add simple support for CloudABI processes to kdump(1).
This does not decode arguments to system calls but should properly
decode system call names and error return values.

Reviewed by:	ed
Differential Revision:	https://reviews.freebsd.org/D5412
2016-02-25 17:43:32 +00:00
Dimitry Andric
14e9c9161c Merge ^/head r295902 through r296006. 2016-02-24 21:38:51 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Bryan Drewery
137e183ff3 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:18:35 +00:00
Bryan Drewery
9f93cfc34b Properly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from r249657.
This reverts r284374.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:18:31 +00:00
Glen Barber
aef2f6ad2e MFH
Sponsored by:	The FreeBSD Foundation
2016-02-24 03:08:58 +00:00
Maxim Sobolev
5497acc527 Obsolete mkulzma(8) and geom_uncompress(4), their functionality
is now provided by mkuzip(8) and geom_uzip(4) respectively.

MFC after:	1 month
2016-02-24 00:39:36 +00:00
Maxim Sobolev
8f8cb840b0 Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8)
and geom_uncompress(4):

1. mkuzip(8):

 - Proper support for eliminating all-zero blocks when compressing an
   image. This feature is already supported by the geom_uzip(4) module
   and CLOOP format in general, so it's just a matter of making mkuzip(8)
   match. It should be noted, however that this feature while it sounds
   great, results in very slight improvement in the overall compression
   ratio, since compressing default 16k all-zero block produces only 39
   bytes compressed output block, which is 99.8% compression ratio. With
   typical average compression ratio of amd64 binaries and data being
   around 60-70% the difference between 99.8% and 100.0% is not that
   great further diluted by the ratio of number of zero blocks in the
   uncompressed image to the overall number of blocks being less than
   0.5 (typically). However, this may be important from performance
   standpoint, so that kernel are not spinning its wheels decompressing
   those empty blocks every time this zero region is read. It could also
   be important when you create huge image mostly filled with zero
   blocks for testing purposes.

 - New feature allowing to de-duplicate output image. It turns out that
   if you twist CLOOP format a bit you can do that as well. And unlike
   zero-blocks elimination, this gives a noticeable improvement in the
   overall compression ratio, reducing output image by something like
   3-4% on my test UFS2 3GB image consisting of full FreeBSD base system
   plus some of the packages (openjdk, apache etc), about 2.3GB worth of
   file data (800+MB compressed). The only caveat is that images created
   with this feature "on" would not work on older versions of FeeBSDxi
   kernel, hence it's turned off by default.

 - provide options to control both features and document them in manual
   page.

 - merge in all relevant LZMA compression support from the mkulzma(8),
   add new option to select between both.

 - switch license from ad-hoc beerware into standard 2-clause BSD.

2. geom_uzip(4):

 - implement support for de-duplicated images;

 - optimize some code paths to handle "all-zero" blocks without reading
   any compressed data;

 - beef up manual page to explain that geom_uzip(4) is not limited only
   to md(4) images. The compressed data can be written to the block
   device and accessed directly via magic of GEOM(4) and devfs(4),
   including to mount root fs from a compressed drive.

 - convert debug log code from being compiled in conditionally into
   being present all the time and provide two sysctls to turn it on or
   off. Due to intended use of the module, it can be used in
   environments where there may not be a luxury to put new kernel with
   debug code enabled. Having those options handy allows debug issues
   without as much problem by just having access to serial console or
   network shell access to a box/appliance. The resulting additional
   CPU cycles are just few int comparisons and branches, and those are
   minuscule when compared to data decompression which is the main
   feature of the module.

 - hopefully improve robustness and resiliency of the geom_uzip(4) by
   performing some of the data validation / range checking on the TOC
   entries and rejecting to attach to an image if those checks fail.

 - merge in all relevant LZMA decompression support from the
   geom_uncompress(4), enable automatically when appropriate format is
   indicated in the header.

 - move compilation work into its own worker thread so that it does not
   clog g_up. This allows multiple instances work in parallel utilizing
   smp cores.

 - document new knobs in the manual page.

Reviewed by:		adrian
MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D5333
2016-02-23 23:59:08 +00:00
John Baldwin
287b96dd25 Add handling for non-native error values to libsysdecode.
Add two new functions, sysdecode_abi_to_freebsd_errno() and
sysdecode_freebsd_to_abi_errno(), which convert errno values between
the native FreeBSD ABI and other supported ABIs. Note that the
mappings are not necessarily perfect meaning in some cases multiple
errors in one ABI might map to a single error in another ABI. In that
case, the reverse mapping will return one of the errors that maps, but
which error is non-deterministic.

Change truss to always report the raw error value to the user but
use libsysdecode to map it to a native errno value that can be used
with strerror() to generate a description. Previously truss reported
the "converted" error value. Now the user will always see the exact
error value that the application sees.

Change kdump to report the truly raw error value to the user. Previously
kdump would report the absolute value of the raw error value (so for
Linux binaries it didn't output the FreeBSD error value, but the positive
value of the Linux error). Now it reports the real (i.e. negative) error
value for Linux binaries. Also, use libsysdecode to convert the native
FreeBSD error reported in the ktrace record to the raw error used by the
ABI. This means that the Linux ABI can now be handled directly in
ktrsysret() and removes the need for linux_ktrsysret().

Reviewed by:	bdrewery, kib
Helpful notes:	wblock (manpage)
Differential Revision:	https://reviews.freebsd.org/D5314
2016-02-23 20:00:55 +00:00
John Baldwin
d70876fd7e Add support for displaying thread IDs to truss(1).
- Consolidate duplicate code for printing the metadata at the start of
  each line into a shared function.
- Add an -H option which will log the thread ID of the relevant thread
  for each event.

While here, remove some extraneous calls to clock_gettime() in
print_syscall() and print_syscall_ret().  The caller of print_syscall_ret()
always updates the current thread's "after" time before it is called.

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D5363
2016-02-23 19:56:29 +00:00
Glen Barber
317cec3c43 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-22 12:28:23 +00:00
Dimitry Andric
9893f787ec Merge ^/head r295601 through r295844. 2016-02-21 13:49:26 +00:00
Stefan Eßer
2919c53c63 Remove O_SYNC from the options passed to dbmopen().
The output file is created as a temporary file that is moved over the
existing file after completion. Thus there is no need to immediately
flush all created db records to the temporary file.

This speeds up creation of the termcap db by a factor of 40 on my
ZFS based /etc filesytem (from 25 seconds to 0.6 seconds).

I have compared multiple output files created with and without O_SYNC
and they came out identical each time.  Nonetheless it might be best
to MFC this change and the similar one for services_mkdb (r295465) at
the same time when the changes to hash.c in review D5186 are merged.

MFC:	 1 week
2016-02-19 08:42:13 +00:00
Bryan Drewery
af96ced5c5 DIRDEPS_BUILD: Add dependencies somehow missed in r295681.
Sponsored by:	EMC / Isilon Storage Division
2016-02-19 00:41:38 +00:00
Glen Barber
72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Bryan Drewery
24e9c818fa Fix installation of makewhatis.local(1) since r283777.
The wrapper script has moved to libexec/makewhatis.local since it is not
directlry related to the older makewhatis(1) utility that has been replaced
by the usr.bin/mandoc version.

Reported by:	vangyzen
2016-02-18 00:26:21 +00:00
Bryan Drewery
6b128c1707 DIRDEPS_BUILD: Hookup CLANG_EXTRAS.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 23:11:09 +00:00
John Baldwin
f8ed4050d5 Remove an unused variable that snuck into the previous revision. 2016-02-16 22:13:25 +00:00
John Baldwin
00ddbdf2ee Fetch the current thread and it's syscall state from the trussinfo object
instead of passing some of that state as arguments to print_syscall() and
print_syscallret().  This just makes the calls of these functions shorter
and easier to read.
2016-02-16 22:00:01 +00:00
Pedro F. Giffuni
0bfdca975c Fix naive use of ftell(3).
Secure coding practices, FIO19-C.
2016-02-16 21:39:19 +00:00
Olivier Cochard
f53fab99ae Add myself as ports committer (including calendar)
Approved by:	jadawin
Differential Revision:	https://reviews.freebsd.org/D5295
2016-02-16 10:33:45 +00:00
Bryan Drewery
9d8a81b4e4 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:14:30 +00:00
Bryan Drewery
d3157f0915 Test directories can build in parallel fine.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:13:59 +00:00
Glen Barber
3c76ad5c10 Include correct is*ct*l program in iscsi package, and package the
legacy version separately.

Submitted by:	trasz
Sponsored by:	The FreeBSD Foundation
2016-02-16 01:18:49 +00:00
Glen Barber
0fe0fe112f MFH
Sponsored by:	The FreeBSD Foundation
2016-02-15 21:58:52 +00:00
John Baldwin
623277619d Correct the ABI name for Linux/i386 binaries under FreeBSD/i386.
This allows truss to work for these binaries again after r288424.

MFC after:	3 days
2016-02-15 20:27:16 +00:00
John Baldwin
142482cda6 Sign extend the error value for failing Linux/i386 system calls. This
restores the mapping of Linux errors to native FreeBSD errno values after
the refactoring in r288424.
2016-02-15 20:26:40 +00:00
Kevin Lo
daa1a379ce Fix a bug that caused nothing to be skipped when skipping exactly the
number of bytes present in a regular file was requested.

Obtained from:	OpenBSD
2016-02-14 14:23:56 +00:00
Dimitry Andric
90a4726375 Merge ^/head r295544 through r295600. 2016-02-13 16:02:12 +00:00
Ed Maste
715f438b42 elfcopy: enable PE and EFI support
Sponsored by:	The FreeBSD Foundation
2016-02-12 21:15:31 +00:00
Dimitry Andric
4156ce4fed Merge ^/head r295351 through r295543. 2016-02-11 20:07:09 +00:00
Glen Barber
30922917c8 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-10 04:20:39 +00:00
Konstantin Belousov
78b7ef01a8 Rename variable to reflect the condition.
Suggested by:	jhb
Sponsored by:	The FreeBSD Foundation
2016-02-09 18:35:37 +00:00
Konstantin Belousov
db57c70a5b Rename P_KTHREAD struct proc p_flag to P_KPROC.
I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL()
definition.

Suggested by:	jhb
Sponsored by:	The FreeBSD Foundation
2016-02-09 16:30:16 +00:00
Dimitry Andric
a49d8b6ecc Merge ^/head r294961 through r295350. 2016-02-06 14:07:17 +00:00
Glen Barber
1f4bcc459a More 'tests' packaging fixes.
Sponsored by:	The FreeBSD Foundation
2016-02-03 19:08:45 +00:00
Glen Barber
2aa00a6001 More 'tests' package fixes.
Sponsored by:	The FreeBSD Foundation
2016-02-03 00:34:23 +00:00
Glen Barber
9da80e9efe Fix build.
Sponsored by:	The FreeBSD Foundation
2016-02-02 23:23:37 +00:00
Glen Barber
221b349912 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:27:48 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Glen Barber
477a29ca9b Create ee(1) package.
Sponsored by:	The FreeBSD Foundation
2016-02-02 21:04:33 +00:00
Glen Barber
17f1329d94 Create a package for vi(1) and related files.
Sponsored by:	The FreeBSD Foundation
2016-02-02 16:47:50 +00:00
Alfred Perlstein
7325dfbb59 Increase max allowed backlog for listen sockets
from short to int.

PR: 203922
Submitted by: White Knight <white_knight@2ch.net>
MFC After: 4 weeks
2016-02-02 05:57:59 +00:00
John Baldwin
5842bd683f Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions.
Suggested by:	jmallett
Reviewed by:	bdrewery, jmallett
Differential Revision:	https://reviews.freebsd.org/D5123
2016-01-30 01:00:54 +00:00
Glen Barber
674c45857c Restore the 'beforeinstall' for chpass(1), so files with the
schg flag are handled before being replaced by a symbolic link.

Fix passwd(1)/yppasswd(1) schg issue similarly to chpass(1).

Note:  These are likely temporary fixes while identifying any
remaining files that are not marked as 'flags=schg' via mtree(8).

Sponsored by:	The FreeBSD Foundation
2016-01-28 02:56:30 +00:00
Glen Barber
55cd62fc4b Ensure mtree(8) recognizes chpass(1) is schg.
Convert hard links to symbolic links, and remove the
'beforeinstall' and 'afterinstall' chflags(8) execution.

Sponsored by:	The FreeBSD Foundation
2016-01-28 01:15:57 +00:00
Dimitry Andric
752d00608c Merge ^/head r294777 through r294960. 2016-01-27 22:52:20 +00:00
Glen Barber
0e186c0aab MFH
Sponsored by:	The FreeBSD Foundation
2016-01-27 14:16:13 +00:00
Gleb Smirnoff
57a78e3bae Augment struct tcpstat with tcps_states[], which is used for book-keeping
the amount of TCP connections by state.  Provides a cheap way to get
connection count without traversing the whole pcb list.

Sponsored by:	Netflix
2016-01-27 00:45:46 +00:00
Devin Teske
21838a13cc Bump copyright 2016-01-27 00:03:43 +00:00
Devin Teske
56b38aa60b Add -k' for dpv(3) keep_tite' config option
For scripts using dialog(1) several times, it can be visually distracting
running dpv(1) several times amidst other dialogs. The `-k' option, similar
to dialog(1) `--keep-tite', enables the same functionality to smooth ti/te.
2016-01-26 23:59:30 +00:00
John Baldwin
a5f14abfd2 Add support to libsysdecode for decoding system call names.
A new sysdecode_syscallname() function accepts a system call code and
returns a string of the corresponding name (or NULL if the code is
unknown).  To support different process ABIs, the new function accepts a
value from a new sysdecode_abi enum as its first argument to select the
ABI in use.  Current ABIs supported include FREEBSD (native binaries),
FREEBSD32, LINUX, LINUX32, and CLOUDABI64.  Note that not all ABIs are
supported by all platforms.  In general, a given ABI is only supported
if a platform can execute binaries for that ABI.

To simplify the implementation, libsysdecode's build reuses the
existing pre-generated files from the kernel source tree rather than
duplicating new copies of said files during the build.

kdump(1) and truss(1) now use these functions to map system call
identifiers to names.  For kdump(1), a new 'syscallname()' function
consolidates duplicated code from ktrsyscall() and ktrsyscallret().
The Linux ABI no longer requires custom handling for ktrsyscall() and
linux_ktrsyscall() has been removed as a result.

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D4823
2016-01-26 19:07:09 +00:00
Dimitry Andric
14d5c08ba8 Merge ^/head r294599 through r294776. 2016-01-26 07:49:11 +00:00
Ruslan Bukin
1c052a8c31 Disable gprof and users on RISC-V, they don't build. 2016-01-25 16:49:39 +00:00
Glen Barber
f9421853ad MFH
Sponsored by:	The FreeBSD Foundation
2016-01-25 14:13:28 +00:00
Ed Maste
3a4b59a2cf elfdump: handle STT_SPARC_REGISTER
STT_SPARC_REGISTER is a SPARC-specific symbol type specified by the
Sparcv9 ABI to provide some information on register use by the object.

Also rework st_info type lookup to avoid out-of-bounds array access.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-01-25 04:22:01 +00:00
Ruslan Bukin
5a0bf0f5c6 We don't support a.out executables on RISC-V.
Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D5048
2016-01-24 15:15:57 +00:00
Tony Finch
f537d420bf Fix a regression in the .de and .dk whois special cases
Ensure the special cases trigger whether we come via a referral
or via the -c option. Match host names case-insensitively.

Use the default character set supported by .de (UTF-8) since that
is more compatible with the modern world than ISO 8859-1. Persuade
them to give us a useful answer whether an internationalized
domain name is given in UTF-8 or in punycode.
2016-01-23 01:20:58 +00:00
Tony Finch
6f4d88df9f A lot of the cleverness in whois is no longer needed!
The IANA whois server has the right referral information for domain
names, IP addresses, and AS numbers, so whois does not need to be
able to choose servers itself (except for a few cases where referrals
do not work). We can delete a chunk of code, which is always fun.

This change improves the referral handling to be less sensitive to
all the various formats, and to allow multi-hop referral chains,
such as IANA -> registry -> registrar.

ARIN queries have the "+" flag added if no flags are present, so we
get full details if the query matches multiple objects. The Verisign
anti-spam logic is also now suppressed if the user provided a non-
trivial query string.

Uninformative rubric is now trimmed by default. The -S option
turns off trimming, and disables query fettling.

The -i option is back to its traditional pre-1999 hostname, since
whois.internic.net is more useful than whois.networksolutions.com.
Note that the old fallback/default server whois.crsnic.net is an
alias for whois.internic.net.

The manual is more informative about query syntax.
2016-01-23 00:28:18 +00:00
Dimitry Andric
d9b9dae1a9 Merge ^/head r294169 through r294598. 2016-01-22 20:41:56 +00:00
Tony Finch
de80c945d2 Update whois synopsis and usage with new options 2016-01-22 19:06:43 +00:00
Benjamin Kaduk
70be6b9442 Bump .Dd after r294575 2016-01-22 17:17:27 +00:00
Tony Finch
52517c0a57 A few whois usability improvements
Look up AS numbers at ARIN.

Handle more referral formats.

Suppress spammy nameserver objects when querying the .com and .net
whois servers by explicitly querying for domain names by default.
2016-01-22 16:43:49 +00:00
Ruslan Bukin
391b2fa126 Add support for RISC-V ISA.
Reviewed by:	andrew
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D5014
2016-01-22 16:32:22 +00:00
Glen Barber
d3d8fcf2c6 Create an acct package for accounting tools.
Sponsored by:	The FreeBSD Foundation
2016-01-21 17:49:10 +00:00
Glen Barber
2971191a94 Create a rcmds package.
Sponsored by:	The FreeBSD Foundation
2016-01-21 17:33:31 +00:00
Glen Barber
59d43d11fe MFH
Sponsored by:	The FreeBSD Foundation
2016-01-20 09:50:54 +00:00
Alan Somers
1775042adb Fix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp.
The bad_truncate test sets the uimmutable flag to produce an error in
truncate, but that flag isn't supported by ZFS.  If /tmp is on a ZFS
filesystem, the test will fail.  Change it to use readonly permissions and
an unpriveleged user instead.

Reviewed by:	jilles
MFC after:	1 week
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4862
2016-01-19 22:07:39 +00:00
Baptiste Daroussin
4d3c8f6a38 Import misc.c,v 1.46 from OpenBSD (by espie@)
Yet another missed ferror call
2016-01-18 22:12:07 +00:00
Baptiste Daroussin
410df9fd8d Fix printing multibyte printing when performing a networked finger(1) request
MFC after:	1 week
2016-01-18 20:47:04 +00:00
Joel Dahl
5837aafd13 mdoc: sort Xr 2016-01-18 20:21:38 +00:00
Dimitry Andric
7aa11cde7e Merge ^head r294090 through r294168. 2016-01-16 17:33:09 +00:00
Baptiste Daroussin
2b774394cc Update mandoc to 20160116 2016-01-15 23:28:12 +00:00
Alex Kozlov
2852a34f86 - Add support for zip to lesspipe.sh
Approved by:	des
2016-01-15 23:13:01 +00:00
Alex Kozlov
b5acc1891f - Match directory extraction message with Infozip [1]
- Add comment explaining masks in check_binary()

Obtained from:	NetBSD [1]
Approved by:	des
2016-01-15 23:04:36 +00:00
Alex Kozlov
b2a265d3cd - Extract common code from extract()/extract_stdout() to extract2fd()
- Update information about central directory handling

Obtained from:	NetBSD
Approved by:	des
2016-01-15 22:58:23 +00:00
Dimitry Andric
7f38eb34e2 Merge ^/head r293850 through r294089. 2016-01-15 17:55:00 +00:00
Andrew Turner
c455b92483 Set -mlong-calls where needed to get a static clang and lldb 3.8.0
linking. These are too large for a branch instruction to branch from an
earlier point in the code to somewhere later.

This will also allow these to be build with Thumb-2 when we get this
infrastructure.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D4855
2016-01-14 19:00:13 +00:00
Dimitry Andric
444ed5c5eb Update llvm, clang and lldb to trunk r257626, and update build glue. 2016-01-14 17:42:46 +00:00
Glen Barber
a11378bd93 MFH
Sponsored by:	The FreeBSD Foundation
2016-01-14 13:29:12 +00:00
Eric van Gyzen
414dbbaf56 numactl: fix CPU affinity when modifying an existing process or thread
numactl was only modifying its own CPU affinity, which is fine
when creating a new process, but not very helpful when modifying
an existing processes.

Reviewed by:	adrian
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D4927
2016-01-14 01:34:41 +00:00
Glen Barber
e60680024a MFH
Sponsored by:	The FreeBSD Foundation
2016-01-12 01:23:45 +00:00
Dimitry Andric
89d3f0ea4e Merge ^/head r293430 through r293685. 2016-01-11 19:36:44 +00:00
Gleb Smirnoff
2bab0c5535 New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and
up to now.

The new sendfile is the code that Netflix uses to send their multiple tens
of gigabits of data per second. The new implementation features asynchronous
I/O, when I/O operations are launched, but not awaited to be complete. An
explanation of why such behavior is beneficial compared to old one is
going to be too long for a commit message, so we will skip it here.

Additional features of new syscall are extra flags, which provide an
application more control over data sent. The SF_NOCACHE flag tells
kernel that data shouldn't be cached after it was sent. The SF_READAHEAD()
macro allows to specify readahead size in pages.

The new syscalls is a drop in replacement. No modifications are required
to applications. One can take nginx binary for stable/10 and run it
successfully on head. Although SF_NODISKIO lost its original sense, as now
sendfile doesn't block, and now means something completely different (tm),
using the new sendfile the old way is absolutely safe.

Celebrates:	Netflix global launch!
Sponsored by:	Nginx, Inc.
Sponsored by:	Netflix
Relnotes:	yes
2016-01-08 20:34:57 +00:00
Dimitry Andric
b229c1a0b0 Merge ^/head r293280 through r293429. 2016-01-08 17:42:14 +00:00
Bryan Drewery
e3ebb82118 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-01-07 19:58:23 +00:00
Glen Barber
0c9da521fa MFH
Sponsored by:	The FreeBSD Foundation
2016-01-07 17:23:43 +00:00
Renato Botelho
3aefe8928a Make cap_mkdb and services_mkdb file operations sync
Similar fix was done for passwd and group operations in r285050. When a
temporary file is created and then renamed to replace official file there
are no checks to make sure data was written to disk and if a power cycle
happens at this time, system can end up with a 0 length file

Approved by:	bapt
MFC after:	1 week
Sponsored by:	Netgate
Differential Revision:	https://reviews.freebsd.org/D2982
2016-01-07 10:39:13 +00:00
Bryan Drewery
b8e3d9cc79 Update dependencies after r292622 moved the ioctl script.
Sponsored by:	EMC / Isilon Storage Division
2016-01-07 00:32:40 +00:00
Dimitry Andric
5dc6cc42f4 Merge ^/head r293175 through r293279. 2016-01-06 21:31:07 +00:00
Dimitry Andric
dbc595b2ae Some additional llvm tools need libz. While here, consistently use
LIBADD+=.
2016-01-06 21:28:39 +00:00
Glen Barber
7d2c986e47 Fix mis-merged LDADD/DPADD
Sponsored by:	The FreeBSD Foundation
2016-01-05 16:08:26 +00:00
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