Commit Graph

201145 Commits

Author SHA1 Message Date
dchagin
b6688c70e9 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]
2016-01-09 16:39:15 +00:00
dchagin
a95b158e60 MFC r283439:
Implement F_DUPFD_CLOEXEC fcntl flag.
2016-01-09 16:33:55 +00:00
dchagin
6c949662c5 MFC r283438:
Add several fcntl flags.
2016-01-09 16:32:35 +00:00
dchagin
2205518265 MFC r283437:
To avoid code duplication move open/fcntl definitions to the MI
header file.
2016-01-09 16:31:10 +00:00
dchagin
f31e70952f MFC r283436:
Use the BSD_TO_LINUX_SIGNAL() wherever there is no need
to check the ABI as it is known.
2016-01-09 16:29:51 +00:00
dchagin
cda33c12b3 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.
2016-01-09 16:28:40 +00:00
dchagin
711049c77b MFC r283434:
Set WIFCONTINUED to the wait status if needed.
2016-01-09 16:27:33 +00:00
dchagin
c0b5073f8d MFC r283433:
Rewrite linux_recvfrom. To avoid double conversion of sockaddr use
kern_recvit() directly.
And check fromlen parameter before sockaddr copyin and conversion.
2016-01-09 16:26:39 +00:00
dchagin
a1e3b366c7 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.
2016-01-09 16:25:30 +00:00
dchagin
68ddeae1b4 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.
2016-01-09 16:24:30 +00:00
dchagin
6a70519414 Regen for r293533. 2016-01-09 16:23:11 +00:00
dchagin
f186d260e2 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.
2016-01-09 16:21:39 +00:00
dchagin
9bb36bc01c MFC r283427:
Where possible we will use M_LINUX malloc(9) type.
Move M_FUTEX defines to the linux_common.ko.
2016-01-09 16:20:29 +00:00
dchagin
199f40b151 Regen for r293530. 2016-01-09 16:16:16 +00:00
dchagin
aaac17a4f9 MFC r283424:
Add preliminary support for x86-64 Linux binaries.
2016-01-09 16:14:24 +00:00
dchagin
2b349bc9ba MFC r283423:
Move FEATURE macros for v4l and v4l2 to the common module.
2016-01-09 16:12:37 +00:00
dchagin
6c12e20ac1 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.
2016-01-09 16:11:09 +00:00
dchagin
d30e84112a 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
2016-01-09 16:08:22 +00:00
dchagin
e6de850e05 MFC r283447:
Fix build with KTR option.
2016-01-09 16:01:57 +00:00
dchagin
f1749dc5ea MFC r283420:
Add newfstatat system call for 64-bit Linuxulator.
2016-01-09 16:00:13 +00:00
dchagin
de7c911268 MFC r283419:
Fix compilation with -DDEBUG option.
2016-01-09 15:58:42 +00:00
dchagin
6ad4ee40e0 MFC r283417:
Add 64 bit support to the vdso.
2016-01-09 15:57:28 +00:00
dchagin
793bb9c3f7 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.
2016-01-09 15:56:01 +00:00
dchagin
0a1120ef09 MFC r283415:
Disable i386 call for x86-64 Linux.
2016-01-09 15:54:55 +00:00
dchagin
d394e9fe7e MFC r283414:
Print out proper procmap entry for 64 bit binaries.
2016-01-09 15:53:50 +00:00
dchagin
62726e37ba MFC r283413:
64-bit paltforms, like x86_64, do not use multiplexing on
socketcall system calls.
2016-01-09 15:52:32 +00:00
dchagin
8ecef5bcca 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.
2016-01-09 15:50:55 +00:00
dchagin
f536abaf31 MFC r283411:
Remove stale comment about a signal trampoline which
is moved to the shared page at r219609.
2016-01-09 15:49:42 +00:00
dchagin
a034df74fd MFC r283410:
Put linux_platform into the vdso to avoid copying it onto the stack at
every exec.
2016-01-09 15:48:11 +00:00
dchagin
5c3e282c6e MFC r283408:
Eliminate a now unused global declaration of elf_linux_sysvec.
2016-01-09 15:46:05 +00:00
dchagin
18c1672334 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.
2016-01-09 15:44:38 +00:00
dchagin
2e9cc3f70d Regen for r293511. 2016-01-09 15:40:44 +00:00
dchagin
4ed27590e5 MFC r283403:
Implement pselect6() system call.
2016-01-09 15:39:41 +00:00
dchagin
4992ef5f9d Regen for r293510. 2016-01-09 15:38:16 +00:00
dchagin
027f6631c0 MFC r283401:
Implement prlimit64() system call.
2016-01-09 15:37:10 +00:00
dchagin
a82405c150 Regen for r293508. 2016-01-09 15:35:57 +00:00
dchagin
b4d7be064f MFC r283399:
Implement dup3() system call.
2016-01-09 15:34:54 +00:00
dchagin
9ef9a01839 MFC r283398:
Sched_rr_get_interval returns EINVAL in case when the invalid pid
specified. This silence the ltp tests.
2016-01-09 15:33:48 +00:00
dchagin
e327d1c9cc Regen for r293505. 2016-01-09 15:32:33 +00:00
dchagin
df59792813 MFC r283396:
Implement rt_sigqueueinfo() system call.
2016-01-09 15:31:15 +00:00
dchagin
4e3ae75e5e Regen for r293503. 2016-01-09 15:29:10 +00:00
dchagin
3c97a00938 MFC r283394:
Implement waitid() system call.
2016-01-09 15:28:05 +00:00
dchagin
fb0e6af659 Regen for r293501. 2016-01-09 15:26:20 +00:00
dchagin
1e272b87c5 MFC r283392:
struct l_rusage does not defined for i386 Linuxulator due to it's nature.
2016-01-09 15:25:22 +00:00
dchagin
a14064e328 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().
2016-01-09 15:23:54 +00:00
dchagin
778af4f786 MFC r283390:
Add a function for converting wait options.
2016-01-09 15:22:50 +00:00
dchagin
b9febf10b6 MFC r283389:
Add a siginfo_t conversion function.
2016-01-09 15:21:45 +00:00
dchagin
06c014ef0f MFC r283388:
Remove a now unused define.
2016-01-09 15:20:48 +00:00
dchagin
a014fbe805 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.
2016-01-09 15:19:43 +00:00
dchagin
2646cf70a0 MFC r283385:
Some style(9) && whitespaces fixes. No functional changes.
2016-01-09 15:18:36 +00:00