Commit Graph

17920 Commits

Author SHA1 Message Date
Ed Schouten
279d89406b Improve phrasing of the STANDARDS section.
Reported by:	wblock
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8205
2016-10-15 08:09:55 +00:00
Ed Maste
df283203fc Simplify logic for libproc and librtld_db in lib/Makefile 2016-10-14 17:04:07 +00:00
Ed Maste
cd060b8d7a partially convert lib/Makefile to SUBDIR.${MK_FOO} style
Cases other than MK_* (e.g. ${MACHINE_CPUARCH} == "i386") have been left
as is.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8246
2016-10-14 01:53:15 +00:00
Ed Maste
3ba97c2088 garbage collect _libatm, missed in r179308 2016-10-13 21:35:48 +00:00
Ed Maste
bff207520a libgcc_s: add libm dependencies from div{d,s,x}c3
compiler-rt's complex division support routines contain calls to
compiler builtins such as `__builtin_scalbnl`.  Unfortunately Clang
turns these back into a call to `scalbnl`.

For now link libm's C version of the required support routines.

Reviewed by:	ed
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8190
2016-10-13 19:18:00 +00:00
Ed Maste
49c5eacbbf Introduce lib/libgcc_eh and lib/libgcc_s for LLVM's implementation
They are not yet connected to the build, but I am adding them to allow
for easier testing, ports exp-runs, etc.

Reviewed by:	ed
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8188
2016-10-13 18:57:18 +00:00
Ed Schouten
4ef9bd22ed Improve typing of POSIX search tree functions.
Back in 2015 when I reimplemented these functions to use an AVL tree, I
was annoyed by the weakness of the typing of these functions. Both tree
nodes and keys are represented by 'void *', meaning that things like the
documentation for these functions are an absolute train wreck.

To make things worse, users of these functions need to cast the return
value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to
access the key. Technically speaking such casts violate aliasing rules.
I've observed actual breakages as a result of this by enabling features
like LTO.

I've filed a bug report at the Austin Group. Looking at the way the bug
got resolved, they made a pretty good step in the right direction. A new
type 'posix_tnode' has been added to correspond to tree nodes. It is
still defined as 'void' for source-level compatibility, but in the very
far future it could be replaced by a proper structure type containing a
key pointer.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8205
2016-10-13 18:25:40 +00:00
Ruslan Bukin
c3fa65b1c8 Fix typos: use correct string format and value to compare.
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8226
2016-10-13 15:26:51 +00:00
Ruslan Bukin
2302bd3539 Fix strchr, strrchr implementation: convert c to char
(according to standard).

Discussed with:	andrew
Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8239
2016-10-13 15:23:53 +00:00
Warner Losh
b2a7ac4802 Fix building on i386 and arm. But 'public domain' headers on the files
with no creative content. Include "lost" changes from git:
o Use /dev/efi instead of /dev/efidev
o Remove redundant NULL checks.

Submitted by: kib@, dim@, zbb@, emaste@
2016-10-13 06:56:23 +00:00
Ed Maste
49a6e1ba32 Add comment on use of abort() in libc
Suggested by:	jonathan (in review D8133)
2016-10-12 13:56:14 +00:00
Ruslan Bukin
32797df534 Add different libc ldscript: the one without libssp --
we don't have it when MK_SSP==no.

This fixes compilation on MIPS.

Reviewed by:	imp
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8212
2016-10-12 13:19:21 +00:00
Warner Losh
d49a5ddd04 Create libefivar library. This library aims to provide
the same API as the GPL'd version of this library. It implements the common
Linux API for programatically manipulating UEFI environment varibales using
the UEFI Runtime Services the kernel provides. It replaces the old efi
library since it is programmed to a different interface, but retails the
CHAR16 to UTF-8 and vice versa conversion routines. The new name is to match
Linux program's expectations.

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche
2016-10-11 22:30:41 +00:00
Ruslan Bukin
fae95359ee Don't use fmaxl/fminl on platforms with no long double support,
use fmax/fmin instead.

