Commit Graph

17080 Commits

Author SHA1 Message Date
ngie
f61b60624c 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
dim
24ac568077 Merge ^/head r288831 through r288835. 2015-10-05 20:08:11 +00:00
jgh
2fd2750b54 - address grammar
PR:		203440 (based on)
Submitted by:	ceratv@rpi.edu
Approved by:	wblock@ (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3813
2015-10-05 18:09:43 +00:00
dim
1b28caab43 Merge ^/head r288457 through r288830. 2015-10-05 17:54:54 +00:00
dim
d463dc0074 Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259).
This has also been submitted upstream.
2015-10-05 17:47:23 +00:00
markj
d6b5b38ff0 Revert r288628 and instead fix a discrepancy between the posix_fadvise(2)
man page and POSIX: posix_fadvise(2) returns an error number on failure.

Reported by:	jilles
MFC after:	1 week
2015-10-03 22:27:14 +00:00
bdrewery
c4aef72c06 Include stddef.h for ptrdiff_t 2015-10-03 20:06:50 +00:00
bdrewery
62a263e3d1 Remove redundant COMPAT_32BIT guard on pkgconfig files. This is already handled
by the LIBRARIES_ONLY mechanism protecting FILES.

Sponsored by:	EMC / Isilon Storage Division
2015-10-03 16:34:21 +00:00
hrs
a14f7a3926 - Move PF_LOCAL at the end of the array. PF_INET{,6} is used more often.
- Add SOCKTYPE_ANY to PF_LOCAL.

- Apply AI_CANONNAME to only AF_INET{,6}.  It is not meaningful for the
  other AFs.
2015-10-03 12:40:54 +00:00
dim
c88ca1c406 Merge ^/head r288197 through r288456. 2015-10-01 19:02:45 +00:00
jilles
aca221db9d wordexp: Rewrite to make WRDE_NOCMD reliable.
Shell syntax is too complicated to detect command substitution and unquoted
operators reliably without implementing much of sh's parser. Therefore, have
sh do this detection.

While changing sh's support anyway, also read input from a pipe instead of
arguments to avoid {ARG_MAX} limits and improve privacy, and output count
and length using 16 instead of 8 digits.

The basic concept is:
execl("/bin/sh", "sh", "-c", "freebsd_wordexp ${1:+\"$1\"} -f "$2",
    "", flags & WRDE_NOCMD ? "-p" : "", <pipe with words>);

The WRDE_BADCHAR error is still implemented in libc. POSIX requires us to
fail strings containing unquoted braces with code WRDE_BADCHAR. Since this
is normally not a syntax error in sh, there is still a need for checking
code in libc, we_check().

The new we_check() is an optimistic check that all the characters
  <newline> | & ; < > ( ) { }
are quoted. To avoid duplicating too much sh logic, such characters are
permitted when quoting characters are seen, even if the quoting characters
may themselves be quoted. This code reports all WRDE_BADCHAR errors; bad
characters that get past it and are a syntax error in sh return WRDE_SYNTAX.

Although many implementations of WRDE_NOCMD erroneously allow some command
substitutions (and ours even documented this), there appears to be code that
relies on its security (codesearch.debian.net shows quite a few uses).
Passing untrusted data to wordexp() still exposes a denial of service
possibility and a fairly large attack surface.

Reviewed by:	wblock (man page only)
MFC after:	2 weeks
Relnotes:	yes
Security:	fixes command execution with wordexp(untrusted, WRDE_NOCMD)
2015-09-30 21:32:29 +00:00
bdrewery
7d7e4c43c4 Fix 'ugidfw remove' after r284251 incorrectly changed it.
The sysctl_rule() node removes entries when given a newptr and newlen == 0.
2015-09-29 18:48:12 +00:00
delphij
e8d1e1d737 In this context fclose() can never fail, so assert it in the test
case.
2015-09-29 17:54:28 +00:00
kib
2b6ac44d5d Annotate arm userspace assembler sources stating their tolerance to
the non-executable stack.

Reviewed by:	andrew
Sponsored by:	The FreeBSD Foundation
2015-09-29 16:09:58 +00:00
delphij
14220da890 Use calloc() instead of malloc + memset.
MFC after:	2 weeks
2015-09-29 04:47:31 +00:00
jilles
9ee3062174 fnmatch(): Remove exponential behaviour as in sh r229201.
The old code was exponential in the number of asterisks in the pattern.
However, once a match has been found upto the next asterisk, the previous
asterisks are no longer relevant.
2015-09-27 12:52:18 +00:00
bdrewery
3513be48c0 Add missing CLEANFILES.
MFC after:	1 week
X-MFC-With:	r288199
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 01:04:52 +00:00
bdrewery
459799dc3d 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
bdrewery
f37faa57f7 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
grembo
adca4f81cb Fix non-POSIX-compliant use of getaddrinfo in libfetch
Submitted by:	Boris Kolpackov <boris@codesynthesis.com>
Reviewed by:	bapt
Approved by:	bapt
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3724
2015-09-25 14:24:23 +00:00
bdrewery
71fccfc30f Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:15:24 +00:00
dim
5c80b18763 Merge ^/head r288126 through r288196. 2015-09-24 21:48:04 +00:00
dim
86e5497c67 Revert r286421, now that the fix for LLVM PR24343 is in. 2015-09-24 21:39:31 +00:00
rodrigc
57dcec656d Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
Submitted by:   Sascha Wildner <swildner@dragonflybsd.org>
Obtained from:  DragonFlyBSD (commit 5d7d35b17f98588c39b30036f1a3fe8802935c2c)
2015-09-23 16:16:16 +00:00
delphij
34650d7da6 MFV r288140: update file to 5.25.
MFC after:	1 month
2015-09-23 05:39:20 +00:00
dim
b905d18716 Merge ^/head r288100 through r288125. 2015-09-22 20:32:49 +00:00
rodrigc
aa2db6bfb4 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-22 15:57:26 +00:00
rodrigc
5200f4be66 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-22 15:40:07 +00:00
dim
3715394e84 Merge ^/head r288035 through r288099. 2015-09-22 09:50:11 +00:00
rodrigc
ff5d08b031 Use proper function prototype for readdir().
Eliminates -Wstrict-prototypes warning

Submitted by: Joerg Sonnenberger <joerg@dragonflybsd.org>
Obtained from: DragonFlyBSD (commit 2a6aec8dab58c89961cabcfdb92e0d0ae256dea4)
2015-09-22 07:40:55 +00:00
rodrigc
dc4550e7b2 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-22 07:31:40 +00:00
bdrewery
3faab6f866 Avoid adding duplicates into OBJS. bsd.lib.mk already handles adding
entries to OBJS based on SRCS.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-22 04:55:28 +00:00
bdrewery
22c9fba62b Fix installation of 32bit libraries after r288074.
FILES is not used when LIBRARIES_ONLY is set, which is used to build and
install the lib32 sysroot.  All of the csu files do quality as "libraries"
for this case so just undefine LIBRARIES_ONLY.

This is still better than the previous realinstall handling as it does
not hook into META_MODE properly.

Sponsored by:	EMC / Isilon Storage Division
2015-09-21 21:44:02 +00:00
bdrewery
3cec2c22f8 Replace realinstall: and META_MODE staging hacks with FILES mechanism.
This partially reverts r270170 for lib/csu/i386 while retaining the
change for using bsd.lib.mk.

These FILES groups could go into lib/csu/Makefile.inc but I've kept them
in the Makefiles for clarity.

Sponsored by:	EMC / Isilon Storage Division
2015-09-21 18:39:13 +00:00
des
ea85485818 Restore the upstream (and documented) behavior of searching for modules
both in /usr/lib and /usr/local/lib, thus simplifying the use of modules
from ports, without breaking the compat32 case again.

