Commit Graph

15784 Commits

Author SHA1 Message Date
Hajimu UMEMOTO
cfaa2a0955 Use SOCK_CLOEXEC.
MFC after:	1 week
2014-06-19 11:49:36 +00:00
Konstantin Belousov
11c42bcc54 Add MAP_EXCL flag for mmap(2). It should be combined with MAP_FIXED,
and prevents the request from deleting existing mappings in the
region, failing instead.

Reviewed by:	alc
Discussed with:	jhb
Tested by:	markj, pho (previous version, as part of the bigger patch)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-06-19 05:00:39 +00:00
Konstantin Belousov
8efb419829 The time come to remove the wrapper, most likely, but tidy up it code
instead for now.  Remove spurious blank line, use C89 definition, wrap
long line.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-06-19 04:55:00 +00:00
Pedro F. Giffuni
cd9dcb0307 strptime: add support for %t and %n
Posix strptime() requires support for %t and %n, which were added
to the illumos port.  Curiously we were skipping white spaces by
default in most other cases making %t meaningless.

We now skip spaces in the case of the %e specifier as strftime(3)
explicitly adds a space for the single digit case.

Reference:
http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html

Obtained from:	Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2)
MFC after:	3 weeks
2014-06-18 23:34:48 +00:00
Warren Block
a9e1cffd28 Fix syntax error.
PR:		191131
Submitted by:	dan.mcgregor@usask.ca
MFC after:	1 week
2014-06-18 18:31:35 +00:00
Hajimu UMEMOTO
6f63a1142c Retooling addrconfig() to exclude addresses on loopback interfaces
when looking for configured addresses.
This change is based upon the code from the submitter, and made
following changes:
- Exclude addresses assigned on interfaces which are down, like NetBSD
  does.
- Exclude addresses assigned on interfaces which are ifdisabled.

PR:		190824
Submitted by:	Justin McOmie
MFC after:	1 week
2014-06-18 18:07:19 +00:00
Pedro F. Giffuni
3624c75218 stdtime: style(9) fixes.
Obtained from:	illumos
MFC after:	5 days
2014-06-18 02:36:21 +00:00
Pedro F. Giffuni
0413bfcac9 Update license to strptime(3) implementation.
Our strptime(3) implementation was the base for the illumos
implementation and after contacting the author, Kevin Rudy
stated the code is under a 2-Clause BSD License [1]

After reviewing our local changes to the file in question,
the FreeBSD Foundation has agreed that their contributions
to this file are not required to carry clause 3 or 4 so
the file can be relicensed as in Illumos [2].

References:

[1] https://www.illumos.org/issues/357
[2] Illumos Revision:		13222:02526851ba75

Approved:	core (jhb)
Approved:	FreeBSD Foundation (emaste)
MFC after:	4 days
2014-06-16 14:55:09 +00:00
Hans Petter Selasky
8958a2f085 Fix destruction of character devices by passing correct pointer to
kernel in IOCTL request.

Submitted by:	Andrey Zholos <aaz@q-fu.com>
2014-06-16 14:02:14 +00:00
Ian Lepore
a1c70d6943 Create a mechanism for providing fine-grained build order dependencies
during SUBDIR_PARALLEL builds.  This augments the coarse .WAIT mechanism,
which is still useful if you've got a situation such as "almost everything
depends on A and B".

Because the parallel subdir mechanism uses non-obvious mangling of
target names, which should probably remain a private detail of the
implementation, it's not easy to do things like "libfoo: libbar", so
instead the new mechanism lets you set a variable that lists dependencies:

  SUBDIR_DEPEND_libfoo= libgroodah libpouet

Note that while I'm using libraries as an example here, it really has
nothing to do with the generated library files.  This is really saying
"build in directory libfoo after building in the libgroodah and libpouet
directories."