This fixes fmaxmin test failure on MIPS64.

Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8216
2016-10-11 20:31:59 +00:00
Konstantin Belousov
6886c70100 Correct indent.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-10-11 11:46:02 +00:00
Konstantin Belousov
c3b83049d6 Fill msg_len for the initial element of msgvec.
Submitted by:	Daniel Salzman <daniel.salzman@nic.cz>
MFC after:	3 days
2016-10-11 11:45:12 +00:00
Bryan Drewery
3617efe593 Improve grammar.
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2016-10-06 17:35:50 +00:00
Mariusz Zaborski
c3eed03d15 Add man pages for Capsicum helpers.
Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D8154
2016-10-05 20:02:34 +00:00
Ed Maste
a01a51a352 libm: remove unused variables
Sponsored by:	The FreeBSD Foundation
2016-10-05 17:04:58 +00:00
Ed Maste
7e81ad1292 abort in srandomdev if kern.arandom sysctl fails
The sysctl cannot fail. If it does fail on some FreeBSD derivative or
after some future change, just abort() so that the problem will be found
and fixed.

While abort() is not normally suitable for a library, it makes sense
here.

This is akin to r306636 for arc4random.

Reviewed by:	ed
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8077
2016-10-05 17:03:22 +00:00
Mariusz Zaborski
e7798d20c5 Fix naming in Casper man page. 2016-10-05 16:23:02 +00:00
Mariusz Zaborski
059cc32342 libcapsicum: limit stderr
Don't limit stdout twice, instead limit stderr.

Pointed out by:	rpokala@
2016-10-04 13:33:43 +00:00
Martin Matuska
f3e9b21a7a MFV r306669:
Sync libarchive with vendor including security fixes.

Important vendor bugfixes (relevant to FreeBSD):
#747: Out of bounds read in mtree parser
#761: heap-based buffer overflow in read_Header (7-zip)
#784: Invalid file on bsdtar command line results in internal errors (1)

PR:		213092 (1)
MFC after:	1 week
2016-10-04 11:56:46 +00:00
Mariusz Zaborski
7a6e3cf83e libcapsicum: introduce Capsicum helpers
Capsicum helpers are a set of inline functions which goal is to reduce
duplicated patterns used to Capsicumize applications.

Reviewed by:	cem, AllanJude, bapt, ed, emaste
Differential Revision:	https://reviews.freebsd.org/D8013
2016-10-03 20:48:18 +00:00
Ed Schouten
1a466ddc79 Remove setkey(), encrypt(), des_setkey() and des_cipher().
The setkey() and encrypt() functions are part of XSI, not the POSIX base
definitions. There is no strict requirement for us to provide these,
especially if we're only going to keep these around as undocumented
stubs. The same holds for des_setkey() and des_cipher().

Instead of providing functions that only generate warnings when linking,
simply disallow linking against them. The impact of this is relatively
low. It only causes two leaf ports to break. I'll see what I can do to
help out to get those fixed.

PR:		211626
2016-10-03 18:20:58 +00:00
Toomas Soome
ef97c45728 Fix remaining bugs in libstancd/cd9660.c reported by Bruce Evans.
Fixed text in comments.

Reported by:	Bruce Evans <brde@optusnet.com.au>
Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D8119
2016-10-03 14:07:15 +00:00
Ed Maste
5c1ea1fcd0 libc arc4_stir: use only kern.arandom sysctl
The sysctl cannot fail. If it does fail on some FreeBSD derivative or
after some future change, just abort() so that the problem will be found
and fixed.

It's preferable to provide an arc4random() function that cannot fail and
cannot return poor quality random data. While abort() is not normally
suitable for a library, it makes sense here.

Reviewed by:	ed, jonathan, markm
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8077
2016-10-03 13:12:44 +00:00
Konstantin Belousov
ddce1c3ddb Export the mq_getfd_np() symbol from librt.so, which allows to get
file descriptor for the given posix mqueue.  Export the
timer_oshandle_np() symbol to get ktimer id for the given posix timer.

