]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
8 years agoMFC r283474:
dchagin [Sat, 9 Jan 2016 17:29:08 +0000 (17:29 +0000)]
MFC r283474:

Rework signal code to allow using it by other modules, like linprocfs:

1. Linux sigset always 64 bit on all platforms. In order to move Linux
sigset code to the linux_common module define it as 64 bit int. Move
Linux sigset manipulation routines to the MI path.

2. Move Linux signal number definitions to the MI path. In general, they
are the same on all platforms except for a few signals.

3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion
tables to avoid conversion errors.

4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside
of allowed on Linux signal numbers.

PR:             197216

git-svn-id: svn://svn.freebsd.org/base/stable/10@293575 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283473:
dchagin [Sat, 9 Jan 2016 17:27:36 +0000 (17:27 +0000)]
MFC r283473:

Add support for /proc/<pid>/auxv.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293574 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283472:
dchagin [Sat, 9 Jan 2016 17:23:57 +0000 (17:23 +0000)]
MFC r283472:

Add vdso and stack names to the /proc/self/maps.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293573 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283471:
dchagin [Sat, 9 Jan 2016 17:22:51 +0000 (17:22 +0000)]
MFC r283471:

According to Linux man sigaltstack(3) shall return EINVAL if the ss
argument is not a null pointer, and the ss_flags member pointed to by ss
contains flags other than SS_DISABLE. However, in fact, Linux also
allows SS_ONSTACK flag which is simply ignored.

For buggy apps (at least mono) ignore other than SS_DISABLE
flags as a Linux do.

While here move MI part of sigaltstack code to the appropriate place.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293572 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283470:
dchagin [Sat, 9 Jan 2016 17:21:28 +0000 (17:21 +0000)]
MFC r283470:

Add EPOLLERR flag handling to epoll.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293571 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293569.
dchagin [Sat, 9 Jan 2016 17:20:19 +0000 (17:20 +0000)]
Regen for r293569.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293570 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283467:
dchagin [Sat, 9 Jan 2016 17:18:03 +0000 (17:18 +0000)]
MFC r283467:

Call nosys in case when the incorrect syscall number is specified.

Its my fault, fixed by mjg@ at r289055.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293567.
dchagin [Sat, 9 Jan 2016 17:15:03 +0000 (17:15 +0000)]
Regen for r293567.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283465:
dchagin [Sat, 9 Jan 2016 17:13:43 +0000 (17:13 +0000)]
MFC r283465:

Add preliminary fallocate system call implementation
to emulate posix_fallocate() function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293567 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283464:
dchagin [Sat, 9 Jan 2016 17:12:45 +0000 (17:12 +0000)]
MFC r283464:

Delete the duplicate of linux_to_native_clockid() function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283463:
dchagin [Sat, 9 Jan 2016 17:11:25 +0000 (17:11 +0000)]
MFC r283463:

Do not use struct l_timespec without conversion. While here move
args->timeout handling before acquiring the futex key at FUTEX_WAIT path.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283462:
dchagin [Sat, 9 Jan 2016 17:10:22 +0000 (17:10 +0000)]
MFC r283462:

Add prototypes for static futex functions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293564 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283461:
dchagin [Sat, 9 Jan 2016 17:08:33 +0000 (17:08 +0000)]
MFC r283461:

As for now our tmpfs is no longer being considered
"highly experimental" remove /dev/shm magic commited
in r218497 and convert tmpfs type to an expected magic number.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293563 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283460:
dchagin [Sat, 9 Jan 2016 17:07:17 +0000 (17:07 +0000)]
MFC r283460:

Print out unsupported futex operation message only once for the process.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283459:
dchagin [Sat, 9 Jan 2016 17:06:21 +0000 (17:06 +0000)]
MFC r283459:

Add some clock mappings used in glibc 2.20.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293561 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283456:
dchagin [Sat, 9 Jan 2016 17:05:00 +0000 (17:05 +0000)]
MFC r283456:

Improve ktr(9) records in thread managment code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283455:
dchagin [Sat, 9 Jan 2016 17:03:53 +0000 (17:03 +0000)]
MFC r283455:

Use local struct proc * varable instead of dereferencing td->td_proc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293559 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283454:
dchagin [Sat, 9 Jan 2016 17:02:35 +0000 (17:02 +0000)]
MFC r283454:

Avoid unnecessary em zeroing in non-exec path
as it already zeroed by malloc with M_ZERO flag
and move zeroing to the proper place in exec path.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293558 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283453:
dchagin [Sat, 9 Jan 2016 17:01:26 +0000 (17:01 +0000)]
MFC r283453:

Remove the unnecessary cast.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293555.
dchagin [Sat, 9 Jan 2016 17:00:15 +0000 (17:00 +0000)]
Regen for r293555.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293556 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283451:
dchagin [Sat, 9 Jan 2016 16:58:57 +0000 (16:58 +0000)]
MFC r283451:

Implement ppoll() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293555 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283450:
dchagin [Sat, 9 Jan 2016 16:58:03 +0000 (16:58 +0000)]
MFC r283450:

td_sigmask of a newly created thread copied from td.
Remove excess initialization of td_sigmask.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283449:
dchagin [Sat, 9 Jan 2016 16:57:03 +0000 (16:57 +0000)]
MFC r283449:

Update Linux compat revision to 32.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293553 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283448:
dchagin [Sat, 9 Jan 2016 16:55:44 +0000 (16:55 +0000)]
MFC r283448:

Connect linux64 module to the build.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293552 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283446:
dchagin [Sat, 9 Jan 2016 16:52:25 +0000 (16:52 +0000)]
MFC r283446:

Include opt_compat.h, so that COMPAT_LINUX32 is defined, and we can
access to the semop structs and functions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293551 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293549.
dchagin [Sat, 9 Jan 2016 16:50:09 +0000 (16:50 +0000)]
Regen for r293549.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283444:
dchagin [Sat, 9 Jan 2016 16:48:50 +0000 (16:48 +0000)]
MFC r283444:

Implement eventfd system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293549 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283443:
dchagin [Sat, 9 Jan 2016 16:47:36 +0000 (16:47 +0000)]
MFC r283443:

Put the correct value for the abi_nfdbits parameter of kern_select() for
all supported Linuxulators.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293548 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293546.
dchagin [Sat, 9 Jan 2016 16:45:54 +0000 (16:45 +0000)]
Regen for r293546.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293547 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283441:
dchagin [Sat, 9 Jan 2016 16:44:17 +0000 (16:44 +0000)]
MFC r283441:

Implement epoll family system calls. This is a tiny wrapper
around kqueue() to implement epoll subset of functionality.
The kqueue user data are 32bit on i386 which is not enough for
epoll user data, so we keep user data in the proc emuldata.

Initial patch developed by rdivacky@ in 2007, then extended
by Yuri Victorovich @ r255672 and finished by me
in collaboration with mjg@ and jillies@.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283440:
dchagin [Sat, 9 Jan 2016 16:39:15 +0000 (16:39 +0000)]
MFC r283440:

For future use in the Linuxulator:

1. Add a kern_kqueue() counterpart for kqueue() with flags parameter.

2. Be a bit secure. To avoid a double fp lookup add a kern_kevent_fp()
counterpart for kern_kevent() with file pointer parameter instead
of file descriptor an pass the buck to it.

Suggested by: mjg [2]

git-svn-id: svn://svn.freebsd.org/base/stable/10@293545 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283439:
dchagin [Sat, 9 Jan 2016 16:33:55 +0000 (16:33 +0000)]
MFC r283439:

Implement F_DUPFD_CLOEXEC fcntl flag.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293543 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283438:
dchagin [Sat, 9 Jan 2016 16:32:35 +0000 (16:32 +0000)]
MFC r283438:

Add several fcntl flags.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293542 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283437:
dchagin [Sat, 9 Jan 2016 16:31:10 +0000 (16:31 +0000)]
MFC r283437:

To avoid code duplication move open/fcntl definitions to the MI
header file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293541 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283436:
dchagin [Sat, 9 Jan 2016 16:29:51 +0000 (16:29 +0000)]
MFC r283436:

Use the BSD_TO_LINUX_SIGNAL() wherever there is no need
to check the ABI as it is known.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293540 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283435:
dchagin [Sat, 9 Jan 2016 16:28:40 +0000 (16:28 +0000)]
MFC r283435:

Convert Linux wait options to the FreeBSD.
Check wait options as a Linux do.
Linux always set WEXITED option not a WUNTRACED|WNOHANG
which is a strange bug.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293539 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283434:
dchagin [Sat, 9 Jan 2016 16:27:33 +0000 (16:27 +0000)]
MFC r283434:

Set WIFCONTINUED to the wait status if needed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293538 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283433:
dchagin [Sat, 9 Jan 2016 16:26:39 +0000 (16:26 +0000)]
MFC r283433:

Rewrite linux_recvfrom. To avoid double conversion of sockaddr use
kern_recvit() directly.
And check fromlen parameter before sockaddr copyin and conversion.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293537 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283432:
dchagin [Sat, 9 Jan 2016 16:25:30 +0000 (16:25 +0000)]
MFC r283432:

Being exported through vdso the note.Linux section used by glibc
to determine the kernel version (this saves one uname call).
Temporarily disable the export of a note.Linux section until I figured
out how to change the kernel version in the note.Linux on the fly.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293536 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283431:
dchagin [Sat, 9 Jan 2016 16:24:30 +0000 (16:24 +0000)]
MFC r283431:

Add AT_RANDOM and AT_EXECFN auxiliary vector entries which are used by
glibc. At list since glibc version 2.16 using AT_RANDOM is mandatory.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293535 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293533.
dchagin [Sat, 9 Jan 2016 16:23:11 +0000 (16:23 +0000)]
Regen for r293533.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293534 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283428:
dchagin [Sat, 9 Jan 2016 16:21:39 +0000 (16:21 +0000)]
MFC r283428:

Change linux faccessat syscall definition to match actual linux one.

The AT_EACCESS and AT_SYMLINK_NOFOLLOW flags are actually implemented
within the glibc wrapper function for faccessat().  If either of these
flags are specified, then the wrapper function employs fstatat() to
determine access permissions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293533 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283427:
dchagin [Sat, 9 Jan 2016 16:20:29 +0000 (16:20 +0000)]
MFC r283427:

Where possible we will use M_LINUX malloc(9) type.
Move M_FUTEX defines to the linux_common.ko.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293532 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293530.
dchagin [Sat, 9 Jan 2016 16:16:16 +0000 (16:16 +0000)]
Regen for r293530.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293531 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283424:
dchagin [Sat, 9 Jan 2016 16:14:24 +0000 (16:14 +0000)]
MFC r283424:

Add preliminary support for x86-64 Linux binaries.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293530 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283423:
dchagin [Sat, 9 Jan 2016 16:12:37 +0000 (16:12 +0000)]
MFC r283423:

Move FEATURE macros for v4l and v4l2 to the common module.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283422:
dchagin [Sat, 9 Jan 2016 16:11:09 +0000 (16:11 +0000)]
MFC r283422:

Refund the proc emuldata struct for future use. For now move flags from
thread emuldata to proc emuldata as it was originally intended.

As we can have both 64 & 32 bit Linuxulator running any eventhandler
can be called twice for us. To prevent this move eventhandlers code
from linux_emul.c to the linux_common.ko module.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293528 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283421:
dchagin [Sat, 9 Jan 2016 16:08:22 +0000 (16:08 +0000)]
MFC r283421:

Introduce a new module linux_common.ko which is intended for the
following primary purposes:

1. Remove the dependency of linsysfs and linprocfs modules from linux.ko,
which will be architecture specific on amd64.

2. Incorporate into linux_common.ko general code for platforms on which
we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit).

3. Move malloc(9) declaration to linux_common.ko, to enable getting memory
usage statistics properly.

Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c
and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko.

Temporarily remove dtrace garbage from linux_mib.c and linux_util.c

git-svn-id: svn://svn.freebsd.org/base/stable/10@293527 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283447:
dchagin [Sat, 9 Jan 2016 16:01:57 +0000 (16:01 +0000)]
MFC r283447:

Fix build with KTR option.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293526 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283420:
dchagin [Sat, 9 Jan 2016 16:00:13 +0000 (16:00 +0000)]
MFC r283420:

Add newfstatat system call for 64-bit Linuxulator.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283419:
dchagin [Sat, 9 Jan 2016 15:58:42 +0000 (15:58 +0000)]
MFC r283419:

Fix compilation with -DDEBUG option.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283417:
dchagin [Sat, 9 Jan 2016 15:57:28 +0000 (15:57 +0000)]
MFC r283417:

Add 64 bit support to the vdso.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283416:
dchagin [Sat, 9 Jan 2016 15:56:01 +0000 (15:56 +0000)]
MFC r283416:

x86_64 Linux do not use multiplexing on ipc system calls.
Move struct ipc_perm definition to the MD path as it differs for 64 and
32 bit platform.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293522 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283415:
dchagin [Sat, 9 Jan 2016 15:54:55 +0000 (15:54 +0000)]
MFC r283415:

Disable i386 call for x86-64 Linux.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293521 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283414:
dchagin [Sat, 9 Jan 2016 15:53:50 +0000 (15:53 +0000)]
MFC r283414:

Print out proper procmap entry for 64 bit binaries.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283413:
dchagin [Sat, 9 Jan 2016 15:52:32 +0000 (15:52 +0000)]
MFC r283413:

64-bit paltforms, like x86_64, do not use multiplexing on
socketcall system calls.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283412:
dchagin [Sat, 9 Jan 2016 15:50:55 +0000 (15:50 +0000)]
MFC r283412:

Get ready to commit x86_64 Linux emulation.
All fields of type l_int in struct statfs are defined
as l_long on i386 and amd64.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283411:
dchagin [Sat, 9 Jan 2016 15:49:42 +0000 (15:49 +0000)]
MFC r283411:

Remove stale comment about a signal trampoline which
is moved to the shared page at r219609.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283410:
dchagin [Sat, 9 Jan 2016 15:48:11 +0000 (15:48 +0000)]
MFC r283410:

Put linux_platform into the vdso to avoid copying it onto the stack at
every exec.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283408:
dchagin [Sat, 9 Jan 2016 15:46:05 +0000 (15:46 +0000)]
MFC r283408:

Eliminate a now unused global declaration of elf_linux_sysvec.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293515 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283407:
dchagin [Sat, 9 Jan 2016 15:44:38 +0000 (15:44 +0000)]
MFC r283407:

Implement vdso - virtual dynamic shared object. Through vdso Linux
exposes functions from kernel with proper DWARF CFI information so that
it becomes easier to unwind through them.
Using vdso is a mandatory for a thread cancelation && cleanup
on a modern glibc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293514 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293511.
dchagin [Sat, 9 Jan 2016 15:40:44 +0000 (15:40 +0000)]
Regen for r293511.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283403:
dchagin [Sat, 9 Jan 2016 15:39:41 +0000 (15:39 +0000)]
MFC r283403:

Implement pselect6() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293510.
dchagin [Sat, 9 Jan 2016 15:38:16 +0000 (15:38 +0000)]
Regen for r293510.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283401:
dchagin [Sat, 9 Jan 2016 15:37:10 +0000 (15:37 +0000)]
MFC r283401:

Implement prlimit64() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293508.
dchagin [Sat, 9 Jan 2016 15:35:57 +0000 (15:35 +0000)]
Regen for r293508.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283399:
dchagin [Sat, 9 Jan 2016 15:34:54 +0000 (15:34 +0000)]
MFC r283399:

Implement dup3() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283398:
dchagin [Sat, 9 Jan 2016 15:33:48 +0000 (15:33 +0000)]
MFC r283398:

Sched_rr_get_interval returns EINVAL in case when the invalid pid
specified. This silence the ltp tests.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293505.
dchagin [Sat, 9 Jan 2016 15:32:33 +0000 (15:32 +0000)]
Regen for r293505.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283396:
dchagin [Sat, 9 Jan 2016 15:31:15 +0000 (15:31 +0000)]
MFC r283396:

Implement rt_sigqueueinfo() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293503.
dchagin [Sat, 9 Jan 2016 15:29:10 +0000 (15:29 +0000)]
Regen for r293503.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283394:
dchagin [Sat, 9 Jan 2016 15:28:05 +0000 (15:28 +0000)]
MFC r283394:

Implement waitid() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293501.
dchagin [Sat, 9 Jan 2016 15:26:20 +0000 (15:26 +0000)]
Regen for r293501.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283392:
dchagin [Sat, 9 Jan 2016 15:25:22 +0000 (15:25 +0000)]
MFC r283392:

struct l_rusage does not defined for i386 Linuxulator due to it's nature.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283391:
dchagin [Sat, 9 Jan 2016 15:23:54 +0000 (15:23 +0000)]
MFC r283391:

To reduce code duplication introduce linux_copyout_rusage() method.
Use it in linux_wait4() system call and move linux_wait4() to the MI path.
While here add a prototype for the static bsd_to_linux_rusage().

git-svn-id: svn://svn.freebsd.org/base/stable/10@293500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283390:
dchagin [Sat, 9 Jan 2016 15:22:50 +0000 (15:22 +0000)]
MFC r283390:

Add a function for converting wait options.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283389:
dchagin [Sat, 9 Jan 2016 15:21:45 +0000 (15:21 +0000)]
MFC r283389:

Add a siginfo_t conversion function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283388:
dchagin [Sat, 9 Jan 2016 15:20:48 +0000 (15:20 +0000)]
MFC r283388:

Remove a now unused define.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283386:
dchagin [Sat, 9 Jan 2016 15:19:43 +0000 (15:19 +0000)]
MFC r283386:

Introduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use instead
of harcoded pr_osrelease, pr_osrel values. This will be used later in
the VDSO.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283385:
dchagin [Sat, 9 Jan 2016 15:18:36 +0000 (15:18 +0000)]
MFC r283385:

Some style(9) && whitespaces fixes. No functional changes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283384:
dchagin [Sat, 9 Jan 2016 15:17:34 +0000 (15:17 +0000)]
MFC r283384:

pthread_join() caller do futex_wait on child_clear_tid. As a results
of multiple simultaneous calls to pthread_join() specifying the same
target thread are undefined wake up the one thread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283383:
dchagin [Sat, 9 Jan 2016 15:16:13 +0000 (15:16 +0000)]
MFC r283383:

Switch linuxulator to use the native 1:1 threads.

The reasons:
1. Get rid of the stubs/quirks with process dethreading,
   process reparent when the process group leader exits and close
   to this problems on wait(), waitpid(), etc.
2. Reuse our kernel code instead of writing excessive thread
   managment routines in Linuxulator.

Implementation details:

1. The thread is created via kern_thr_new() in the clone() call with
   the CLONE_THREAD parameter. Thus, everything else is a process.
2. The test that the process has a threads is done via P_HADTHREADS
   bit p_flag of struct proc.
3. Per thread emulator state data structure is now located in the
   struct thread and freed in the thread_dtor() hook.
   Mandatory holdig of the p_mtx required when referencing emuldata
   from the other threads.
4. PID mangling has changed. Now Linux pid is the native tid
   and Linux tgid is the native pid, with the exception of the first
   thread in the process where tid and pid are one and the same.

Ugliness:

   In case when the Linux thread is the initial thread in the thread
   group thread id is equal to the process id. Glibc depends on this
   magic (assert in pthread_getattr_np.c). So for system calls that
   take thread id as a parameter we should use the special method
   to reference struct thread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293493 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoTo facillitate Linuxulator merging temporarilly revert r288994 (by bdrewery).
dchagin [Sat, 9 Jan 2016 15:12:31 +0000 (15:12 +0000)]
To facillitate Linuxulator merging temporarilly revert r288994 (by bdrewery).

git-svn-id: svn://svn.freebsd.org/base/stable/10@293492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283382:
dchagin [Sat, 9 Jan 2016 14:53:08 +0000 (14:53 +0000)]
MFC r283382:

In preparation for switching linuxulator to the use the native 1:1
threads add a hook for cleaning thread resources before the thread die.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283381:
dchagin [Sat, 9 Jan 2016 14:51:50 +0000 (14:51 +0000)]
MFC r283381:

In preparation for switching linuxulator to the use the native 1:1
threads add per thread emulator state data.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen fro r293487.
dchagin [Sat, 9 Jan 2016 14:48:23 +0000 (14:48 +0000)]
Regen fro r293487.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293488 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283379:
dchagin [Sat, 9 Jan 2016 14:47:08 +0000 (14:47 +0000)]
MFC r283379:

Implement a Linux version of sched_getparam() && sched_setparam().
Temporarily use the first thread in proc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283378:
dchagin [Sat, 9 Jan 2016 14:45:41 +0000 (14:45 +0000)]
MFC r283378:

Remove a now unused include.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293486 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283377:
dchagin [Sat, 9 Jan 2016 14:44:41 +0000 (14:44 +0000)]
MFC r283377:

In preparation for switching linuxulator to the use the native 1:1
threads split sys_sched_getparam(), sys_sched_setparam(),
sys_sched_getscheduler(), sys_sched_setscheduler() to their kern_*
counterparts and add targettd parameter to allow specify the target
thread directly by callee.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293485 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293483.
dchagin [Sat, 9 Jan 2016 14:43:16 +0000 (14:43 +0000)]
Regen for r293483.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293484 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283375:
dchagin [Sat, 9 Jan 2016 14:41:58 +0000 (14:41 +0000)]
MFC r283375:

In preparation for switching linuxulator to the use the native 1:1
threads use MI linux_sched_rr_get_interval() in i386.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293483 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283374:
dchagin [Sat, 9 Jan 2016 14:40:38 +0000 (14:40 +0000)]
MFC r283374:

In preparation for switching linuxulator to the use the native 1:1
threads refactor kern_sched_rr_get_interval() and sys_sched_rr_get_interval().
Add a kern_sched_rr_get_interval() counterpart which takes a targettd
parameter to allow specify target thread directly by callee (new Linuxulator).

Linuxulator temporarily uses first thread in proc.

Move linux_sched_rr_get_interval() to the MI part.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293482 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283373:
dchagin [Sat, 9 Jan 2016 14:38:29 +0000 (14:38 +0000)]
MFC r283373:

In preparation for switching linuxulator to the use the native 1:1
threads introduce kern_thr_alloc() which will be used later in the
linux_clone().

git-svn-id: svn://svn.freebsd.org/base/stable/10@293481 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283372:
dchagin [Sat, 9 Jan 2016 14:36:44 +0000 (14:36 +0000)]
MFC r283372:

In preparation for switching linuxulator to the use the native 1:1
threads split sys_thr_exit() up into sys_thr_exit() and kern_thr_exit().
Move
Where the second will be used in linux_exit() system call later.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293480 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293478.
dchagin [Sat, 9 Jan 2016 14:34:29 +0000 (14:34 +0000)]
Regen for r293478.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293479 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283370:
dchagin [Sat, 9 Jan 2016 14:33:10 +0000 (14:33 +0000)]
MFC r283370:

In preparation for switching linuxulator to the use the native 1:1
threads introduce linux_exit() stub instead of sys_exit() call
(which terminates process).
In the new linuxulator exit() system call terminates the calling
thread (not a whole process).

git-svn-id: svn://svn.freebsd.org/base/stable/10@293478 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283369:
dchagin [Sat, 9 Jan 2016 14:31:03 +0000 (14:31 +0000)]
MFC r283369:

In preparation for switching linuxulator to the use the native 1:1
threads print the thread id in addition to the pid in debug messages.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293477 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoBump __FreeBSD_version after utimensat merge made in r293473.
dchagin [Sat, 9 Jan 2016 14:24:11 +0000 (14:24 +0000)]
Bump __FreeBSD_version after utimensat merge made in r293473.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293474.
dchagin [Sat, 9 Jan 2016 14:21:46 +0000 (14:21 +0000)]
Regen for r293474.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293475 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r277610 (by jillies):
dchagin [Sat, 9 Jan 2016 14:20:23 +0000 (14:20 +0000)]
MFC r277610 (by jillies):

Add futimens and utimensat system calls.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293474 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f