Commit Graph

201169 Commits

Author SHA1 Message Date
dchagin
8ab518aec9 MFC r283467:
Call nosys in case when the incorrect syscall number is specified.

Its my fault, fixed by mjg@ at r289055.
2016-01-09 17:18:03 +00:00
dchagin
c4895a81f6 Regen for r293567. 2016-01-09 17:15:03 +00:00
dchagin
5b01285f9b MFC r283465:
Add preliminary fallocate system call implementation
to emulate posix_fallocate() function.
2016-01-09 17:13:43 +00:00
dchagin
795e029d8d MFC r283464:
Delete the duplicate of linux_to_native_clockid() function.
2016-01-09 17:12:45 +00:00
dchagin
0e75fd64e7 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.
2016-01-09 17:11:25 +00:00
dchagin
f9c41e3407 MFC r283462:
Add prototypes for static futex functions.
2016-01-09 17:10:22 +00:00
dchagin
8be89d308f 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.
2016-01-09 17:08:33 +00:00
dchagin
cb583c148b MFC r283460:
Print out unsupported futex operation message only once for the process.
2016-01-09 17:07:17 +00:00
dchagin
a72b15cf79 MFC r283459:
Add some clock mappings used in glibc 2.20.
2016-01-09 17:06:21 +00:00
dchagin
102940f6d3 MFC r283456:
Improve ktr(9) records in thread managment code.
2016-01-09 17:05:00 +00:00
dchagin
87d899fa7b MFC r283455:
Use local struct proc * varable instead of dereferencing td->td_proc.
2016-01-09 17:03:53 +00:00
dchagin
79ce2b00ac 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.
2016-01-09 17:02:35 +00:00
dchagin
198b8af898 MFC r283453:
Remove the unnecessary cast.
2016-01-09 17:01:26 +00:00
dchagin
09f25351da Regen for r293555. 2016-01-09 17:00:15 +00:00
dchagin
682bdd605d MFC r283451:
Implement ppoll() system call.
2016-01-09 16:58:57 +00:00
dchagin
d2d5fcaa34 MFC r283450:
td_sigmask of a newly created thread copied from td.
Remove excess initialization of td_sigmask.
2016-01-09 16:58:03 +00:00
dchagin
1a379079e7 MFC r283449:
Update Linux compat revision to 32.
2016-01-09 16:57:03 +00:00
dchagin
ed9f0dfcff MFC r283448:
Connect linux64 module to the build.
2016-01-09 16:55:44 +00:00
dchagin
9d7b3777ea MFC r283446:
Include opt_compat.h, so that COMPAT_LINUX32 is defined, and we can
access to the semop structs and functions.
2016-01-09 16:52:25 +00:00
dchagin
b7022d5321 Regen for r293549. 2016-01-09 16:50:09 +00:00
dchagin
1eeab3feb9 MFC r283444:
Implement eventfd system call.
2016-01-09 16:48:50 +00:00
dchagin
623ca98188 MFC r283443:
Put the correct value for the abi_nfdbits parameter of kern_select() for
all supported Linuxulators.
2016-01-09 16:47:36 +00:00
dchagin
2ce85f55b6 Regen for r293546. 2016-01-09 16:45:54 +00:00
dchagin
ea9daca708 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@.
2016-01-09 16:44:17 +00:00
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