Requested by:	Lewis Donzis <lew@perftech.com>
Reviewed by:	jilles
Discussed with:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-10-02 17:02:59 +00:00
Ruslan Bukin
e5edb77987 Fix libjail reached latest sysctl entry.
Reviewed by:	jamie
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8096
2016-10-02 11:56:17 +00:00
Toomas Soome
062b8022ac Fix remaining cstyle issues in libstand/cd9660.c
Reported by:	Bruce Evans <brde@optusnet.com.au>
Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D8107
2016-10-01 07:46:28 +00:00
Toomas Soome
6a21906bea cstyle fix of cd9660_open in libstand
rS306534 did create bad cstyle by my mistake, correcting it.

Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D8103
2016-09-30 23:19:08 +00:00
Conrad Meyer
c038bae74c open.2: Document Capsicum behavior
Document open(2) and openat(2) behavior in Capsicum capability mode.

Reviewed by:	ed (previous version), emaste, rwatson (previous version),
		wblock
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D7947
2016-09-30 23:01:37 +00:00
Toomas Soome
339e076e67 cd9660_open should check for padding
The libstand cd9660 reader code must check for extents having padding.

Reviewed by:	jhb
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D8101
2016-09-30 22:28:20 +00:00
Ed Maste
cf825f93cc libm: remove unused variables for LDBL_MANT_DIG != 113
Sponsored by:	The FreeBSD Foundation
2016-09-30 20:20:07 +00:00
Adrian Chadd
35c05a4fbc Add librss, a simple wrapper around RSS APIs so applications can begin auto-tuning.
I've used this in a handful of RSS test applications.  It is just some
very simple functions to fetch the RSS configuration, query the per-bucket
CPU set, and mark sockets as local to an RSS bucket.  It should be sufficient
for both thread-based and process-based workloads.

(Yes, I wrote a manpage.)

This is based on some early RSS API and wrapper API work I did whilst
I was at Netflix.  Thanks to Netflix for the very original work that
spawned this; thanks to Peter Grehan for his feedback about RSS APIs
and thanks to Jack Vogel and Navdeep Parhar for the NIC-facing side of the
APIs.  These fed into the simple userland API I wrote up here.

Reviewed by:	gallatin
2016-09-30 19:59:56 +00:00
Konstantin Belousov
6d8f097966 Reword the statement.
Submitted by:	wblock
MFC after:	3 days
2016-09-30 16:02:25 +00:00
Konstantin Belousov
98003d078f Add an article.
Submitted by:	wblock
MFC after:	3 days
2016-09-30 15:47:13 +00:00
Dag-Erling Smørgrav
58d2f848e2 Reinstate Xr macros that were accidentally removed in a previous
commit.  Add some missing cross-references to the SEE ALSO section.
Bump date now that there are content changes.

MFC after:	1 week
2016-09-30 13:05:32 +00:00
Dag-Erling Smørgrav
2224742ff4 Minor markup and wording fixes.
MFC after:	1 week
2016-09-30 13:04:18 +00:00
Dag-Erling Smørgrav
1577b7750e After perusal of the documentation and some experimentation, I found a
version that works with both groff and mandoc.

Hat tip to:	kib
MFC after:	1 week
2016-09-30 11:05:29 +00:00
Dag-Erling Smørgrav
ef14f6a19e Format the table correctly, using cell separators instead of relying
on *roff or mandoc to guess where one cell ends and the next begins.

MFC after:	1 week
2016-09-30 09:23:29 +00:00
Ed Maste
d6e65178c6 libm: simplify i387 subdir logic with make's :S substitution 2016-09-28 17:44:03 +00:00
Ed Maste
dcdfa506cc libm: fix some unused variable (rcsid) and dangling else warnings
s_{fabs,fmax,logb,scalb}{,f,l}.c may be built elsewhere with a higher
WARNS setting.