This updates lib/Makefile with dependency information based on the old
almost-accurate comment block and by combing through lib/* makefiles
looking for LDADD dependencies to other libraries within lib/*.

Reviewed by:	Jia-Shiun Li <jiashiun@gmail.com>
2014-06-15 13:45:37 +00:00
Hans Petter Selasky
36716419f3 Attach the CUSE library and kernel module to the default FreeBSD
builds. Bump the FreeBSD version number.
2014-06-13 08:53:49 +00:00
Tijl Coosemans
cdd0ebc93b iconv_open: initialise ci_ilseq_invalid field of _citrus_iconv_shared
struct after allocation with malloc.

iconvlist: reduce a memory leak by copying strings only once.
2014-06-13 08:36:10 +00:00
Tijl Coosemans
3fc3c30a27 Replace malloc+memset with calloc. 2014-06-13 08:28:51 +00:00
Tijl Coosemans
165a6674ec Replace malloc+memset with calloc. 2014-06-13 08:26:53 +00:00
Xin LI
28dfa008e9 Fix path for zlib examples, this have no runtime effect and was
overlooked when I was doing zlib update.

MFC after:	2 weeks
2014-06-11 20:48:40 +00:00
Baptiste Daroussin
a021956c93 Add a zlib pkg-config file (more and more ports requires it)
Approved by:	delphij
MFC after:	1 week
2014-06-11 20:44:54 +00:00
Baptiste Daroussin
6cfac37b03 Use Mt macro to properly format mailto links (patch from Franco Fichtner <franco@lastsummer.de> for Dragonfly)
Reviewed by:	des
Approved by:	des
Obtained from:	Dragonfly
MFC after:	1 week
2014-06-11 20:20:14 +00:00
Dimitry Andric
6fd4061119 In some scenarios, when generating llvm/clang .inc.h files, multiple
source files could be passed to tblgen or clang-tblgen, leading to a
"Too many positional arguments specified" error message.  Fix this by
replacing the too-generic ${.ALLSRC} sources with explicit paths.

Reported by:	rysto32@gmail.com, rodrigc
MFC after:	3 days
2014-06-10 17:54:24 +00:00
Jilles Tjoelker
078cb49070 siglongjmp(): Preserve floating point exception flags on i386 and amd64.
Per POSIX, siglongjmp() shall be equivalent to longjmp() except that it must
match sigsetjmp() instead of setjmp() and except for the effect on the
signal mask. Therefore, it should preserve the floating point exception
flags.

This was fixed for longjmp() and _longjmp() in r180080 and r180081 for amd64
and i386 respectively.
2014-06-09 21:35:36 +00:00
Bryan Drewery
864c53ead8 In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.
This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by:		Shawn Webb <lattera@gmail.com>
Discussed between:	des@ and Shawn Webb [2]
2014-06-08 17:29:31 +00:00
Neel Natu
5fcf252f41 Add ioctl(VM_REINIT) to reinitialize the virtual machine state maintained
by vmm.ko. This allows the virtual machine to be restarted without having
to destroy it first.

Reviewed by:	grehan
2014-06-07 21:36:52 +00:00
Julio Merino
727a7ce81b Homogenize libatf-* version numbers with upstream.
The libatf-* major version numbers in FreeBSD were one version ahead of
upstream because, when atf was first imported into FreeBSD, the upstream
numbers were not respected.  This is just confusing and bound to cause
problems down the road.

Fix this by taking advantage of the fact that libatf-* are now private
and that atf is not yet built by default.  However, and unfortunately, a
clean build is needed for tests to continue working once "make
delete-old-libs" has been run; hence the note in UPDATING.
2014-06-06 17:05:43 +00:00
Christian Brueffer
b5112fafbb Mdoc cleanup, typo and grammar fixes. 2014-06-06 12:06:40 +00:00
Christian Brueffer
556f150a10 Add missing MLINKs. 2014-06-06 11:52:30 +00:00
Warner Losh
04efeffe99 When building picobsd, define WITHOUT_OPENSSL and WITHOUT_KERBEROS and
remove the now-redundant checks for RELEASE_CRUNCH. This originally
was defined for building smaller sysinstall images, but was later also
used by picobsd builds for a similar purpose. Now that we've moved
away from sysinstall, picobsd is the only remaining consumer of this
interface. Adding these two options reduces the RELEASE_CRUNCH
special cases in the tree by half.
2014-06-06 04:09:07 +00:00
Baptiste Daroussin
c41991303c Add support for arbitrary http requests
Submitted by:	Alex Hornung <alex@alexhornung.com>
Reviewed by:	des
Obtained from:	Dragonfly
MFC after:	3 week
2014-06-05 22:16:26 +00:00
Baptiste Daroussin
4bd8c06c3a Remove unnecessary semicolons
Patch by Sascha Wildner <saw@online.de> for Dragonfly

Reviewed by:	des
Obtained from:	Dragonfly
MFC after:	1 week
2014-06-05 22:13:30 +00:00
Baptiste Daroussin
6064928d01 Use NULL instead of 0
Patch by Sascha Wildner <saw@online.de> for Dragonfly

Reviewed by:	des
Obtained from:	Dragonfly
MFC after:	1 week
2014-06-05 22:10:25 +00:00
Dag-Erling Smørgrav
c257f99e9b If HTTP_USER_AGENT is defined but empty, don't send User-Agent at all.
PR:		184507
Submitted by:	jbeich@tormail.org (with modifications)
MFC after:	1 week
2014-06-05 20:27:16 +00:00
Ed Maste
76e994f506 Update reported libusb version to 1.0.13
QEMU libusb host support needs at least libusbx-1.0.13, and our in-tree
libusb supports the required functionality.  Exp-run in PR.

PR:		181035
2014-06-05 14:19:32 +00:00
Konstantin Belousov
49fe48ab0c For Xeon 7500 and 48XX (Nehalem EX and Westmere EX) variants of the
Core i7 and Westmere processors, the uncore PMC subsystem is
completely different from the uncore PMC on smaller versions of CPUs.
Disable existing uncore hwpmc code for EX, otherwise non-existing MSRs
are accessed.

The cores PMCs seems to be identical for non-EX and EX, according to
the SDM.

Reviewed by:	davide, fabient
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2014-06-04 16:06:38 +00:00
Pietro Cerutti
4c524a4287 - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX).
Update the manpage to reflect this change.
- Always set the current position to the first null-byte when opening in append
mode. This makes the implementation compatible with glibc's. Update the test
suite.

Reported by:	pho
Approved by:	cognet
2014-06-02 13:48:57 +00:00
Neel Natu
95ebc360ef Activate vcpus from bhyve(8) using the ioctl VM_ACTIVATE_CPU instead of doing
it implicitly in vmm.ko.

Add ioctl VM_GET_CPUS to get the current set of 'active' and 'suspended' cpus
and display them via /usr/sbin/bhyvectl using the "--get-active-cpus" and
"--get-suspended-cpus" options.

This is in preparation for being able to reset virtual machine state without
having to destroy and recreate it.
2014-05-31 23:37:34 +00:00
Hans Petter Selasky
dd0118aeef style(9) requires an empty line when function have no local variables.
Suggested by:	ae @
Sponsored by:	DARPA, AFRL
2014-05-30 10:18:01 +00:00
Hans Petter Selasky
8278e27fd2 Add support for snprintf() to libstand.
Reviewed by:	brooks @
Sponsored by:	DARPA, AFRL
2014-05-30 09:43:32 +00:00
Benjamin Kaduk
245d93279b Minor mdoc fix
Submitted by:	hrs
Approved by:	hrs (mentor, implicit)
2014-05-30 02:16:28 +00:00
Pedro F. Giffuni
1bb07edbd4 Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance.
POSIX.1-2008 specifies that those two functions should be declared by
including <strings.h>, not <string.h> (the latter only has strcoll_l()
and strxfrm_l()):

http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html

Obtained from:	DragonFlyBSD
Reviewed by:	theraven
MFC after:	2 weeks
2014-05-30 01:09:07 +00:00
Sergey Kandaurov
1d8b56e9a0 mdoc: add missing paragraph macro. 2014-05-29 13:35:13 +00:00
Hajimu UMEMOTO
0cb06892fa Don't break the legacy applications which set
just 2 bytes to salt.

MFC after:	1 week
2014-05-28 16:50:18 +00:00
Allan Jude
647efa79a1 Emphasis on 'do not' and 'complement' in the strcspn(3)
Replace literal parentheses with .Po/.Pc

Approved by:	wblock (mentor)
2014-05-27 04:30:56 +00:00
Neel Natu
6303b65d35 Fix issue with restarting an "insb/insw/insl" instruction because of a page
fault on the destination buffer.

Prior to this change a page fault would be detected in vm_copyout(). This
was done after the I/O port access was done. If the I/O port access had
side-effects (e.g. reading the uart FIFO) then restarting the instruction
would result in incorrect behavior.

Fix this by validating the guest linear address before doing the I/O port
emulation. If the validation results in a page fault exception being injected
into the guest then the instruction can now be restarted without any
side-effects.
2014-05-26 18:21:08 +00:00
Allan Jude
5538d7a1fc Merge strcspn.3 into strspn.3 and clarify the explaination of what they do
Detach strcspn.3 from the build
Add strcspn.3 to MLINKS do it will be symlinked to strspn.3

Approved by:	eadler (mentor), bcr (mentor)
2014-05-25 18:40:32 +00:00
Hans Petter Selasky
6736336e88 Add empty LIBUSB_CALL macro, to be compatible to the libusb 1.0-API
from sourceforge.

PR:		usb/190204
MFC after:	1 week
2014-05-25 18:06:32 +00:00
Julio Merino
17a286a994 Change libatf-c and libatf-c++ to be private libraries.
We should not be leaking these interfaces to the outside world given
that it's much easier for third-party components to use the devel/atf
package from ports.

As a side-effect, we can also drop the ATF pkgconfig and aclocal files
from the base system.  Nothing in the base system needs these, and it
was quite ugly to have to get them installed only so that a few ports
could build.  The offending ports have been fixed to depend on
devel/atf explicitly.

Reviewed by:	bapt
2014-05-25 12:01:13 +00:00
Neel Natu
da11f4aa1d Add libvmmapi functions vm_copyin() and vm_copyout() to copy into and out
of the guest linear address space. These APIs in turn use a new ioctl
'VM_GLA2GPA' to convert the guest linear address to guest physical.

Use the new copyin/copyout APIs when emulating ins/outs instruction in
bhyve(8).
2014-05-24 23:12:30 +00:00
Konstantin Belousov
1c70d00733 Right now, the rtld prefork hook locks the rtld bind lock in the read
mode.  This allows the binder to be functional in the child after the
fork (assuming no lazy loading of a filter is needed), but other rtld
services which require write lock on rtld_bind_lock cause deadlock, if
called by child.

Change the _rtld_atfork() to lock the bind lock in write mode, making
the rtld fully functional after the fork.

Pre-resolve the symbols which are called by the libthr' fork()
interposer, since dynamic resolution causes deadlock due to the
rtld_bind_lock already owned in the write mode.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2014-05-24 10:23:06 +00:00
Hans Petter Selasky
fa0f6e62c6 Initial import of character device in userspace support for FreeBSD.
The CUSE library is a wrapper for the devfs kernel functionality which
is exposed through /dev/cuse . In order to function the CUSE kernel
code must either be enabled in the kernel configuration file or loaded
separately as a module. Currently none of the committed items are
connected to the default builds, except for installing the needed
header files. The CUSE code will be connected to the default world and
kernel builds in a follow-up commit.

The CUSE module was written by Hans Petter Selasky, somewhat inspired
by similar functionality found in FUSE. The CUSE library can be used
for many purposes. Currently CUSE is used when running Linux kernel
drivers in user-space, which need to create a character device node to
communicate with its applications. CUSE has full support for almost
all devfs functionality found in the kernel:
 - kevents
 - read
 - write
 - ioctl
 - poll
 - open
 - close
 - mmap
 - private per file handle data

Requested by several people. Also see "multimedia/cuse4bsd-kmod" in
ports.
2014-05-23 08:46:28 +00:00
Ryan Stone
888fc9f245 Correct a typo.
MFC after:	1 week
2014-05-17 20:39:39 +00:00
Dag-Erling Smørgrav
e9de92ad83 Look for root certificates in /usr/local/etc/ssl before /etc/ssl.
MFH:	1 week
2014-05-17 03:39:56 +00:00
Benjamin Kaduk
6953d7db5c Correct documentation of the limit on how much memory can be mlock()ed
vm.max_wired is a system-wide limit, not per-process.  Reword the
section to make this more clear.

PR:		docs/189214
Submitted by:	Lawrence Chen (original text)
Approved by:	hrs (mentor)
2014-05-17 03:05:52 +00:00