PR:		191151
MFC after:	3 weeks
2015-09-21 17:26:35 +00:00
dim
a98b889039 Don't install Intrin.h, as this is an intrinsics header for Windows. 2015-09-20 21:39:55 +00:00
rodrigc
6e42fc823f Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 21:21:17 +00:00
rodrigc
4dfb6c3572 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 21:21:01 +00:00
rodrigc
70a6c8c892 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:55:00 +00:00
rodrigc
0cbe54eb2d Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:53:24 +00:00
rodrigc
215fea0400 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:52:13 +00:00
rodrigc
ce886a6233 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:51:52 +00:00
rodrigc
a9a0375d7e Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:50:56 +00:00
rodrigc
aa990038b1 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:50:18 +00:00
dim
18b14b4a2f Merge ^/head r287878 through r288034. 2015-09-20 20:34:17 +00:00
rodrigc
e5a64a53e6 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:28:49 +00:00
rodrigc
a60b0abd9a Remove names from some prototypes 2015-09-20 20:27:57 +00:00
rodrigc
141020ed04 Remove names from some prototypes 2015-09-20 20:26:46 +00:00
rodrigc
5919af45fe Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:24:28 +00:00
rodrigc
74c1506b33 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:23:16 +00:00
rodrigc
424fc070ef Remove names from some prototypes 2015-09-20 20:21:49 +00:00
rodrigc
e23bf826df Remove names from some prototypes 2015-09-20 20:16:34 +00:00
rodrigc
1737b90d79 Remove names from prototypes 2015-09-20 20:15:44 +00:00
rodrigc
fbd3bd1bfb Add include for declaration of _set_tp(). Eliminates -Wmissing-prototypes warnings. 2015-09-20 04:59:01 +00:00
rodrigc
0cd26f001a Add declarations to eliminate -Wmissing-prototypes warnings 2015-09-20 04:26:55 +00:00
rodrigc
8c6e2102df Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-20 04:23:16 +00:00
rodrigc
101e50ce2f Add declaration to eliminate -Wmissing-prototypes warning 2015-09-20 04:21:44 +00:00
rodrigc
f7aca4b673 Add declarations to netdb_private.h to eliminate -Wmissing-prototypes warnings. 2015-09-20 04:20:31 +00:00
rodrigc
5289640ead Add declarations to eliminate -Wmissing-prototypes warnings 2015-09-20 04:17:53 +00:00
rodrigc
fd3fe449bf Define _NS_PRIVATE to make declarations visible.
This eliminates -Wmissing-prototypes warnings.
2015-09-20 04:17:03 +00:00
rodrigc
587e2d1829 Add missing includes to eliminate -Wmissing-prototypes warnings 2015-09-20 04:15:37 +00:00
rodrigc
a584fc06f1 Adding missing declarations to eliminate -Wmissing-prototypes warnings 2015-09-20 04:06:55 +00:00
rodrigc
07e3f06934 Add missing include to eliminate -Wmissing-prototypes warning 2015-09-20 04:06:04 +00:00
rodrigc
177f72974d Add declaration to eliminate -Wmissing-prototypes warning 2015-09-20 03:59:27 +00:00
rodrigc
49c1e7af60 Add declarations to eliminate -Wmissing-prototypes warnings 2015-09-20 03:58:27 +00:00
rodrigc
4c66a735a8 Adding missing include to eliminate -Wmissing-prototypes warning 2015-09-20 03:56:57 +00:00
rodrigc
0fd58af262 Add declarations to eliminate -Wmissing-prototypes warnings 2015-09-20 03:55:03 +00:00
rodrigc
08c0b3cae7 Add declarations to eliminate -Wmissing-prototypes warnings. 2015-09-20 03:53:08 +00:00
rodrigc
0046fafdb2 Add declaration to eliminate -Wmissing-prototypes warning. 2015-09-20 03:51:15 +00:00
rodrigc
418ac8aebe Add missing include to eliminate -Wmissing-prototypes warnings 2015-09-20 03:49:08 +00:00
rodrigc
04f98ba6e2 Add missing includes to eliminate -Wmissing-prototypes warnings 2015-09-20 03:45:57 +00:00
hrs
a3fcca6713 Add PF_LOCAL support in getaddrinfo(3) and getnameinfo(3):
- In a PF_LOCAL address, "hostname" must begins with '/' and "servname"
  is always NULL.  All of ai_flags are ignored.

- PF_UNSPEC matches PF_LOCAL.  EAI_SERVICE is not returned to make
  AF-independent programming easier; "servname" is always ignored
  in PF_LOCAL.  In practice, PF_INET* and PF_LOCAL are
  mutually-exclusive because a hostname which begins with '/' is invalid
  in PF_INET*.  No domain name resolution is performed for a PF_LOCAL address.

Differential Revision:	https://reviews.freebsd.org/D3634
2015-09-20 01:09:23 +00:00
jilles
b76aba5008 libc: Consistently call _ioctl() internally, not ioctl(). 2015-09-19 20:27:09 +00:00
bdrewery
deb97713e0 Replace beforeinstall: handling with FILES.
This actually fixes some cases to respect LIBRARIES_ONLY.

Sponsored by:	EMC / Isilon Storage Division
2015-09-18 23:49:32 +00:00
delphij
76fb979246 There is no HP 300 support in FreeBSD anymore, so remove the obsolete
BUGS section.

While I'm there also bump Dd date.

MFC after:	2 weeks
2015-09-18 20:28:37 +00:00
trasz
bd8e12dd02 Kernel part of reroot support - a way to change rootfs without reboot.
Note that the mountlist manipulations are somewhat fragile, and not very
pretty.  The reason for this is to avoid changing vfs_mountroot(), which
is (obviously) rather mission-critical, but not very well documented,
and thus hard to test properly.  It might be possible to rework it to use
its own simple root mount mechanism instead of vfs_mountroot().

Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2698
2015-09-18 17:32:22 +00:00
des
c5050a3b9f Upgrade to Unbound 1.5.4. 2015-09-17 16:10:11 +00:00
bdrewery
bdebc05d94 Update META_MODE dependencies. 2015-09-17 05:06:34 +00:00
dim
7b8be09912 Merge ^/head r287680 through r287877. 2015-09-16 22:35:59 +00:00
dim
ea5248cdc1 Update libc++ to 3.7.0 release. 2015-09-16 22:26:52 +00:00
rodrigc
da6ab8d992 Use unsigned variables in a few places.
Eliminates gcc 4.9 warnings.
2015-09-14 18:59:01 +00:00
rodrigc
03b17210ed Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-14 18:44:13 +00:00
jilles
5f1339c5cc db/recno: Open with close-on-exec like btree and hash do. 2015-09-13 17:17:52 +00:00
jilles
036f5d34b6 setuid(2): Suggest O_CLOEXEC instead of fcntl(F_SETFD). 2015-09-13 14:00:49 +00:00
dim
5cc32d7f18 Merge ^/head r287527 through r287679. 2015-09-11 17:20:03 +00:00
markj
34116761ff 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:24 +00:00
dim
a8fd1565ce Amend 287626 by adding lib/libclang_rt/safestack. 2015-09-10 20:37:00 +00:00
dim
27c642b88f Update compiler-rt to 3.7.0 release. This also includes the sanitizer
and profile libraries.
2015-09-10 20:35:47 +00:00
tuexen
9701f78cf8 Zero out a local variable also when PURIFY is not defined.
This silence a warning brought up by valgrind whenever if_nametoindex
is used. This was already discussed in PR 166483, but the code
committed in r234329 guards the initilization with #ifdef PURIFY.
Therefore, valgrind still complains. Since this code is not performance
critical, always zero out the local variable to silence valgrind.

PR:		166483
Discussed with:	eadler@
MFC after:	4 weeks
2015-09-10 10:23:23 +00:00
hrs
0e29b6e367 - Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet()
did not work as expected.

- Simplify afdl table lookup.

MFC after:	3 days
2015-09-09 09:19:07 +00:00
andrew
a04f5ff10f Enable mincore_test on arm64, we now have a working pmap_mincore.
PR:		202307
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-09-08 18:44:12 +00:00
trasz
ca187714e1 Make it possible to use acl_create_entry_np(3) to use first entry to an
empty ACL, and to append an entry to an ACL.

Submitted by:	sef@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-08 14:52:14 +00:00
kib
b522c482ce Style. Use ANSI definition, wrap long lines, no initialization in
declaration for locals.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-09-08 08:48:53 +00:00
kib
36ed4c2481 In the pthread_once(), if the initializer has already run, then the
calling thread is supposed to see accesses issued by the initializer.
This means that the read of the once_control->state variable should
have an acquire semantic.  Use atomic_thread_fence_acq() when the
value read is ONCE_DONE, instead of straightforward atomic_load_acq(),
to only put a barrier when needed (*).

On the other hand, the updates of the once_control->state with the
intermediate progress state do not need to synchronize with other
state accesses, remove _acq suffix.

Reviewed by:	alc (previous version)
Suggested by:	alc (*)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-09-08 08:41:07 +00:00
dim
0d218be831 In libz's inflateMark(), avoid left-shifting a negative integer, which
is undefined.

Reviewed by:	delphij
Differential Revision: https://reviews.freebsd.org/D3344
MFC after:	3 days
2015-09-07 20:55:14 +00:00
dim
fe6d24a2c1 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
dim
1e1e44a4f0 Update llvm, clang and lldb to 3.7.0 release. 2015-09-06 19:58:48 +00:00
dim
50ffe587e0 Import libc++ 3.7.0 release (r246257). 2015-09-06 18:46:46 +00:00
dim
3da1400d07 Import compiler-rt 3.7.0 release (r246257). 2015-09-06 18:41:23 +00:00
dim
4238dc458e Import clang 3.7.0 release (r246257). 2015-09-06 18:36:24 +00:00
dim
eaea114246 Update lldb to upstream trunk r242221. 2015-09-06 15:21:47 +00:00
dim
fe74670889 Merge ^/head r286858 through r287489. 2015-09-05 18:36:23 +00:00
delphij
b4f95287e7 MFV r287451 + 287452: file 5.24 + fix for bin/181436.
PR:		181436
MFC after:	2 weeks
2015-09-04 05:56:14 +00:00
delphij
db0a2c953d Expose an interface to determine if an ACE is inherited.
Submitted by:	sef
Reviewed by:	trasz
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3540
2015-09-04 00:14:20 +00:00
cem
f96df638b8 Detect badly behaved coredump note helpers
Coredump notes depend on being able to invoke dump routines twice; once
in a dry-run mode to get the size of the note, and another to actually
emit the note to the corefile.