Reviewed by:	ed
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8061
2016-09-28 14:48:34 +00:00
Ed Maste
040b30497c libcompiler_rt: move file list to Makefile.inc for reuse elsewhere
Also switch to the style used in the clang390-import branch to reduce
future conflicts.

Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8039
2016-09-27 18:55:45 +00:00
Ed Maste
f987297fc9 Add a WITHOUT_DIALOG src.conf(5) knob
It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by:	dteske
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7969
2016-09-27 18:08:38 +00:00
Konstantin Belousov
5925fff002 Editing fixes for r306257, documentation for trapcap.
Suggested by:	wblock
Discussed with:	jilles
Reviewed by:	cem (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D8023
2016-09-27 11:31:53 +00:00
Ruslan Bukin
5bec6d5513 Mark SSP broken on MIPS.
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-09-27 09:44:30 +00:00
Ruslan Bukin
cda20f96df Increase timeout from 300 (default) to 600 seconds.
It takes 6-7 minutes to proceed the test on MIPS64EB.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-09-26 20:13:33 +00:00
Pedro F. Giffuni
70e7268bd5 hash(3): protect in-memory page when using cross-endianness.
When writing out pages in the "other endian" format, make a copy
instead of trashing the in-memory one.

Obtained from:	NetBSD (CVS rev. 1.29)
2016-09-26 16:06:50 +00:00
Ruslan Bukin
ed8f18ded4 Don't build SSP tests on MIPS as we dont have stack-protector
supported on this platform.

Discussed with:	brooks
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-09-26 15:38:02 +00:00
Konstantin Belousov
fd6c95c09f Document thr_suspend(2) and thr_wake(2).
Reviewed by:	bjk, jilles
Discussed with:	emaste, wblock
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D8016
2016-09-26 08:18:34 +00:00
Pedro F. Giffuni
d191be26c0 btree(3): don't shortcut closing if the metadata is dirty.
Obtained from:	NetBSD (from krb5 tree)

MFC after:	3 weeks
2016-09-26 02:29:28 +00:00
Marcel Moolenaar
2b4da8aa20 When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same target
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

See also r305855

MFC after:	1 month
Sponsored by:	Bracket Computing
Differential Revision:	https://reviews.freebsd.org/D7906
2016-09-24 15:11:27 +00:00
Ed Maste
d7e002ff96 libcompiler_rt: use ${SRCTOP} for the top of the FreeBSD tree 2016-09-23 13:23:52 +00:00
Konstantin Belousov
23670cf40a Document r306081, i.e. procctl(PROC_TRAPCAP) and sysctl kern.trap_enocap.
Reviewed by:	cem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D8003
2016-09-23 09:26:40 +00:00
Conrad Meyer
852aea3dd7 posix_openpt.2: Sort includes per style(9)
Sponsored by:	Dell EMC Isilon
2016-09-21 17:51:27 +00:00
Andrey A. Chernov
5fca7e1f13 1) For already non-standard %z extension implement GNU compatible formats:
+hh and -hh.
2) Check for incorrect values for %z.

MFC after:      7 days
2016-09-21 15:47:40 +00:00
Ruslan Bukin
dab6d6fb5a Use kqueue(2) instead of select(2).
This helps to ensure we will not lose SIGINT sent by parent to child.

Reviewed by:	sbruno, ngie
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D7892
2016-09-21 11:59:52 +00:00
Andrey A. Chernov
62b939ebfb 1) Microoptimize %p case.
2) Implememt %u for GNU compatibility.
3) Don't forget to advance buf for %w/%u.
4) Fail with incomplete week (week 0) request and no such week in the
year.
5) Fix yday formula when Sunday requested and the week started from Monday.
6) Fail with impossible yday for incomplete week (week 0) and direct %w/%u
request.
7) Shift yday/wday to the first day of the year, if incomplete week
(week 0) requested and no %w/%u used.

