Commit Graph

16596 Commits

Author SHA1 Message Date
Renato Botelho
4cf57592f7 Bump .Dd due to changes made in r285050 and r285053
Spotted by:	loos
Approved by:	loos
2015-07-02 19:41:08 +00:00
Renato Botelho
6c5f7b239f Improve pw_lock.3 text changed in r285050
Suggested by:	wblock
Approved by:	gnn
2015-07-02 18:27:18 +00:00
Renato Botelho
d32a66b2a2 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 Turner
b339ef955c 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 Turner
74735cf188 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
Christian Brueffer
35189d4784 Bump .Dd for the example code update.
Submitted by:	loos
2015-07-01 16:50:01 +00:00
Ruslan Bukin
b78ee15e9f 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
Ruslan Bukin
27e54fb59e Make libproc compilable on AArch64. 2015-07-01 13:59:26 +00:00
Christian Brueffer
b28dfe6570 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
Konstantin Belousov
23e1c1251c 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 Turner
93b86b2fb0 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 Turner
bbe1d59571 Export __flt_rounds from the arm64 libc.so 2015-06-25 08:15:47 +00:00
Ian Lepore
cbc120b22c 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 Turner
f36c0f6257 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 Turner
a998adbb90 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
Marcelo Araujo
bf41706273 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
Marcelo Araujo
721d6da7ef 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
Dimitry Andric
e350ac5e37 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 Turner
65706c12b2 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 Brodin
2d6f816466 Install ncurses html documentation again after r284345 2015-06-22 05:41:13 +00:00
Neel Natu
36e8356e99 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
Jilles Tjoelker
764a9bbee1 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
Neel Natu
9b1aa8d622 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
Simon J. Gerraty
2ef6d5a7b9 new depends 2015-06-16 23:37:19 +00:00
Andrew Turner
9975c7a7ef 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 Coosemans
65c323f2ac Follow up to r284427: fix NaN mixing for ctanhf too. 2015-06-15 20:47:26 +00:00
Tijl Coosemans
68b433d790 - 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 Coosemans
f0f050e0f9 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
Simon J. Gerraty
cdea5d8c84 Pay attention to MK_ELFTOOLCHAIN_TOOLS so we build the desired tools. 2015-06-15 20:11:15 +00:00
Tijl Coosemans
db7548d040 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
Baptiste Daroussin
18b2ee82db Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
Baptiste Daroussin
4232f82668 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
Michael Tuexen
b96e9390db Fix name of a constant.
MFC after: 3 days
2015-06-14 20:16:36 +00:00
Konstantin Belousov
c5e7289c10 Fix typo in comment.
MFC after:	3 days
2015-06-14 19:19:46 +00:00
Jeremie Le Hen
b7c4ed65cc 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
Dimitry Andric
f2c41c554d 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
Simon J. Gerraty
ccfb965433 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
Simon J. Gerraty
bd831db65c Misc fixes from projects/bmake
Differential Revision:       D2748
Reviewed by: brooks imp
2015-06-11 21:13:05 +00:00
Marcelo Araujo
a7c4e991b8 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
Xin LI
5f0216bd88 MFV r284234:
Update file to 5.23.

MFC after:	2 weeks
2015-06-10 19:22:41 +00:00
Hajimu UMEMOTO
0df21fef2d 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 Davis
ebe071e56a List kinfo_getfile.c only once.
MFC after:	3 days
Sponsored by:	DARPA, AFRL
2015-06-10 15:07:13 +00:00
Ruslan Bukin
3e0bfdd882 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
Kenneth D. Merry
5672fac935 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
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Baptiste Daroussin
9c95743246 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 Turner
cfca10c23e 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 Tjoelker
c0806cdc21 strchr(3): Mdoc fixes. 2015-06-04 21:54:46 +00:00
Baptiste Daroussin
c24c3080ea revert r283969,283970 not needed anymore after r283981 2015-06-04 08:00:11 +00:00
Marcelo Araujo
58c8c85234 Remove unused variable and silence clang warnings.
Differential Revision:	D2681
Reviewed by:		rodrigc
2015-06-04 02:50:13 +00:00