When a note helper emits a different length section the second time
around than the length it requested the first time, the kernel produces
a corrupt coredump.

NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to
the length of filenames corresponding to vnodes in the process' fd table
via vn_fullpath.  As vnodes may move around during dump, this is racy.

So:

 - Detect badly behaved notes in putnote() and pad underfilled notes.

 - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to
   exercise the NT_PROCSTAT_FILES corruption.  It simply picks random
   lengths to expand or truncate paths to in fo_fill_kinfo_vnode().

 - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to
   disable kinfo packing for PROCSTAT_FILES notes.  This should avoid
   both FILES note corruption and truncation, even if filenames change,
   at the cost of about 1 kiB in padding bloat per open fd.  Document
   the new sysctl in core.5.

 - Fix note_procstat_files to self-limit in the 2nd pass.  Since
   sometimes this will result in a short write, pad up to our advertised
   size.  This addresses note corruption, at the risk of sometimes
   truncating the last several fd info entries.

 - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the
   zero padding.

With suggestions from:	bjk, jhb, kib, wblock
Approved by:	markj (mentor)
Relnotes:	yes
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3548
2015-09-03 20:32:10 +00:00
trasz
09a927822a Fix acl_strip_np(3) breakage introduced in r279962.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-03 11:31:34 +00:00
trasz
8155434653 Fix the way acl_init(3) uses posix_memalign(3) - the latter doesn't
set errno.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-03 11:30:39 +00:00
hrs
fd2a8c5a25 - snprintf() returns at most size-1 of the chars printed into
the buffer.  (n == hostlen) also means the buffer length was
  too short.

- Use sdl->sdl_data only when (sdl->sdl_nlen > 0 && sdl->sdl_alen == 0)
  to prevent redundant output.
2015-09-02 16:50:49 +00:00
kib
3d333a281e Fix t_spawnattr test for attributes handling by posix_spawn(3).
Connect it to the build.

The code assumed that SCHED_* constants form a contiguous set of
numbers, remove the assumption by using schedulers[] array in
get_different_scheduler().  This is no-op on FreeBSD, but improves
code portability.

The selection of different priority used the min/max priority range of
the current scheduler class, instead of the priority to be changed to.
The bug caused the test failure.

Remove duplication of POSIX_SPAWN_SETSIGDEF flag and now unused
duplications of MIN/MAX definitions.

Reviewed by:	jilles, pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3533
2015-09-01 12:47:11 +00:00
rodrigc
cc00887f9b Use unsigned variable.
Eliminates gcc 4.9 compiler warning.
2015-09-01 09:22:24 +00:00
rodrigc
a2c978ffe8 Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-01 08:34:44 +00:00
hrs
065fd54760 Print sdl->sdl_data when sdl->sdl_nlen > 0 as link_ntoa(3) does.
MFC after:	1 week
2015-09-01 08:29:39 +00:00
rodrigc
665c43e2cb Use correct function prototype for signal handler.
Eliminates gcc 4.9 warning.
2015-09-01 07:33:36 +00:00
rodrigc
db950df2a7 Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-01 07:32:03 +00:00
rodrigc
5acb571ae5 Mark unused parameters to reduce gcc 4.9 warnings. 2015-09-01 02:42:05 +00:00
rodrigc
17c9022848 Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-01 02:39:07 +00:00
emaste
ccd91edd51 Enable libproc symbol_lookup tests on arm64
This reverts part of r286863, as the kernel support required by these
tests was added in r287105.

PR:		202305
Sponsored by:	The FreeBSD Foundation
2015-08-31 20:30:06 +00:00
rodrigc
9046760a05 Include stdlib.h to get devname() prototype.
Eliminates -Wmissing-prototypes warnings with gcc
2015-08-31 19:40:54 +00:00
kib
8d79bfab26 Fix a mistake in r287292. Despite correctly stating intent in the
comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	6 days
2015-08-30 04:46:44 +00:00
kib
146b187d13 Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc.  The result was
breaking signal semantic and rtld locking.

The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT.  The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.

The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.