MFC after:      7 days
2016-09-21 06:44:32 +00:00
Andrew Turner
5a3a700931 Attach the cortex strings library to the build. Only a subset of functions
have been added as some don't seem to be improvements over the libc C
implementation.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-09-19 15:08:03 +00:00
Enji Cooper
b3ef7604b9 Re-add PACKAGE=> tests to lib/libc/tests/net/getaddrinfo/Makefile and add
it to lib/libc/tests/sys/Makefile [*]

Even though make -VPACKAGE and make -n install seem to do the right thing,
the effects are a bit different, depending on the build host.

MFC after:		1 week
Obtained from:		HardenedBSD (af602f0db) [*]
Reported by:		Oliver Pinter <oliver.pinter@hardenedbsd.org> [*]
Sponsored by:		Dell EMC Isilon
2016-09-19 06:59:17 +00:00
Eric Badger
5c07002e67 Add manpage for rctl_* system calls
Reviewed by:	trasz, wblock
Approved by:	kib (mentor)
MFC after:	3 days
Sponsored by:	Dell Technologies
Differential Revision:	https://reviews.freebsd.org/D7877
2016-09-19 02:25:30 +00:00
Ed Schouten
fd85bff53e Replace dirname(3) by a copy that complies to POSIX.
It turns out that the path normalization that our brand new copy of
dirname(3) does is actually not allowed by the draft version of the
upcoming version of POSIX. It has to behave identically to the
dirname(1) utility.

This change replaces our new dirname(3) implementation by yet another
version that doesn't implement the path normalization logic; it merely
looks for the end of the directory name and overwrites that with a null
byte.

More details: See note #3370 at http://austingroupbugs.net/view.php?id=1073

PR:		212193
Reviewed by:	emaste, jilles
Differential Revision:	https://reviews.freebsd.org/D7790
2016-09-18 20:47:55 +00:00
Enji Cooper
9cd70b19ae Similar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2016-09-18 06:00:07 +00:00
Enji Cooper
e57c1140a0 Remove spurious newlines from atf_tc_fail calls
This changes the results from broken (incorrect) to failed (correct) on
i386

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2016-09-18 05:54:13 +00:00
Enji Cooper
87d5d10d7d Don't define PACKAGE in lib/libc/tests/{iconv,net/getaddrinfo}
needlessly

This is already being done by bsd.test.mk

The other subdirectory Makefiles were intentionally left alone

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2016-09-18 05:12:23 +00:00
Konstantin Belousov
6bd8ddcf0c Fix libprocstat build after r305902.
- Use _Bool to not require userspace to include stdbool.h.
- Make extattr.h usable without vnode_if.h.
- Follow i_ump to get cdev pointer.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-09-17 18:14:31 +00:00
Marcel Moolenaar
cb1cb6a2a8 When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same object
files (case-insensitivity speaking).  This is the case for _Exit.c
and _exit.s.  Compile _Exit.c as C99_Exit.c

Reviewed by:	sjg@
MFC after:	completion
Sponsored by:	Bracket Computing
Differential Revision:	https://reviews.freebsd.org/D7893
2016-09-16 03:04:48 +00:00
Martin Matuska
24113d8c17 MFV r305816:
Sync libarchive with vendor including important security fixes.

Issues fixed (FreeBSD):
PR #778: ACL error handling
Issue #745: Symlink check prefix optimization is too aggressive
Issue #746: Hard links with data can evade sandboxing restrictions

This update fixes the vulnerability #3 and vulnerability #4 as reported in
"non-cryptanalytic attacks against FreeBSD update components".
https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

Fix for vulnerability #2 has already been merged in r304989.

MFC after:	1 week
Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f
2016-09-14 21:15:01 +00:00
Baptiste Daroussin
d600e95429 Add a comment on the #endif related to the guards
Reported by:	tsoome
2016-09-13 15:41:05 +00:00
Allan Jude
567de0da7e Mark libifconfig as private until the API/ABI is stable
libifconfig is still experimental and under active development.
To avoid making any ABI promises, mark the library as private

Suggested by:	bapt
Reviewed by:	kp
2016-09-11 17:44:35 +00:00
Ed Maste
f14f55d622 cap_enter.2: describe flag returned by cap_getmode
Previously the flag returned by cap_getmode was not described explicitly
in the man page.

Reviewed by:	wblock
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7822
2016-09-11 01:11:47 +00:00
Brooks Davis
3662835abf Fix spelling in comment.
Submitted by:	brueffer
2016-09-09 16:18:44 +00:00
Brooks Davis
aec2fba60f Reduce duplicate NOASM and PSEUDO definitions
The initial value of NOASM is nearly the same in all cases and the
initial value of PSEUDO is the same in all cases so reduce duplication
(and hopefully, future merge conflicts) by machine independent defaults.

Also document the PSEUDO variable.

Reviewed by:	jhb, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D7820
2016-09-08 22:38:20 +00:00
Jilles Tjoelker
527094b93f intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).
MFC after:	1 week
2016-09-08 21:50:03 +00:00
Mariusz Zaborski
d3bfc7250f Move libcasper tests from regression/capsicum/libcasper/ to
lib/libcasper/service/${service_name}/tests.

Reviewed by:	emaste, ngie
Differential Revision:	https://reviews.freebsd.org/D7759
2016-09-08 20:01:26 +00:00
Sepherosa Ziehau
ff9eac2e6d pxeboot: Add nfs.read_size tunable.
Increase this tunable improves kernel loading speed.

Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	rpokala, wblock (previous version)
Obtained from:	DragonFlyBSD
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7756
2016-09-08 09:11:13 +00:00
Warner Losh
949b56ba66 Renumber the advertising clause. 2016-09-06 15:17:35 +00:00
Enji Cooper
b8cc28b782 Install h_db to unbreak some of the lib/libc/db testcases after
r305358

MFC after:	59 days
X-MFC with:	r305358
Reported by:	Jenkins, rodrigc
Sponsored by:	EMC / Isilon Storage Division
2016-09-06 00:51:25 +00:00
Martin Matuska
47af42f8e7 MFV r305420:
Sync libarchive with vendor

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This includes a bugfix for a bug that caused ACLs not to be read properly
for files and directories inside subdirectories and as a result not being
stored or being incorrectly stored in tar archives.

MFC after:	3 days
2016-09-05 15:40:41 +00:00
Andrey A. Chernov
031986c4f3 Fix error handling.
MFC after:      3 days
2016-09-05 06:46:04 +00:00
Andrey A. Chernov
0b51c11a0e Fix n == 1 case. Here should be no physical read (fill buffer) attempt
(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.

MFC after:      3 days
2016-09-05 06:10:51 +00:00
Andrey A. Chernov
4a9921c601 1) Prevent out of bounds access to ws[-1] (passed buffer) which happens
when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.

2) Fix EOF checking I mess in my previos r305406 commit.

MFC after:      3 days
2016-09-05 04:49:58 +00:00
Andrey A. Chernov
0c744b20b0 Fix errors handling.
MFC after:      3 days
2016-09-05 03:37:28 +00:00
Kristof Provost
9a2ff3154b libifconfig: style(9) fixes
Also switch from BSD 3-clause to 2-clause license where possible, and
consolidate duplicate 3-clause license into one.

Submitted by:	Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by:	cem, kp
Differential Revision:	https://reviews.freebsd.org/D7764
2016-09-04 20:55:27 +00:00
Bruce Evans
f776d19f07 Oops, the previous i386 version of e_fmodf.S and e_fmodl.S was
actually the amd64 version.
2016-09-04 15:08:14 +00:00
Bruce Evans
5432c3bec3 Disconnect the "optimized" asm variants of cos(), sin() and tan() from
the build on i386.  Leave them in the source tree for regression tests.