Reported by:	Pete French <petefrench@ingresso.co.uk>
Tested by:	Michiel Boland <boland37@xs4all.nl>
Reviewed by:	jilles (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-29 14:25:01 +00:00
delphij
fc4a623536 Plug memory leaks when running out of memory.
Reported by:	clang scan-build
MFC after:	2 weeks
2015-08-28 06:41:40 +00:00
imp
d1be0bf24e Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags.
Go ahead and defined -D_STANDALONE for all targets (only strictly
needed for some architecture, but harmless on those it isn't required
for). Also add -msoft-float to all architectures uniformly rather
that higgley piggley like it is today.

Differential Revision: https://reviews.freebsd.org/D3496
2015-08-27 23:46:42 +00:00
delphij
ccb05b74c8 Replace strndup with OpenBSD's implementation.
MFC after:	2 weeks
2015-08-26 23:28:10 +00:00
bapt
2a77c3b71d Merge from HEAD 2015-08-25 20:14:50 +00:00
ed
94d0b79c32 Make UTF-8 parsing and generation more strict.
- in mbrtowc() we need to disallow codepoints above 0x10ffff.
- In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D3399
2015-08-25 09:16:09 +00:00
marcel
02ffac2cca 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
andrew
6fb9e68f23 Fix libproc on architectures that don't need the program counter to be
adjusted. This seems to be the case on all non-x86 architectures libproc
supports.

Reviewed by:	kib
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3465
2015-08-24 12:17:15 +00:00
delphij
3d11afb49c Instead of doing an no-op (|= 0), actually clear the flags in
acl_clear_flags_np.

MFC after:	2 weeks
2015-08-24 04:49:20 +00:00
araujo
8ff00506cb Fix spelling.
Reviewed by:		wblock, pfg
Approved by:		bapt (mentor)
Differential Revision:	D3380
2015-08-24 01:53:18 +00:00
araujo
d3a80abb42 Update bzero(3) manpage to following the Posix Standard.
Reviewed by:		wblock, pfg
Approved by:		bapt (mentor)
Differential Revision:	D3380
2015-08-24 01:51:10 +00:00
bjk
378483323d Editing pass on procctl.2
Spell "descendant" correctly.

Grammar fixes.

Use correct width argument to Bl.

Use Po and Pc to avoid leaving a dangling '(' on the end of a line.
2015-08-21 02:42:14 +00:00
kib
fd746f6246 If process becomes reaper (procctl(PROC_REAP_ACQUIRE)) while already
having some children, the children' reaper is not reset to the parent.
This allows for the situation where reaper has children but not
descendands and the too strict asserts in the reap_status() fire.

Remove the wrong asserts, add some clarification for the situation to
the procctl(2) REAP_STATUS.

Reported and tested by:	feld
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-20 22:44:26 +00:00
andrew
a72cc2a109 Add the definitions of __infinity and __nan. 2015-08-20 13:11:52 +00:00
andrew
8f1f0fd477 Add support to libkvm for reading minidumps on arm64. The kernel side is
missing until it can be cleaned up.

Reviewed by:	jhb
Approved by:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3319
2015-08-20 11:07:51 +00:00
cem
27c8209aaa getrlimit.2: Document RSS, AS/VMEM limit behavior more clearly
Alphabetize the RLIMIT_ list while here.

Reviewed by:	jilles (previous version), wblock (previous version)
Approved by:	markj (mentor)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3433
2015-08-20 00:00:15 +00:00
jilles
23ea143940 wordexp(): Improve some error codes.
Distinguish between WRDE_BADVAL and WRDE_SYNTAX based on when the error
occurred (parsing or execution), not based on whether WRDE_UNDEF was passed.

Also, return WRDE_NOSPACE for a few more unexpected results from sh.
2015-08-19 20:31:03 +00:00
dim
3cb87c6fdc Tentative fix for shifting -1 in libz. 2015-08-19 17:11:49 +00:00
delphij
5fe6d5bd0e - ANSIfy
- Remove the redundant _PATH_RSH definition (paths.h at r96194);
 - Use pid_t for PIDs
 - Note that we are at the same level of OpenBSD's counterpart of
   revision 1.7 (r94757).

No functional changes.

MFC after:	2 weeks
2015-08-18 22:37:25 +00:00
jilles
03f340857b wordexp(3): Update man page for no longer using the wordexp builtin. 2015-08-18 20:13:36 +00:00
jasone
51a5d282c9 Add missing sdallocx updates and remove *allocm manpage links.
Submitted by:	jbeich
2015-08-18 08:18:28 +00:00
jasone
cbb776d46e Update jemalloc to version 4.0.0. 2015-08-18 00:21:25 +00:00
emaste
8d027aaaef On arm64 disable three tests that hang or panic
Each issue has a PR open to track. This workaround allows us to run the
tests to investigate the failures and avoid any new regressions.

PR:		202304, 202305, 202307
Reviewed by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3378
2015-08-17 23:19:36 +00:00
dim
1b2342b5ba Merge ^/head r286697 through r286857. 2015-08-17 19:02:23 +00:00
jilles
3ae65c9207 wordexp(): Stop using the undocumented wordexp builtin.
The functionality of the wordexp builtin is easily replaced using normal
shell code, although performance is slightly worse.

This does not mean that wordexp() will remain shell-independent -- a fully
reliable implementation of WRDE_NOCMD is really only possible using
extensions to the shell, or by adding much of the shell's code to libc.
2015-08-16 19:42:15 +00:00
antoine
3d392581f0 bsd.lib.mk has to be included after MLINKS assignment 2015-08-15 19:00:38 +00:00
oshogbo
fe707ca6b5 Add support for the arrays in nvlist library.
- Add
  nvlist_{add,get,take,move,exists,free}_{number,bool,string,nvlist,
  descriptor} functions.
- Add support for (un)packing arrays.
- Add the nvl_array_next field to the nvlist structure.
  If an array is added by the nvlist_{move,add}_nvlist_array function
  this field will contains next element in the array.
- Add the nitems field to the nvpair and nvpair_header structure.
  This field contains number of elements in the array.
- Add special flag (NV_FLAG_IN_ARRAY) which is set if nvlist is a part of
  an array.
- Add special type (NV_TYPE_NVLIST_ARRAY_NEXT).This type is used only
  on packing/unpacking.
- Add new API for traversing arrays (nvlist_get_array_next).
- Add the nvlist_get_pararr function which combines the
  nvlist_get_array_next and nvlist_get_parent functions. If nvlist is in
  the array it will return next element from array. If nvlist is last
  element in array or it isn't in array it will return his
  container (parent). This function should simplify traveling over nvlist.
- Add tests for new features.
- Add documentation for new functions.
- Add my copyright.
- Regenerate the sys/cddl/compat/opensolaris/sys/nvpair.h file.

PR:		191083
Reviewed by:	allanjude (doc)
Approved by:	pjd (mentor)
2015-08-15 06:34:49 +00:00
pfg
13b2a10416 Remove a stale comment and clarify the original where it was taken from
The comment in the libc/sys symbol map referenced the generated symbols
for the syscall trampolines. Such comment was out of place in the secure
symbol map so remove the stale comment and attempt to clarify the old one
to avoid risks of confusion.

Pointed out by:	kib
2015-08-14 14:58:04 +00:00
pfg
9b366d35ee Move the stack protector to a new "secure" directory
As part of the code refactoring to support FORTIFY_SOURCE we want
a new subdirectory "secure" to keep the files related to security.
Move the stack protector functions to this new directory.

No functional change.

Differential Review:	https://reviews.freebsd.org/D3333
2015-08-14 03:03:13 +00:00
araujo
0488e0470d Make clear the bcopy(3) manpage regards when it was marked as LEGACY
as well as when it was removed from POSIX specification.

Reviewed by:		theraven, wblock, bapt, rodrigc
Approved by:		bapt, rodrigc (mentor)
Differential Revision:	D3374
2015-08-14 01:27:30 +00:00
emaste
828e784833 Roll WITHOUT_ELFTOOLCHAIN_TOOLS into WITHOUT_TOOLCHAIN
The option was added only to ease the transition from GNU Binutils to
ELF Tool Chain tools, and that process is now complete (for the viable
replacements). Noting the removal in UPDATING is sufficient as we have
not shipped a release with the option.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3240
2015-08-13 17:50:47 +00:00
mav
054be5ab98 Revert part of r280687, reporting "1" (true) for empty value.
For example, it made gpart partitions without label report "1" as label.

PR:		202089
MFC after:	3 days
2015-08-13 13:19:56 +00:00
araujo
2115d98b6b Remove the mention of memcpy(3) that is build on top of bcopy(3).
Fix some phrases to make it more clear.

Differential Revision:	D3378
Reported by:		bde@
Reviewed by:		wblock
Approved by:		bapt, rodrigc (mentor)
Sponsored by:		gandi.net
2015-08-13 02:31:23 +00:00
dim
3f7c441c4c Merge ^/head r286422 through r286684. 2015-08-12 18:39:49 +00:00
dim
f5e45b5422 Update llvm/clang to r242221. 2015-08-12 18:31:11 +00:00
araujo
b9e6da17b9 Describe that bcopy(3) is deprecated and marked as LEGACY in
POSIX.1-2001 and removed from the specification in POSIX.1-2008.
New softwares shall use memcpy(3) or memmove(3).

Differential Revision:	D3358
Reviewed by:		wblock
Approved by:		rodrigc
Sponsored by:		gandi.net
2015-08-12 00:49:20 +00:00
jilles
95ba2a5275 Fix and re-enable UTF-8 tests. 2015-08-11 21:59:36 +00:00
bapt
0c4c34019a Actually disable the invalid test 2015-08-11 16:08:10 +00:00
kib
def7a72957 Pre-resolve symbols required for the deferred signal processing. This
avoids recursion into rtld when leaving libthr critical section for
the deferred signal delivery.

For the same reason, use syscall(2) instead of referencing
__sys_sigreturn(2).  Syscall() is already pre-resolved for fork()
interceptor.

Tested by:	Andre Meiser <ortadur@web.de>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-10 17:02:42 +00:00
bapt
795d199493 Revert r286465. Retesting it showed that it just works. it might have been
a local issue in my previous tests.
2015-08-09 21:32:05 +00:00
bapt
d3c45097d3 Update wcscoll forgotten in previous patch 2015-08-09 17:08:18 +00:00
bapt
1682cb1283 Fix typo 2015-08-09 12:20:22 +00:00
bapt
4e0791ae19 Use more asprintf
Plug memory leak introduced in previous asprintf addition
2015-08-09 12:13:30 +00:00
bapt
572a3c0af5 Use asprintf/free instead of snprintf 2015-08-09 11:50:50 +00:00
bapt
b0838ae3bd Remove useless variable 2015-08-09 11:47:01 +00:00
bapt
4f14f063cf Readd checking utf16 surrogates that are invalid in utf8 2015-08-09 10:36:25 +00:00
bapt
32118b1361 Mark __collate_load_tables_l as static
Remove useless addition to Symbols.map
2015-08-09 10:24:24 +00:00
dim
bcea9d50b1 In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined.  Replace it with the intended value, in a defined way.

Reviewed by:	bde
MFC after:	3 days
2015-08-09 10:00:13 +00:00
peter
3499c2f483 Move the USE_PREAD configuration knob out of the middle of the autoconf
generated ones.  It is easy to mistake as an option that has gone away
when it's actually a control that was explicitly turned on for FreeBSD.
2015-08-09 05:54:53 +00:00
bapt
9e9acbb2b8 Fix typo
Fix bad location for include

Reported by:	jilles
2015-08-09 00:21:59 +00:00
bapt
d68017be3a Fix typo
Remove useless tests before free()

Suggested by:	jilles
2015-08-09 00:19:14 +00:00
bapt
2c81d16589 Merge from HEAD 2015-08-09 00:15:17 +00:00
bapt
9e0d1c3e19 Remove 5 and 6 bytes sequences which are illegal in UTF-8 space. (part2)
Per rfc3629 value greater than 0x10ffff should be rejected

Suggested by:	jilles
2015-08-09 00:06:56 +00:00
bapt
df871b442a Remove 5 and 6 bytes sequences which are illegal in UTF-8 space.
Per rfc3629 value greater than 0x10ffff should be rejected

Suggested by:	jilles
2015-08-08 23:59:15 +00:00
bapt
9dc264a4d3 Fix typo 2015-08-08 23:17:10 +00:00
bapt
1cd79ad208 The regex code does not work with multibyte codesets like UTF-8.
In fact, it doesn't even work with single-byte codesets like ISO-8859-1.
The comparison blows up at index 128 (the range is 0 to UCHAR_MAX (255).

As a temporary workaround, all comparisons will be done in C locale
regardless of the environment setting.  The regex library needs to be
updated to handle all codesets.

Obtained from:	Dragonfly
2015-08-08 19:29:59 +00:00
bapt
0de7690917 Revamp CTYPE support (from Illumos & Dragonfly)
Obtained from:	Dragonfly
2015-08-08 18:22:14 +00:00
bapt
11a5726cda The collate functions within libc have been using version 1 and 1.2 of the
packed LC_COLLATE binary formats. These were generated with the colldef
tool, but the new LC_COLLATE files are going to be generated by the new
localedef tool using CLDR POSIX files as input.  The BSD-flavored
version of localedef identifies the format as "BSD 1.0".  Any
LC_COLLATE file with a different version will simply not be loaded, and
all LC* categories will get set to "C" (aka "POSIX") locale.

This work is based off of Nexenta's contribution to Illumos.
The integration with xlocale is John Marino's work for Dragonfly.

The following commits will enable localedef tool, disable the colldef
tool, add generated colldef directory, and finally remove colldef from
base.

The only difference with Dragonfly are:
- a few fixes to build with clang
- And identification of the flavor as "BSD 1.0" instead of "Dragonfly 4.4"

Obtained from:	Dragonfly
2015-08-07 23:41:26 +00:00
svnmir
6416b56f5a Vendor import of clang trunk r242221:
https://llvm.org/svn/llvm-project/cfe/trunk@242221
2015-08-07 23:02:56 +00:00
svnmir
c5dd590220 Vendor import of llvm trunk r242221:
https://llvm.org/svn/llvm-project/llvm/trunk@242221
2015-08-07 23:01:46 +00:00
dim
a862047780 Merge ^/head r285924 through r286421. 2015-08-07 20:18:55 +00:00
dim
a7d397c2d7 Apply an atrocious hack to libm's pow() implementation, to work around
LLVM PR 24343.  This fixes the graphics/png build on i386, which
otherwise failed during its tests because of floating point exceptions,
leading to >5000 skipped other ports.
2015-08-07 20:13:04 +00:00
vangyzen
c03b18934d Disable SSE in libthr
Clang emits SSE instructions on amd64 in the common path of
pthread_mutex_unlock.  If the thread does not otherwise use SSE,
this usage incurs a context-switch of the FPU/SSE state, which
reduces the performance of multiple real-world applications by a
non-trivial amount (3-5% in one application).

Instead of this change, I experimented with eagerly switching the
FPU state at context-switch time.  This did not help.  Most of the
cost seems to be in the read/write of memory--as kib@ stated--and
not in the #NM handling.  I tested on machines with and without
XSAVEOPT.

One counter-argument to this change is that most applications already
use SIMD, and the number of applications and amount of SIMD usage
are only increasing.  This is absolutely true.  I agree that--in
general and in principle--this change is in the wrong direction.
However, there are applications that do not use enough SSE to offset
the extra context-switch cost.  SSE does not provide a clear benefit
in the current libthr code with the current compiler, but it does
provide a clear loss in some cases.  Therefore, disabling SSE in
libthr is a non-loss for most, and a gain for some.

I refrained from disabling SSE in libc--as was suggested--because
I can't make the above argument for libc.  It provides a wide variety
of code; each case should be analyzed separately.

https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055193.html

Suggestions from:	dim, jmg, rpaulo
Approved by:	kib (mentor)
MFC after:	2 weeks
Sponsored by:	Dell Inc.
2015-08-05 12:53:55 +00:00
ed
4a54322f0b Make it possible to implement poll(2) on top of kqueue(2).
It looks like EVFILT_READ and EVFILT_WRITE trigger under the same
conditions as poll()'s POLLRDNORM and POLLWRNORM as described by POSIX.
The only difference is that POLLRDNORM has to be triggered on regular
files unconditionally, whereas EVFILT_READ only triggers when not EOF.

Introduce a new flag, NOTE_FILE_POLL, that can be used to make
EVFILT_READ and EVFILT_WRITE behave identically to poll(). This flag
will be used by cloudlibc's poll() function.

Reviewed by:	jmg
Differential Revision:	https://reviews.freebsd.org/D3303
2015-08-05 07:34:29 +00:00
kib
abef15cd81 Copy the fencing of the algorithm to do lock-less update and reading
of the timehands, from the kern_tc.c implementation to vdso.  Add
comments giving hints where to look for the algorithm explanation.

To compensate the removal of rmb() in userspace binuptime(), add
explicit lfence instruction before rdtsc.  On i386, add usual
complications to detect SSE2 presence; assume that old CPUs which do
not implement SSE2 also execute rdtsc almost in order.

Reviewed by:	alc, bde (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-08-04 12:33:51 +00:00
jhb
b4b9484f1d Fix a couple of markup typos.
MFC after:	2 weeks
2015-08-02 02:00:20 +00:00
bdrewery
409c6f37f9 unlink(2): Note the possibility for ENOSPC to be returned on ZFS.
PR:		154930
2015-07-28 22:48:58 +00:00
bdrewery
ca4793bcc9 MFV r285970:
Apply upstream changeset bf4f6ec64e:

  Fix issue 356: properly skip a sparse file entry in a tar file.

PR:		201506
MFC after:	3 days
Relnotes:	yes
2015-07-28 18:41:28 +00:00
dim
c38a9a5a20 Merge ^/head r285793 through r285923. 2015-07-27 22:20:28 +00:00
ed
459f42dd55 Make shutdown() return ENOTCONN as required by POSIX, part deux.
Summary:
Back in 2005, maxim@ attempted to fix shutdown() to return ENOTCONN in case the socket was not connected (r150152). This had to be rolled back (r150155), as it broke some of the existing programs that depend on this behavior. I reapplied this change on my system and indeed, syslogd failed to start up. I fixed this back in February (279016) and MFC'ed it to the supported stable branches. Apart from that, things seem to work out all right.

Since at least Linux and Mac OS X do the right thing, I'd like to go ahead and give this another try. To keep old copies of syslogd working, only start returning ENOTCONN for recent binaries.

I took a look at the XNU sources and they seem to test against both SS_ISCONNECTED, SS_ISCONNECTING and SS_ISDISCONNECTING, instead of just SS_ISCONNECTED. That seams reasonable, so let's do the same.

Test Plan:
This issue was uncovered while writing tests for shutdown() in CloudABI:

https://github.com/NuxiNL/cloudlibc/blob/master/src/libc/sys/socket/shutdown_test.c#L26

Reviewers: glebius, rwatson, #manpages, gnn, #network

Reviewed By: gnn, #network

Subscribers: bms, mjg, imp

Differential Revision: https://reviews.freebsd.org/D3039
2015-07-27 13:17:57 +00:00
pfg
759686c03c Bump GCC max-inline-insns-single in libiconv_modules and grep
This is required by our FORTIFY_SOURCE implementation as it
does more inlining. As a rule of thumb, FORTIFY_SOURCE doubles
the number  of inlines except that in grep inlining
blows up for some reason.
2015-07-26 00:11:04 +00:00
trasz
bd230b9731 Update Capsicum and Mandatory Access Control manual pages
to no longer claim they are experimental.

Reviewed by:	rwatson@, wblock@
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2985
2015-07-25 15:56:49 +00:00
delphij
507c7ca633 Document the fact that system(3) can easily be misused due to shell meta
characters are honored.  While I'm there also mention posix_spawn in the
SEE ALSO section.

MFC after:	2 weeks
2015-07-25 00:21:29 +00:00
trasz
ebf63a0fc9 Add missing capitalization. 2015-07-24 18:13:13 +00:00
dim
56628666d9 Merge ^/head r285341 through r285792. 2015-07-22 19:55:32 +00:00
pluknet
7117e1104e Add missing priority argument in example code in BUGS section.
PR:		201725
Submitted by:	Thomas Cort
MFC after:	1 week
2015-07-21 09:44:45 +00:00
pfg
317b3132ab libusb: Fix minor cast-qual warning.
Fix a warning triggered by the gcc + FORTIFY_SOURCE patches:

In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141:
warning: passing argument 1 of 'memcpy' discards qualifiers from pointer
target type

Submitted by:	hselansky
2015-07-20 16:15:56 +00:00
bapt
34ac7bd4d3 Drop libarchive.pc
We want to ensure we always use libarchive from ports in the ports tree.
It simplifies ports maintainance and anyway libarchive.pc was not reflecting the
different way libarchive can be built in base
2015-07-19 21:31:52 +00:00
kib
48ccbdea81 The si_status field of the siginfo_t, provided by the waitid(2) and
SIGCHLD signal, should keep full 32 bits of the status passed to the
_exit(2).

Split the combined p_xstat of the struct proc into the separate exit
status p_xexit for normal process exit, and signalled termination
information p_xsig.  Kernel-visible macro KW_EXITCODE() reconstructs
old p_xstat from p_xexit and p_xsig.  p_xexit contains complete status
and copied out into si_status.

Requested by:	Joerg Schilling
Reviewed by:	jilles (previous version), pho
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2015-07-18 09:02:50 +00:00
bapt
862b89af4e .ie is not supposed to be used in manpages
Submitted by:	carsten.kunze@arcor.de
2015-07-14 15:21:00 +00:00
alc
c97201a229 Correct the description of MADV_DONTNEED. Specifically, after using
MADV_DONTNEED, while pages faults on the affected address range are more
likely to occur, they are not guaranteed to occur.

MFC after:	3 days
2015-07-12 19:18:19 +00:00
rodrigc
ff453892a2 Add new include path for sha256.h
This fixes the bootstrap build on FreeBSD 10.

Submitted by:	andrew
2015-07-12 03:39:36 +00:00
adrian
41db4b88e0 Add an initial NUMA affinity/policy configuration for threads and processes.
This is based on work done by jeff@ and jhb@, as well as the numa.diff
patch that has been circulating when someone asks for first-touch NUMA
on -10 or -11.

* Introduce a simple set of VM policy and iterator types.
* tie the policy types into the vm_phys path for now, mirroring how
  the initial first-touch allocation work was enabled.
* add syscalls to control changing thread and process defaults.
* add a global NUMA VM domain policy.
* implement a simple cascade policy order - if a thread policy exists, use it;
  if a process policy exists, use it; use the default policy.
* processes inherit policies from their parent processes, threads inherit
  policies from their parent threads.
* add a simple tool (numactl) to query and modify default thread/process
  policities.
* add documentation for the new syscalls, for numa and for numactl.
* re-enable first touch NUMA again by default, as now policies can be
  set in a variety of methods.

This is only relevant for very specific workloads.

This doesn't pretend to be a final NUMA solution.

The previous defaults in -HEAD (with MAXMEMDOM set) can be achieved by
'sysctl vm.default_policy=rr'.

This is only relevant if MAXMEMDOM is set to something other than 1.
Ie, if you're using GENERIC or a modified kernel with non-NUMA, then
this is a glorified no-op for you.

Thank you to Norse Corp for giving me access to rather large
(for FreeBSD!) NUMA machines in order to develop and verify this.

Thank you to Dell for providing me with dual socket sandybridge
and westmere v3 hardware to do NUMA development with.

Thank you to Scott Long at Netflix for providing me with access
to the two-socket, four-domain haswell v3 hardware.

Thank you to Peter Holm for running the stress testing suite
against the NUMA branch during various stages of development!

Tested:

* MIPS (regression testing; non-NUMA)
* i386 (regression testing; non-NUMA GENERIC)
* amd64 (regression testing; non-NUMA GENERIC)
* westmere, 2 socket (thankyou norse!)
* sandy bridge, 2 socket (thankyou dell!)
* ivy bridge, 2 socket (thankyou norse!)
* westmere-EX, 4 socket / 1TB RAM (thankyou norse!)
* haswell, 2 socket (thankyou norse!)
* haswell v3, 2 socket (thankyou dell)
* haswell v3, 2x18 core (thankyou scott long / netflix!)

* Peter Holm ran a stress test suite on this work and found one
  issue, but has not been able to verify it (it doesn't look NUMA
  related, and he only saw it once over many testing runs.)

* I've tested bhyve instances running in fixed NUMA domains and cpusets;
  all seems to work correctly.

Verified:

* intel-pcm - pcm-numa.x and pcm-memory.x, whilst selecting different
  NUMA policies for processes under test.

Review:

This was reviewed through phabricator (https://reviews.freebsd.org/D2559)
as well as privately and via emails to freebsd-arch@.  The git history
with specific attributes is available at https://github.com/erikarn/freebsd/
in the NUMA branch (https://github.com/erikarn/freebsd/compare/local/adrian_numa_policy).

This has been reviewed by a number of people (stas, rpaulo, kib, ngie,
wblock) but not achieved a clear consensus.  My hope is that with further
exposure and testing more functionality can be implemented and evaluated.

Notes:

* The VM doesn't handle unbalanced domains very well, and if you have an overly
  unbalanced memory setup whilst under high memory pressure, VM page allocation
  may fail leading to a kernel panic.  This was a problem in the past, but it's
  much more easily triggered now with these tools.

* This work only controls the path through vm_phys; it doesn't yet strongly/predictably
  affect contigmalloc, KVA placement, UMA, etc.  So, driver placement of memory
  isn't really guaranteed in any way.  That's next on my plate.

Sponsored by:	Norse Corp, Inc.; Dell
2015-07-11 15:21:37 +00:00
bapt
015d4dceed Since sh(1) now supports mulitbyte (only UTF-8) clarify the related BUGS
section in wordexp(3) manual page

Discussed with:	jilles
2015-07-11 13:07:50 +00:00
jmg
ec1fe94d10 Complete the move that was started w/ r263218.. For some reason I
didn't delete the files, so that means we need to bring the changes in
r282726 to the correct files..

make tinderbox completed with this patch...
2015-07-11 03:12:34 +00:00
andrew
87fffd8ba1 Add support for makecontext. This supports up to 8 arguments as this
simplifies the code, these can be passed in registers.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-07-10 08:36:22 +00:00
dim
1ebfd3aba9 Merge ^/head r285284 through r285340. 2015-07-09 22:46:28 +00:00
jmg
9b2d45a850 increase buffer size to significantly increase performance...
see:
https://docs.freebsd.org/cgi/mid.cgi?20150513080342.GE37063@funkthat.com

for benchmarks...
2015-07-09 16:13:05 +00:00
dim
91db3ac96d Merge ^/head r285153 through r285283. 2015-07-08 18:43:55 +00:00
luigi
aa3c990c7d only enable immintrin when clang is used. The base gcc does not support it.
Reviewed by:	delphij
2015-07-08 18:36:37 +00:00
pfg
3702cad714 cosmetic: whitespaces-tab before EOL
Obtained from:	cpi-llvm project
2015-07-08 16:35:24 +00:00
trasz
c6668379e1 Fix markup.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-07-07 19:23:59 +00:00
trasz
e6515fdae7 Remove reboot.S (part of libc). It's not needed and was actually
broken - returning 0 from reboot(2) resulted in SIGBUS.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-07-07 09:25:51 +00:00
gshapiro
7076196a50 libsm/path.c is about to disappear in the merge of sendmail 8.15.2. It is an
empty file now so it is safe to remove before the merge.

MFC after:	3 days
2015-07-07 02:35:06 +00:00
neel
e9213dd046 Move the 'devmem' device nodes from /dev/vmm to /dev/vmm.io
Some external tools just do a 'ls /dev/vmm' to figure out the bhyve virtual
machines on the host. These tools break if the devmem device nodes also
appear in /dev/vmm.

Requested by:	grehan
2015-07-06 19:41:43 +00:00
andrew
cb62c1ffae Add hton and ntoh to the arm64 Symbols.map file, they exist but were not
exported.
2015-07-06 09:57:40 +00:00
pkelsey
2671c7e7e6 Fix sysctl(3) so it returns the intended values for all mib names in
the 'user' sysctl tree, which have all been coming back 0 or empty
since r240176.

Differential Revision: https://reviews.freebsd.org/D2945
Reviewed by: sbruno
Approved by: jmallett (mentor)
MFC after: 3 days
2015-07-06 01:42:12 +00:00
dim
706271a799 Update llvm/clang to r241361. 2015-07-05 22:34:42 +00:00
dim
e7bcad3278 Vendor import of clang trunk r241361:
https://llvm.org/svn/llvm-project/cfe/trunk@241361
2015-07-05 14:23:59 +00:00
dim
d2fc7c7001 Vendor import of llvm trunk r241361:
https://llvm.org/svn/llvm-project/llvm/trunk@241361
2015-07-05 14:21:36 +00:00
dim
6f44bd3256 Merge ^/head r284737 through r285152. 2015-07-04 21:50:39 +00:00
araujo
886fc0a8be Remove unused variable to silence clang warning.
Differential Revision:	D2683
Reviewed by:		rodrigc, bapt
2015-07-04 17:22:07 +00:00
oshogbo
e1ffe0f912 Add fdclose(3) function.
This function is equivalent to fclose(3) function except that it
does not close the underlying file descriptor.
fdclose(3) is step forward to make FILE structure private.

Reviewed by:	wblock, jilles, jhb, pjd
Approved by:	pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D2697
2015-07-04 16:42:14 +00:00
oshogbo
852c8fe589 Move the nvlist source and private includes from sys/kern to seperate
directory sys/contrib/libnv.

The goal of this operation is to NOT install header files which shouldn't
be used outside the nvlist library.

Approved by:	pjd (mentor)
2015-07-04 16:33:37 +00:00
oshogbo
c202dbaf0a Move nvlist documentation to the FreeBSD Kernel Developer's sections.
Approved by:	pjd (mentor)
2015-07-04 10:27:30 +00:00
emaste
cea4c16751 Update LLDB snapshot to upstream r241361
Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)
2015-07-04 01:02:43 +00:00
gnn
ea302f3ee6 New AES modes for IPSec, user space components.
Update setkey and libipsec to understand aes-gcm-16 as an
encryption method.

A partial commit of the work in review D2936.

Submitted by:	eri
Reviewed by:	jmg
MFC after:	2 weeks
Sponsored by:	Rubicon Communications (Netgate)
2015-07-03 20:09:14 +00:00
kib
06c28ee071 Grammar and language fixes.
Submitted by:	wblock
Review:	https://reviews.freebsd.org/D2969
MFC after:	12 days
2015-07-03 17:30:31 +00:00
sjg
4beac78e55 Updated depends 2015-07-03 06:11:54 +00:00
oshogbo
55d9527633 Let the nv.h and dnv.h includes be only in sys directory.
Change consumers to include those files from sys.
Add duplicated files to ObsoleteFiles.

Approved by:	pjd (mentor)
2015-07-02 21:58:10 +00:00
garga
0664f96e03 Bump .Dd due to changes made in r285050 and r285053
Spotted by:	loos
Approved by:	loos
2015-07-02 19:41:08 +00:00
garga
53070d52a7 Improve pw_lock.3 text changed in r285050
Suggested by:	wblock
Approved by:	gnn
2015-07-02 18:27:18 +00:00
garga
43727d164b When passwd or group information is changed (by pw, vipw, chpass, ...)
temporary file is created and then a rename() call move it to official file.
This operation didn't have any check to make sure data was written to disk
and if a power cycle happens system could end up with a 0 length passwd
or group database.

There is a pfSense bug with more infor about it:

https://redmine.pfsense.org/issues/4523

The following changes were made to protect passwd and group operations:

* lib/libutil/gr_util.c:
 - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
 - After rename(), fsync() call on directory for faster result

* lib/libutil/pw_util.c
 - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file

* usr.sbin/pwd_mkdb/pwd_mkdb.c
 - Added O_SYNC flag on dbopen() calls
 - After rename(), fsync() call on directory for faster result

* lib/libutil/pw_util.3
 - pw_lock() returns a file descriptor to master password file on success

Differential Revision:	https://reviews.freebsd.org/D2978
Approved by:	bapt
Sponsored by:	Netgate
2015-07-02 17:30:59 +00:00
andrew
e48bb98eda Force the dynamic linker to resolve _end early so we pick up the correct
copy.

Sponsored by:	ABT Systems Ltd
2015-07-02 15:02:59 +00:00
andrew
edb38c8190 Cleanup brk and sbrk to use the same code to find curbrk and minbrk when
both compiling for PIC and non-PIC.

Sponsored by:	ABT Systems Ltd
2015-07-02 14:54:21 +00:00
brueffer
cc8735cf5e Bump .Dd for the example code update.
Submitted by:	loos
2015-07-01 16:50:01 +00:00
br
70d4d5a42d First cut of DTrace for AArch64.
Reviewed by:	andrew, emaste
Sponsored by:	ARM Limited
Differential Revision:	https://reviews.freebsd.org/D2738
2015-07-01 15:51:11 +00:00
br
3f083caafb Make libproc compilable on AArch64. 2015-07-01 13:59:26 +00:00
brueffer
0f503e773f Make the example code actually work.
PR:		199440
Submitted by:	waitman@waitman.net
Reviewed by:	loos
MFC after:	1 week
2015-07-01 09:25:23 +00:00
kib
03c73d6a38 Document x86 machine-specific ptrace(2) requests. Provide list of the
ppc requests.

Reviewed by:	brueffer, emaste, gjb (previous version)
Sponsored by:	The FreeBSD Foundation
Review:	https://reviews.freebsd.org/D2962
MFC after:	2 weeks
2015-06-30 18:53:42 +00:00
andrew
7fb27dff73 Implement fpgetmask, it's needed by Python.
Approved by:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-06-25 08:22:25 +00:00
andrew
181692959b Export __flt_rounds from the arm64 libc.so 2015-06-25 08:15:47 +00:00
ian
66af80ae2d Fix compilation when the armv6 world is being compiled without hw floating
point support.  The fenv-vfp.c file overrides -mfloat-abi so it can use
floating point instructions if it detects support at runtime.  Make it also
override -mfpu in case the user has set -mfpu=none.
2015-06-24 18:29:34 +00:00
andrew
3c91fe4d37 Implement fpsetmask. Some third-party software makes use of it, for example
perl.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-06-24 16:18:58 +00:00
andrew
3d046cb084 Set the alignment of the setjmp magic values correctly. The alignment needs
to be before the lavel, otherwise an extra word may be added between the
label and the data.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FReeBSD Foundation
2015-06-24 16:15:32 +00:00
araujo
cce1064454 Set some internal helpers as static and initialize few variables to silence
CLANG WARNINGS.
BUMP SHLIB_MAJOR version as the ABI potentially changed.

Also run an 'exp run' to double check if any external project are using
those functions. Thanks antoine@.

PR:			200807
Differential Revision:	D2775
Reviewed by:		kib, ngie
2015-06-24 01:48:44 +00:00
araujo
8d3d80571c Remove unused variables to silence CLANG warnings.
Remove some BLANK lines and unnecessary TABS.

Differential Revision:	D2687
Reviewed by:		rodrigc, hselasky
2015-06-24 01:34:35 +00:00
dim
1756896fd2 Merge ^/head r284644 through r284736. 2015-06-23 18:55:08 +00:00
dim
3aff6c77e3 Update llvm/clang build glue. 2015-06-23 18:46:29 +00:00
dim
1ecca63ad3 Add __cxa_deleted_virtual to libcxxrt's version map.
This symbol can sometimes be emitted by clang++, and was not yet
exported from libcxxrt.  Attempt to be compatible with libsupc++ by
using the same CXXABI_1.3.6 symbol version.

Reported by:	yuri@rawbw.com
PR:		200863
Reviewed by:	emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D2850
2015-06-23 17:54:24 +00:00
andrew
8f12ad25e4 Add a workaround to correctly align the stack before calling into C code.
When enough time has passed for users to update their userland the kernel
fix will be applied. This will change the ABI to have x0 point to the args
and sp be correctly aligned.

It is expected this compatibility code can be removed when the kernel and
qemu usermode emulation have both been updated for the new ABI.

This fixes clang failures, and most likely other crashes.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-06-22 19:43:08 +00:00
antoine
f034eccb76 Install ncurses html documentation again after r284345 2015-06-22 05:41:13 +00:00
neel
e419539610 Fix a regression in "movs" emulation after r284539. The regression was caused
due to a change in behavior of the 'vm_map_gpa()'.

Prior to r284539 if 'vm_map_gpa()' was called to map an address range in the
guest MMIO region then it would return NULL. This was used by the "movs"
emulation to detect if the 'src' or 'dst' operand was in MMIO space.

Post r284539 'vm_map_gpa()' started returning a non-NULL pointer even when
mapping the guest MMIO region.

Fix this by returning non-NULL only if [gaddr, gaddr+len) is entirely
within the 'lowmem' or 'highmem' regions and NULL otherwise.

Pointy hat to:	neel
Reviewed by:	grehan
Reported by:	tychon, Ben Perrault (ben.perrault@gmail.com)
MFC after:	1 week
2015-06-22 00:30:34 +00:00
dim
9dd834653b Vendor import of clang trunk r240225:
https://llvm.org/svn/llvm-project/cfe/trunk@240225
2015-06-21 14:00:56 +00:00
dim
60174f118d Vendor import of llvm trunk r240225:
https://llvm.org/svn/llvm-project/llvm/trunk@240225
2015-06-21 13:59:01 +00:00
jilles
f6c1faed68 fts_children: preserve errno after running close/fchdir
PR:		200942
Submitted by:	Conrad Meyer
Differential Revision: https://reviews.freebsd.org/D2852
MFC after:	1 week
2015-06-20 20:54:05 +00:00
dim
e109f99dcb Merge ^/head r284188 through r284643. 2015-06-20 19:34:50 +00:00
neel
8c70d6c7af Restructure memory allocation in bhyve to support "devmem".
devmem is used to represent MMIO devices like the boot ROM or a VESA framebuffer
where doing a trap-and-emulate for every access is impractical. devmem is a
hybrid of system memory (sysmem) and emulated device models.

devmem is mapped in the guest address space via nested page tables similar
to sysmem. However the address range where devmem is mapped may be changed
by the guest at runtime (e.g. by reprogramming a PCI BAR). Also devmem is
usually mapped RO or RW as compared to RWX mappings for sysmem.

Each devmem segment is named (e.g. "bootrom") and this name is used to
create a device node for the devmem segment (e.g. /dev/vmm/testvm.bootrom).
The device node supports mmap(2) and this decouples the host mapping of
devmem from its mapping in the guest address space (which can change).

Reviewed by:	tychon
Discussed with:	grehan
Differential Revision:	https://reviews.freebsd.org/D2762
MFC after:	4 weeks
2015-06-18 06:00:17 +00:00
sjg
852129abd1 new depends 2015-06-16 23:37:19 +00:00
andrew
08e22f2cb8 Export the ARM __aeabi_mem* functions from libc, they are needed by the gcc
from ports as it doesn't include these in the copy of libgcc it installs
uses.

Obtained from:	ABT Systems Ltd
2015-06-16 16:40:25 +00:00
tijl
40b74694d5 Follow up to r284427: fix NaN mixing for ctanhf too. 2015-06-15 20:47:26 +00:00
tijl
d8479224d3 - Change comments to be more consistent with s_ccosh.c and s_csinh.c.
- Fix a case where NaNs were not mixed correctly and signalling NaNs were
  not converted to quiet NaNs.
- Eliminate two negations from ctan(z).

In collaboration with:	bde
2015-06-15 20:40:44 +00:00
tijl
b8215915e9 Fix some exceptional cases where the sign of the result is unspecified
but must still satisfy csinh(conj(z)) == conj(csinh(z)) and csinh(-z) ==
-csinh(z).  This allows eliminating two negations from csin(z).

In collaboration with:	bde
2015-06-15 20:16:53 +00:00
sjg
3f58070b3a Pay attention to MK_ELFTOOLCHAIN_TOOLS so we build the desired tools. 2015-06-15 20:11:15 +00:00
tijl
e045ce7358 Fix some exceptional cases where the sign of the result is unspecified
but must still satisfy ccosh(conj(z)) == conj(ccosh(z)) and ccosh(-z) ==
ccosh(z).

In collaboration with:	bde
2015-06-15 20:11:06 +00:00
bapt
594e07bd1b Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
bapt
9fb85ece8b Enforce overwritting SHLIBDIR
Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading
bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere.

This makes /lib being populated again.

Reported by:	many
2015-06-15 15:34:20 +00:00
tuexen
eedf79175a Fix name of a constant.
MFC after: 3 days
2015-06-14 20:16:36 +00:00
kib
19fcbfd486 Fix typo in comment.
MFC after:	3 days
2015-06-14 19:19:46 +00:00
jlh
5c79c74f6b NetBSD commit log:
Use a constant array for the MIB. Newer LLVM decided that mib[] warranted
  stack protections, with the obvious crash after the setup was done.
  As a positive side effect, code size shrinks a bit.

I'm not sure why this hasn't bitten us yes, but it is certainly possible and
there are no real drawbacks to this change anyway.

Submitted by:	pfg
Obtained from:	NetBSD
MFC after:	1 week
2015-06-14 07:47:18 +00:00
dim
8cd240ced1 Fix the following clang 3.7.0 warnings in lib/libfetch/http.c:
lib/libfetch/http.c:1628:26: error: address of array 'purl->user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = purl->user ?
                                                   ~~~~~~^~~~ ~
    lib/libfetch/http.c:1630:30: error: address of array 'purl->pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = purl->pwd?
                                                       ~~~~~~^~~~
    lib/libfetch/http.c:1657:25: error: address of array 'url->user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url->user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1659:29: error: address of array 'url->pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url->pwd ?
                                                       ~~~~~^~~ ~
    lib/libfetch/http.c:1669:25: error: address of array 'url->user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url->user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1671:29: error: address of array 'url->pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url->pwd ?
                                                       ~~~~~^~~ ~

Since url->user and url->pwd are arrays, they can never be NULL, so the
checks can be removed.

Reviewed by:	bapt
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D2673
2015-06-13 19:26:48 +00:00
sjg
008d7c831f Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
sjg
750b155101 Misc fixes from projects/bmake
Differential Revision:       D2748
Reviewed by: brooks imp
2015-06-11 21:13:05 +00:00
araujo
b88cbe703a Remove unnecessary variable and fix the usage of sysctl(3).
Differential Revision:	D2733
Reviewed by:		ngie, kib
2015-06-11 01:22:27 +00:00
delphij
7d7b7b5da3 MFV r284234:
Update file to 5.23.

MFC after:	2 weeks
2015-06-10 19:22:41 +00:00
dim
238df27d05 Update Makefiles and other build glue for llvm/clang 3.7.0, as of trunk
r239412.
2015-06-10 19:12:52 +00:00
ume
ef4c2ddbf3 Add support for '_' occurring at the beginning or end of a name
component.

PR:		176093
Submitted by:	landonf__at__bikemonkey.org
MFC after:	1 week
2015-06-10 16:15:22 +00:00
brooks
b06e460d39 List kinfo_getfile.c only once.
MFC after:	3 days
Sponsored by:	DARPA, AFRL
2015-06-10 15:07:13 +00:00
br
319e9e4b6c o Rework ARMv7 events list using aliases - same way as we have for arm64.
o Extend it with Cortex A9-specific events.
2015-06-10 12:42:30 +00:00
ken
aec8808588 Add support for reading MAM attributes to camcontrol(8) and libcam(3).
MAM is Medium Auxiliary Memory and is most commonly found as flash
chips on tapes.

This includes support for reading attributes and decoding most
known attributes, but does not yet include support for writing
attributes or reporting attributes in XML format.

libsbuf/Makefile:
	Add subr_prf.c for the new sbuf_hexdump() function.  This
	function is essentially the same function.

libsbuf/Symbol.map:
	Add a new shared library minor version, and include the
	sbuf_hexdump() function.

libsbuf/Version.def:
	Add version 1.4 of the libsbuf library.

libutil/hexdump.3:
	Document sbuf_hexdump() alongside hexdump(3), since it is
	essentially the same function.

camcontrol/Makefile:
	Add attrib.c.

camcontrol/attrib.c:
	Implementation of READ ATTRIBUTE support for camcontrol(8).

camcontrol/camcontrol.8:
	Document the new 'camcontrol attrib' subcommand.

camcontrol/camcontrol.c:
	Add the new 'camcontrol attrib' subcommand.

camcontrol/camcontrol.h:
	Add a function prototype for scsiattrib().

share/man/man9/sbuf.9:
	Document the existence of sbuf_hexdump() and point users to
	the hexdump(3) man page for more details.

sys/cam/scsi/scsi_all.c:
	Add a table of known attributes, text descriptions and
	handler functions.

	Add a new scsi_attrib_sbuf() function along with a number
	of other related functions that help decode attributes.

	scsi_attrib_ascii_sbuf() decodes ASCII format attributes.

	scsi_attrib_int_sbuf() decodes binary format attributes, and
	will pass them off to scsi_attrib_hexdump_sbuf() if they're
	bigger than 8 bytes.

	scsi_attrib_vendser_sbuf() decodes the vendor and drive
	serial number attribute.

	scsi_attrib_volcoh_sbuf() decodes the Volume Coherency
	Information attribute that LTFS writes out.

sys/cam/scsi/scsi_all.h:
	Add a number of attribute-related structure definitions and
	other defines.

	Add function prototypes for all of the functions added in
	scsi_all.c.

sys/kern/subr_prf.c:
	Add a new function, sbuf_hexdump().  This is the same as
	the existing hexdump(9) function, except that it puts the
	result in an sbuf.

	This also changes subr_prf.c so that it can be compiled in
	userland for includsion in libsbuf.

	We should work to change this so that the kernel hexdump
	implementation is a wrapper around sbuf_hexdump() with a
	statically allocated sbuf with a drain.  That will require
	a drain function that goes to the kernel printf() buffer
	that can take a non-NUL terminated string as input.
	That is because an sbuf isn't NUL-terminated until it is
	finished, and we don't want to finish it while we're still
	using it.

	We should also work to consolidate the userland hexdump and
	kernel hexdump implemenatations, which are currently
	separate.  This would also mean making applications that
	currently link in libutil link in libsbuf.

sys/sys/sbuf.h:
	Add the prototype for sbuf_hexdump(), and add another copy
	of the hexdump flag values if they aren't already defined.

	Ideally the flags should be defined in one place but the
	implemenation makes it difficult to do properly.  (See
	above.)

Sponsored by:	Spectra Logic Corporation
MFC after:	1 week
2015-06-09 21:39:38 +00:00
dim
6370dd4a2c Merged ^/head r283871 through r284187. 2015-06-09 19:14:27 +00:00
dim
bb9760db9b Vendor import of clang trunk r239412:
https://llvm.org/svn/llvm-project/cfe/trunk@239412
2015-06-09 19:08:19 +00:00
dim
9b27354f6f Vendor import of llvm trunk r239412:
https://llvm.org/svn/llvm-project/llvm/trunk@239412
2015-06-09 19:06:30 +00:00
sjg
75a137820d dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
bapt
686e2201d5 Sync with NetBSD:
- fix types of rl_completion_entry_function and rl_add_defun
- call update pos before completion to refresh the screen
From Thomas Eriksson

Adjust API to a more modern readline (Ryo Onodera)

remove duplicate declaration
2015-06-07 10:01:59 +00:00
andrew
5dd22af8f5 Set the correct register when calling sigprocmask in longjmp.
Submitted by:	Patrick Wildt <patrick@bitrig.org>
Obtained from:	drahn@bitrig.org
2015-06-06 10:28:38 +00:00
jilles
bc19279e14 strchr(3): Mdoc fixes. 2015-06-04 21:54:46 +00:00
bapt
87ba98d649 revert r283969,283970 not needed anymore after r283981 2015-06-04 08:00:11 +00:00
araujo
dc87aac5d1 Remove unused variable and silence clang warnings.
Differential Revision:	D2681
Reviewed by:		rodrigc
2015-06-04 02:50:13 +00:00
araujo
550d9495d7 Clean up unused variable and silence clang warnings.
Differential Revision:	D2682
Reviewed by:		rodrigc
2015-06-04 02:48:04 +00:00
araujo
b85215e38a Remove unused variables and silence clang warnings.
Differential Revision:	D2686
Reviewed by:		rodrigc
2015-06-04 02:44:37 +00:00
bapt
cb7b7bf9fb Capitalize the list of accepted variables
Suggested by:	wblock
2015-06-03 22:01:13 +00:00
bapt
d5461fcfc0 Add a pw_mkdb2(3) function which does the same thing as pw_mkdb(3) except
it takes a new argument allowing to specify the endianness of the database
to generate

Differential Revision:	https://reviews.freebsd.org/D2730
Reviewed by:	ian
2015-06-03 20:48:28 +00:00
bapt
a8f6b60fa1 Fix typo 2015-06-03 19:22:16 +00:00
araujo
0c25b23f88 Remove unused variable allocated_ctx reported by clang.
Differential Revision:	D2684
Reviewed by:		rodrigc
2015-06-02 09:03:15 +00:00
dim
8c2b6d9370 Merge ^/head r283771 through r283870. 2015-06-01 06:54:21 +00:00
araujo
5e0a4eba4f Remove unused variable spotted by clang.
Differential Revision:	D2685
Reviewed by:		rodrigc, stas
2015-06-01 06:05:53 +00:00
dteske
bfdfa517bb Fix a debug statement. Only the callback function (performing the
incrementing of dpv_overall_oread) knows what its purpose is (and
often times it was bytes, not lines).

MFC after:	3 days
X-MFC-to:	stable/10
2015-06-01 02:06:57 +00:00
rodrigc
3d67e5982e Use proper prototype for harmless(). 2015-05-31 19:09:24 +00:00
rodrigc
53b4f20443 Make x_putlong() and x_putbytes() prototypes match the
prototypes in <rpc/xdr.h>
2015-05-31 18:11:20 +00:00
rodrigc
da00b605c1 Use ANSI C prototypes. 2015-05-31 18:08:58 +00:00