The asm functions were always much less accurate (by a factor of more
than 10**18 in the worst case).  They were faster on old CPUs.  But
with each new generation of CPUs they get relatively slower.  The
double precision C version's average advantage is about a factor of 2
on Haswell.

The asm functions were already intentionally avoided in float and long
double precision on i386 and in all precisions on amd64.  Float
precision and amd64 give larger advantages to the C version.  The long
double precision C code and compilers' understanding of long double
precision are not so good, so the i387 is still slightly faster for
long double precision, except for the unimportant subcase of huge args
where the sub-optimal C code now somehow beats the i387 by about a
factor of 2.
2016-09-04 14:12:19 +00:00
Bruce Evans
83e449a402 Add asm versions of fmod(), fmodf() and fmodl() on amd64. Add asm
versions of fmodf() amd fmodl() on i387.

fmod is similar to remainder, and the C versions are 3 to 9 times
slower than the asm versions on x86 for both, but we had the strange
mixture of all 6 variants of remainder in asm and only 1 of 6
variants of fmod in asm.
2016-09-04 12:22:14 +00:00
Dag-Erling Smørgrav
e2d1500434 Upgrade to Unbound 1.5.9. 2016-09-04 12:17:57 +00:00
Bruce Evans
a4c138885e Fix missing fmodl() on arches with 53-bit long doubles.
PR:		199422, 211965
MFC after:	1 week
2016-09-04 12:01:32 +00:00
Enji Cooper
637cce3a32 MFhead @ r305314 2016-09-03 00:50:18 +00:00
Kristof Provost
ec21434933 Renaming libifc to libifconfig in response to feedback on initial commit of
this library. Sticking to 'libifconfig' (and 'ifconfig_' as function prefix)
should reduce chances of namespace collisions, make it more clear what the
library does, and be more in line with existing libraries.

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D7742
Reviewed by:	cem, kp
2016-09-02 18:33:08 +00:00
Hans Petter Selasky
5f51814803 Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.

MFC after:	1 week
2016-09-02 08:44:14 +00:00
Enji Cooper
7a83ecc454 Skip :test_large on i386
More assertions are failing on ^/head now.

PR:	205446
Sponsored by:	EMC / Isilon Storage Division
2016-09-02 08:17:43 +00:00
Brooks Davis
466522c3ac Initialize lists of signals using C99 designators
Reviewed by:	jilles
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D7601
2016-09-02 00:16:19 +00:00
Andrey A. Chernov
2fbab0097a fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete
sequence near EOF), so we can't just check for
(wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with
__SERR clearing/restoring.

MFC after:      7 days
2016-09-01 20:45:04 +00:00
Andrey A. Chernov
88eb1553b0 If error happens, don't overwrite original errno comes from __mbrtowc()
and __srefill().

MFC after:      3 days
2016-09-01 18:12:53 +00:00
Enji Cooper
f8fd1a95d9 MFhead @ r305170 2016-09-01 02:57:15 +00:00
Enji Cooper
eab5e7a376 Don't bake all of CC/CPP/CXX into CFLAGS
Capture executable names for CC, CPP, CXX (assumed to be the
first non-CCACHE_BIN word).

This change strips out all of the cross-compiler arguments, (-target,
-B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
doesn't infect the build and subsequently the test.

Add comments noting why this logic is being added, and why the logic in
r305041 was necessary/what it was trying to achieve.

This is required after recent changes made to the toolchain to always
specify --sysroot, -target, -B, etc with clang in buildworld (presumably
r304681).

Reviewed by:	rodrigc (earlier version)
Reported by:	Jenkins (FreeBSD_HEAD job from 559+)
MFC after:	12 days
X-MFC with:	r304681, r305041
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7732
2016-09-01 02:42:11 +00:00
Jilles Tjoelker
89688ae708 directory(3): Deprecate readdir_r(). Clarify dirent buffers.
In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.

What's more, lthough readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.

Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.

Reviewed by:	ed, wblock
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D7678
2016-08-31 20:38:40 +00:00